Skip to content

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.

PurposeMIME typesSingle-shot limitUse with
visionimage/png, image/jpeg, image/webp, image/gif100 MBVision-capable models — see Vision
videovideo/mp4, video/webm, video/quicktimeUse Uploads API (8 GB)Video-capable models — see Video Understanding

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.

Terminal window
curl https://api.aiand.com/v1/files \
-H "Authorization: Bearer sk-..." \
-F "file=@cat.png"
# inferred purpose: "vision"

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 the vision capability.
  • purpose: "video" → model must have the video capability.

Mismatched requests return 400 invalid_request_error without ever calling the model.