Skip to main content
POST
/
paas
/
v4
/
files
cURL
curl --request POST \
  --url https://api.z.ai/api/paas/v4/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form purpose=agent \
  --form file=@example-file
{
  "id": "<string>",
  "object": "<string>",
  "bytes": 123,
  "filename": "<string>",
  "purpose": "<string>",
  "created_at": 123
}

File Limitations

  • Maximum 100 files
  • Maximum 100MB per file
  • Files retained for 180 days
  • Supported formats: pdf, doc, xlsx, ppt, txt, jpg, png

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer <your api key>

Body

multipart/form-data
purpose
enum<string>
default:agent
required

Upload purpose (agent)

Available options:
agent
file
file
required

File to upload. Limit to 100MB. Allowed formats: pdf, doc, xlsx, ppt, txt, jpg, png.

Response

Processing successful

id
string

Unique identifier of the uploaded file.

object
string

Object type.

bytes
integer

File size in bytes.

filename
string

Name of the uploaded file.

purpose
string

Purpose of the uploaded file.

created_at
integer

Timestamp of file creation.

⌘I