POST
POST /v1/sessions/{session_id}/resources?beta=true — Claude API
Beta
Anthropic API key (required); https://api.anthropic.com
Claude APIAdd Session Resource
- 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
→ 244 tokens · Vary: Accept
→ 244 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/sessions/session-id/resources?beta=true' \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H 'anthropic-version: 2023-06-01' \ -H 'Content-Type: application/json' \ -d '{ "type": "file", "file_id": "file-id"}'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| session_id | path | string | Yes | Path parameter session_id |
| type | body | string | Yes | Request body field type. |
| file_id | body | string | Yes | ID of a previously uploaded file. |
| mount_path | body | string | No | Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
Response 200 OK
{
"type": "file",
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
} Get a free Claude API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.