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.txt
{
  "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

Response

200
application/json

Business processing successful

The response is of type object.