file_id
in a Messages request is supported in all models that support the given file type. For example, images are supported in all Claude 3+ models, PDFs in all Claude 3.5+ models, and various other file types for the code execution tool in Claude 3.5 Haiku plus all Claude 3.7+ models.
The Files API is currently not supported on Amazon Bedrock or Google Vertex AI.
file_id
file_id
instead of re-uploading contentanthropic-beta: files-api-2025-04-14
.file_id
:
File Type | MIME Type | Content Block Type | Use Case |
---|---|---|---|
application/pdf | document | Text analysis, document processing | |
Plain text | text/plain | document | Text analysis, processing |
Images | image/jpeg , image/png , image/gif , image/webp | image | Image analysis, visual tasks |
Datasets, others | Varies | container_upload | Analyze data, create visualizations |
document
blocks (.csv, .txt, .md, .docx, .xlsx), convert the files to plain text, and include the content directly in your message:
document
content block:
image
content block:
Messages
API calls and associated tool usesfile_id
doesn’t exist or you don’t have access to it/v1/messages
request)<
, >
, :
, "
, |
, ?
, *
, \
, /
, or unicode characters 0-31)Messages
requests are priced as input tokens. You can only download files created by the code execution tool.