API手册
获取文件列表
返回文件列表。
AuthorizationBearer <token>required
添加 Header 'Authorization: Bearer {账户 API Key}' 进行鉴权
In: header
Query Parameters
purposestringrequired
按用途筛选文件
Value in
"batch"limitinteger
返回的最大文件数量(默认 10)
Default
10Range
1 <= valueResponse Body
成功响应 with file list
TypeScript Definitions
Use the response body type in TypeScript.
codeintegerrequired
Example
20000messagestringrequired
Example
"Ok"statusbooleanrequired
Example
truedataobjectrequired
curl --request GET \
--url https://api.siliconflow.cn/v1/files \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.siliconflow.cn/v1/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.siliconflow.cn/v1/files', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
{
"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"