跳转到主要内容
POST
/
v1
/
files
Upload File
curl --request POST \
  --url https://api.shuyou.ai/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form purpose=assistants
{
  "id": "file_abc123",
  "object": "file",
  "bytes": 120000,
  "created_at": 1677610602,
  "filename": "document.pdf",
  "purpose": "assistants",
  "status": "processed"
}

授权

Authorization
string
header
必填

Authorization: Bearer YOUR_API_KEY

请求体

multipart/form-data
file
file
必填

File to upload (PDF, images, etc. depending on purpose and model support)

purpose
enum<string>
必填

Intended use of the file

可用选项:
assistants,
batch,
fine-tune,
vision,
user_data
示例:

"assistants"

响应

File uploaded

id
string
示例:

"file_abc123"

object
string
示例:

"file"

bytes
integer
示例:

120000

created_at
integer
示例:

1677610602

filename
string
示例:

"document.pdf"

purpose
string
示例:

"assistants"

status
string
示例:

"processed"