Limits and errors
Limits
| Item | Limit |
|---|---|
| Single file, direct upload (one request) | 100,000,000 bytes; empty files are rejected |
| Single file, multipart upload | 20 GiB |
| File storage quota | 20 GiB (21,474,836,480 bytes), shared by files in the account |
OpenAI expires_after | anchor: "created_at", 3,600–2,592,000 seconds (1 hour–30 days) |
Native expires_after | 3,600–7,776,000 seconds (1 hour–90 days) |
Anthropic form expires_in_seconds | 3,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.
Signed uploads
Take the upload addresses, part size and complete_url from the createSigned response; do not hard-code them.
Errors on the completion path
Branch on code, not only on the HTTP status.
| Situation | Status and code | What the client should do |
|---|---|---|
| The upload record does not exist (expired and cleaned up, or not in this account) | 404 FILE_NOT_FOUND | Call createSigned again and upload from the start |
| The token is invalid, revoked or from another account (the signature does not hold, it was revoked, or the upload is not in this account) | 404 FILE_NOT_FOUND | Call createSigned again |
The link is genuine but the action is wrong: POST to status_url, or GET to complete_url | 403 CAPABILITY_MISMATCH | Do not swap the two links; use each as issued |
| The entry named in the token is not the entry the upload belongs to | 403 ENTRY_MISMATCH | Use all links of one session on the same entry; do not forward across entries |
| The session has expired | 410 UPLOAD_EXPIRED (same for status_url and complete_url) | Call createSigned again |
| Some parts are still missing | 400 UPLOAD_PARTS_INVALID | GET status_url to see which part is missing, upload it, then complete |
| Already completed, POSTed again | 201 with the same file as the first time | Treat it as the result of the first call |
Unknown fields
The compatible APIs reject unknown arguments the way their vendors do instead of ignoring them:
| API | Accepted arguments | Anything else |
|---|---|---|
| Anthropic upload | Form file, expires_in_seconds; query beta only | 400 invalid_request_error, e.g. purpose: Extra inputs are not permitted |
| OpenAI upload | Form file, purpose, expires_after[anchor], expires_after[seconds]; no query parameters | 400 invalid_request_error, e.g. Unrecognized request argument supplied: foo, with param naming the field |
| OpenAI list | Query after, order, limit, purpose | Same as above |
The scope_id extension is available 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
| Error | What to do |
|---|---|
PURPOSE_UNSUPPORTED | Supply user_data or vision. |
FILE_EMPTY | Upload a nonempty file. |
FILE_TOO_LARGE | HTTP 413: keep the file within the direct-upload byte limit above. |
FILE_TYPE_UNSUPPORTED | Use 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_ERROR | Check the filename and expiry parameters. |
QUOTA_EXHAUSTED | Delete unneeded files before uploading more. |
| HTTP 404 | Check the ID, account and whether the file has expired or been deleted. |
File is not an eligible image | For 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.