Skip to main content
POST
Upload File
Every request requires anthropic-beta: files-api-2025-04-14.

Authorizations

X-Api-Key
string
header
default:sk-ant-local-default
required

OMA workspace API key.

Headers

anthropic-beta
string
required

Optional header to specify the beta version(s) you want to use.

To use multiple betas, use a comma separated list like beta1,beta2 or specify the header multiple times for each beta.

anthropic-version
string

The version of the OMA API you want to use.

Read more about versioning and our version history here.

Query Parameters

beta
enum<boolean>
required

Selects the beta API contract for this endpoint. Must be true.

Available options:
true

Body

multipart/form-data
file
file
required

The file to upload

Response

Successful Response

created_at
string<date-time>
required

RFC 3339 datetime string representing when the file was created.

Example:

"2025-04-15T18:37:24.100435Z"

filename
string
required

Original filename of the uploaded file.

Required string length: 1 - 500
Example:

"document.pdf"

id
string
required

Unique object identifier.

The format and length of IDs may change over time.

Example:

"file_011CNha8iCJcU1wXNR6q4V8w"

mime_type
string
required

MIME type of the file.

Required string length: 1 - 255
Example:

"application/pdf"

size_bytes
integer
required

Size of the file in bytes.

Required range: x >= 0
Example:

102400

type
string
required

Object type.

For files, this is always "file".

Allowed value: "file"
downloadable
boolean
default:false

Whether the file can be downloaded.

Example:

false

scope
FileScope · object | null

The scope of this file, indicating the context in which it was created (e.g., a session).