Files

Limits and errors

Size, storage quota, expiry ranges and error handling.

Limits

ItemLimit
Single file100 MiB (104,857,600 bytes); empty files are rejected
File storage quota20 GiB (21,474,836,480 bytes), shared by files in the account
OpenAI or native expires_afteranchor: "created_at", 3,600–2,592,000 seconds (1 hour–30 days)
Native praxis[expires_in_seconds]3,600–7,776,000 seconds (1 hour–90 days)
Anthropic form expires_in_seconds3,600–7,776,000 seconds (1 hour–90 days)

Choose one expiry setting. Anthropic expires_in_seconds belongs in the form body; as a query parameter it returns 400. See upload parameters.

Unknown fields

The compatible APIs reject unknown arguments the way their vendors do instead of ignoring them:

APIAccepted argumentsAnything else
Anthropic uploadForm file, expires_in_seconds; query beta only400 invalid_request_error, e.g. purpose: Extra inputs are not permitted
OpenAI uploadForm file, purpose, expires_after[anchor], expires_after[seconds]; no query parameters400 invalid_request_error, e.g. Unrecognized request argument supplied: foo, with param naming the field
OpenAI listQuery after, order, limit, purposeSame as above

Extensions such as praxis[expires_in_seconds] and scope_id are available only on the native file API.

Content detection accepts PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, supported audio and video, and UTF-8 text. A filename extension does not make arbitrary binary data acceptable.

Errors

ErrorWhat to do
PURPOSE_UNSUPPORTEDSupply user_data, assistants or vision.
FILE_EMPTYUpload a nonempty file.
FILE_TOO_LARGEKeep the file within 100 MiB.
FILE_TYPE_UNSUPPORTEDUse a supported content type; renaming the extension is insufficient. purpose=vision accepts only images, and a corrupt Office document or ZIP archive also returns this error.
VALIDATION_ERRORCheck the filename and expiry parameters.
QUOTA_EXHAUSTEDDelete unneeded files before uploading more.
HTTP 404Check the ID, account and whether the file has expired or been deleted.
File is not an eligible imageFor conversation input, upload a supported image with purpose=user_data.

Oversized requests can be rejected by the edge with HTTP 413 and an HTML body before the file API returns JSON. Handle the HTTP status before decoding an error body.

API reference → · Cookbook →

Export

On this page