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. Portkey 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
- Python
- NodeJS
- REST
- OpenAI Python
- OpenAI NodeJS
Use uploaded files in chat completions
Once a file is uploaded, reference it byfile_id in your chat completions requests:
- Python
- NodeJS
- 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
- Python
- NodeJS
- REST
- OpenAI Python
- OpenAI NodeJS
Get file
- Python
- NodeJS
- REST
- OpenAI Python
- OpenAI NodeJS
Delete file
- Python
- NodeJS
- REST
- OpenAI Python
- OpenAI NodeJS
Supported file types
Anthropic’s Files API supports the following file types:Limitations
- The Files API is only available on direct Anthropic API — it is not supported on Bedrock or Vertex AI
- Files API is currently in beta and requires the
files-api-2025-04-14beta header for cURL requests - Refer to Anthropic’s documentation for the latest file size and rate limits

