File Purposes
Every uploaded file has a purpose — a label that tells ai& how the file may be used and which model capabilities are required to reference it.
Supported purposes
Section titled “Supported purposes”| Purpose | MIME types | Single-shot limit | Use with |
|---|---|---|---|
vision | image/png, image/jpeg, image/webp, image/gif | 100 MB | Vision-capable models — see Vision |
video | video/mp4, video/webm, video/quicktime | Use Uploads API (8 GB) | Video-capable models — see Video Understanding |
Inference from MIME
Section titled “Inference from MIME”The purpose field is optional on upload. If you omit it, ai& infers the purpose from the file’s MIME type. This lets the official anthropic SDK — which doesn’t carry a purpose field — work drop-in.
curl https://api.aiand.com/v1/files \ -H "Authorization: Bearer sk-..." \ -F "file=@cat.png"# inferred purpose: "vision"Capability gating at request time
Section titled “Capability gating at request time”When you reference a file_id in a chat message, the file’s purpose must match a capability the target model declares:
purpose: "vision"→ model must have thevisioncapability.purpose: "video"→ model must have thevideocapability.
Mismatched requests return 400 invalid_request_error without ever calling the model.