SiliconFlow
API REFERENCE

List Files

Returns a list of files.

GET
/files
AuthorizationBearer <token>required

Set the header 'Authorization: Bearer {your API key}' for authentication

In: header

Query Parameters

purposestringrequired

Filter files by their purpose

Value in"batch"
limitinteger

Maximum number of files to return (default 10)

Default10
Range1 <= value

Response Body

Successful response with file list

TypeScript Definitions

Use the response body type in TypeScript.

codeintegerrequired
Example20000
messagestringrequired
Example"Ok"
statusbooleanrequired
Exampletrue
dataobjectrequired

curl --request GET \
  --url 'https://api.siliconflow.cn/v1/files?purpose=batch' \
  --header 'Authorization: Bearer YOUR_API_KEY'
{
  "code": 20000,
  "message": "Ok",
  "status": true,
  "data": {
    "data": [
      {
        "id": "file-kkhtqklcnm",
        "object": "file",
        "bytes": 806,
        "created_at": 1741777570,
        "filename": "requests-2.jsonl",
        "purpose": "batch",
        "line_count": 2
      }
    ],
    "object": "file"
  }
}
{
  "code": 20012,
  "message": "string",
  "data": "string"
}
"Invalid token"
"Forbidden"
"404 page not found"
{
  "code": 50505,
  "message": "Model service overloaded. Please try again later.",
  "data": "string"
}
"string"
List Files