Skip to main content
POST
/
anthropic
/
v1
/
files
Upload file (Anthropic format)
curl --request POST \
  --url http://localhost:8080/anthropic/v1/files \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form 'filename=<string>' \
  --form 'purpose=<string>'
{
  "id": "<string>",
  "type": "file",
  "filename": "<string>",
  "mime_type": "<string>",
  "size_bytes": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "downloadable": true
}

Headers

x-model-provider
string

Provider to use (defaults to anthropic)

Body

multipart/form-data
file
file
required

File to upload (raw file content)

filename
string

Original filename

purpose
string

Purpose of the file (e.g., "batch")

Response

Successful response

id
string
type
string
default:file
filename
string
mime_type
string

MIME type of the file

size_bytes
integer

Size of the file in bytes

created_at
string<date-time>
downloadable
boolean