Skip to main content
POST
/
paas
/
v4
/
files
上传文件
curl --request POST \
  --url https://open.bigmodel.cn/api/paas/v4/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form purpose=batch \
  --form file=@example-file
{
  "id": "<string>",
  "object": "file",
  "bytes": 123,
  "created_at": 123,
  "filename": "<string>",
  "purpose": "<string>"
}

Authorizations

Authorization
string
header
required

使用以下格式进行身份验证:Bearer <your api key>

Body

multipart/form-data
file
file
required

要上传的文件

purpose
enum<string>
required

文件的预期用途。 batch:用于批量任务处理,支持 .jsonl 文件格式,,单个文件大小限制为100 MB,文件数不超过 1000 个。Batch指南。 file-extract:用于文档内容抽取,支持的格式包括:pdf、docx、doc、xls、xlsx、ppt、pptx、png、jpg、jpeg、csv,单个文件大小限制为 50M,图片大小不超过5M,文件数不超过 100 个。 code-interpreter:文件上传给代码沙盒CI使用,支持的格式包括:pdf、docx、doc、xls、xlsx、txt、png、jpg、jpeg、csv,单个文件大小限制为 20M,图片大小不超过5M,文件数不超过 100 个。 agent:用于智能体文件上传,支持的格式包括:pdf、docx、doc、xls、xlsx、txt、png、jpg、jpeg、csv,单个文件大小限制为 20M,图片大小不超过5M,文件数不超过 1000 个。 voice-clone-input: 用于音色克隆功能示例音频文件的上传。支持的格式包括mp3、wav

Available options:
batch,
file-extract,
code-interpreter,
agent,
voice-clone-input

Response

业务处理成功

id
string

文件标识符

object
enum<string>
Available options:
file
bytes
integer

文件大小(字节)

created_at
integer

文件创建的Unix时间戳

filename
string

文件名

purpose
string

文件的预期用途

I