file_id instead of re-uploading content each request.
The Files API is in beta and requires the
files-api-2025-04-14 beta header. The AI Gateway sets this automatically for file endpoints when using the SDK. For cURL requests, include the anthropic-beta: files-api-2025-04-14 header.Upload a file
- REST
- OpenAI Python
- OpenAI NodeJS
Use uploaded files in chat completions
Once a file is uploaded, reference it byfile_id in chat completions:
- REST
When using the SDK, the
anthropic-beta header is set automatically for file endpoints. For chat completions with file references via cURL, include anthropic-beta: files-api-2025-04-14 in your request headers.List files
- REST
- OpenAI Python
- OpenAI NodeJS
Get file
- REST
- OpenAI Python
- OpenAI NodeJS
Delete file
- REST
- OpenAI Python
- OpenAI NodeJS

