POST
POST /v1/files?beta=true — Claude API
Beta
Anthropic API key (required); https://api.anthropic.com
Claude APIUpload File
- Base URL
- https://api.anthropic.com
- Auth
- x-api-key: <ANTHROPIC_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 199 tokens · Vary: Accept
→ 199 tokens · Vary: Accept
Critical gotchas
Authentication uses the x-api-key header and requests also require an anthropic-version header.
The official OpenAPI URL is discovered from the SDK repository manifest and must remain under Anthropic's trusted Stainless storage prefix.
cURL
curl -X POST 'https://api.anthropic.com/v1/files?beta=true' \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H 'anthropic-version: 2023-06-01' \ -F '[email protected]'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| file | body | string | Yes | The file to upload |
| expires_in_seconds | body | integer | No | Seconds from upload until the file expires and its bytes become permanently unavailable. Must be between 3600 (one hour) and 7776000 (ninety days). |
Response 200 OK
{
"created_at": "2026-09-03T00:00:00Z",
"downloadable": false,
"expires_at": null,
"filename": "string",
"id": "string",
"mime_type": "string",
"scope": null,
"size_bytes": 0,
"type": "string"
} Get a free Claude API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.