Search + K

Command Palette

Search for a command to run...

Sign In

Upload File

POST /v1/files
Copy endpoint
https://api.anthropic.com

Parameters

header Header Parameters

Name Type
anthropic-beta

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.

string
anthropic-version

The version of the Claude API you want to use.

Read more about versioning and our version history here.

string

Request Body

multipart/form-data required
{ file: string; }

Responses

200 application/json

Successful Response

interface FileMetadataSchema {
created_at: string;
downloadable?: boolean;
filename: string;
id: string;
mime_type: string;
size_bytes: number;
type: "file";
}

Client Errors

4XX application/json

Error response.

See our errors documentation for more details.

interface ErrorResponse {
error: InvalidRequestError
interface InvalidRequestError {
message: string;
type: "invalid_request_error";
}
| AuthenticationError
interface AuthenticationError {
message: string;
type: "authentication_error";
}
| BillingError
interface BillingError {
message: string;
type: "billing_error";
}
| PermissionError
interface PermissionError {
message: string;
type: "permission_error";
}
| NotFoundError
interface NotFoundError {
message: string;
type: "not_found_error";
}
| RateLimitError
interface RateLimitError {
message: string;
type: "rate_limit_error";
}
| GatewayTimeoutError
interface GatewayTimeoutError {
message: string;
type: "timeout_error";
}
| APIError
interface APIError {
message: string;
type: "api_error";
}
| OverloadedError
interface OverloadedError {
message: string;
type: "overloaded_error";
}
;
request_id: string | null;
type: "error";
}