Files

⚠️
Preview — this feature is being built; the design below is the spec.

The Files endpoints store a file once so its id can be used in many requests: documents and images in chat, input lists for batches, inputs and outputs for code execution, and skill packages. Files belong to one workspace and always expire.

OperationMethod and path
Upload a filePOST /v1/files
List filesGET /v1/files
Get a fileGET /v1/files/{file_id}
Download file contentGET /v1/files/{file_id}/content
Delete a fileDELETE /v1/files/{file_id}

The file object

{
  "id": "file_01JBW9Q6RZ",
  "object": "file",
  "filename": "lease.pdf",
  "purpose": "document",
  "bytes": 482113,
  "mime_type": "application/pdf",
  "created_at": 1791820800,
  "expires_at": 1794412800,
  "status": "ready",
  "source": "upload",
  "workspace_id": "wrkspc_01JC0A2C4E6G8J0L2N4Q"
}

Field descriptions are on Get a file.

Limits

LimitValue
File size100 MB; 500 MB for batch and code_input
Storage per workspace100 GB and 10,000 files
Retention1 to 90 days, default 30

Purposes, accepted types and when to use files are explained in the Files API guide.

Was this page helpful?