For direct access, use Anthropic’s Claude API and Messages endpoint. The current Opus model listed for the Claude API is Claude Opus 5.5, with model ID claude-opus-5-5. Requests to another cloud provider or aggregator may require different credentials, endpoints, model IDs, and billing settings. (platform.claude.com)
The cURL example below follows Anthropic’s documented Messages API pattern; it is an example, not a claim that the request was tested. Anthropic’s current API version documentation gives 2026-10-21 as an example of the required anthropic-version header. (platform.claude.com)
Choose an API route
- Direct Anthropic API: Use the endpoint, Console key, and model ID in this guide. Anthropic documents the base URL as
https://api.anthropic.comand Messages asPOST /v1/messages. (platform.claude.com) - Cloud provider: Use that provider’s instructions for credentials, endpoint, model ID, and billing. Anthropic’s model page lists provider-specific IDs; don’t assume the direct Anthropic request transfers unchanged. (
platform.claude.com) - Aggregator: Use the aggregator’s own endpoint, key, model ID, and rates. For example, Venice’s page shows a Venice endpoint and the identifier
claude-opus-4-5; those are Venice-specific details, not Anthropic-native connection instructions.
Make your first direct Anthropic API request
1. Create a Console API key
Create an API key in the Claude Console. Anthropic lists a Console account and API key as prerequisites for using the Claude API. For this example, use a workspace-scoped key: Anthropic says that key operates in the workspace selected when it was created. An unscoped key instead uses the workspace named in the request’s anthropic-workspace-id header; if you use one, supply the ID of a workspace your account can access. (platform.claude.com)
Set the key in your shell rather than writing a real key into source code:
export ANTHROPIC_API_KEY="your-key-here"
Anthropic documents Bearer authentication for direct HTTP requests. Keep production credentials in protected server-side configuration, not browser code. (platform.claude.com)
2. Send a Messages API request
curl -X POST https://api.anthropic.com/v1/messages \
-H "Authorization: Bearer $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2026-10-21" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Explain API rate limiting in one sentence."}
]
}'
The required version header is shown with a currently documented value. The model ID and the model, max_tokens, and messages request pattern follow Anthropic’s Opus model page and Messages API example. The max_tokens value is an output limit, not a promise that the response will use that many tokens. (platform.claude.com)
If you use an unscoped API key instead, add the workspace header using your workspace ID:
-H "anthropic-workspace-id: YOUR_WORKSPACE_ID"
A workspace-scoped key, as specified for the main example, does not need that header to select its workspace. (platform.claude.com)
3. Inspect the response
A successful Messages API response contains a content array of typed blocks. For a simple text response, find the block whose type is text and read its text field. The response also includes the model, a stop reason, and usage counts such as input and output tokens. Select blocks by type rather than assuming text is always in the first position. (platform.claude.com)
If a request fails, inspect its HTTP status and error response, then check the provider, credentials, headers, model ID, and JSON. For transient failures or throttling, use bounded retries with backoff rather than retrying immediately in a loop. Use the limits and guidance for the account and provider you actually call; don’t infer numeric limits from another route. (platform.claude.com)
Opus 5.5 behavior that affects integration
- Thinking is always on. Opus 5.5 uses adaptive thinking. Anthropic says the default effort is
medium; effort controls thinking depth. Thinking tokens count towardmax_tokensand are billed as output tokens, even when thinking text is not returned. (platform.claude.com) - Avoid legacy thinking settings. On Opus 5.5, setting thinking to
disabledor using the older manualbudget_tokensconfiguration returns a 400 error. Omit thethinkingfield or use adaptive thinking; effort is the documented control. (platform.claude.com) - Forced tool choice is unsupported. Anthropic documents that
tool_choiceset toanyor to a specific named tool returns a 400 error for Opus 5.5. (platform.claude.com) - Handle content blocks safely in tool loops. Responses may start with thinking blocks, including blocks whose thinking text is empty at the default display setting. Select blocks by type. When returning a tool result, pass the assistant message and its thinking blocks back complete and unmodified; rebuilding or filtering them can trigger a 400 error. (
platform.claude.com)
For production, keep keys server-side, set workload-appropriate timeouts, handle provider errors and rate limits, and record model and usage data to monitor spend. These are general integration practices; exact provider limits and behavior can vary by route and account. (platform.claude.com)
Claude Opus API pricing
Anthropic’s Claude Platform pricing documentation lists these USD prices per million tokens (MTok) for Opus 5.5. These are direct-platform rates; a cloud provider or aggregator may bill differently. (platform.claude.com)
| Direct Claude Platform usage | Rate |
|---|---|
| Input tokens | $4 / MTok |
| Output tokens | $20 / MTok |
| 5-minute cache write | $5 / MTok |
| 1-hour cache write | $8 / MTok |
| Cache read | $0.20 / MTok |
| Batch API | 50% discount on input and output token rates |
| Fast Mode | $8 input / $40 output per MTok |
Anthropic’s pricing documentation lists the standard and cache rates and a 50% Batch API discount for Opus 5.5. Anthropic lists Fast Mode at $8 per million input tokens and $40 per million output tokens. (platform.claude.com)
Worked estimate: At standard rates, 50,000 input tokens and 5,000 total billable output tokens cost about $0.30: (50,000 ÷ 1,000,000 × $4) + (5,000 ÷ 1,000,000 × $20). The output assumption includes any billable thinking tokens; 5,000 visible answer tokens alone would not establish the total if the request also used thinking. This is a token-rate estimate for the direct Claude Platform, not a quote for another provider. (platform.claude.com)
Anthropic positions Opus 5.5 for long-running agentic coding and knowledge work. Whether it is the right choice depends on your workload: compare quality, latency, and cost on representative tasks before deciding that Opus is worth more than a less expensive suitable model. (platform.claude.com)
Quick checklist
- Choose a provider route and use only its endpoint, credentials, model ID, and pricing.
- For direct Anthropic access, create a workspace-scoped Console key and keep it server-side.
- Send
POST https://api.anthropic.com/v1/messageswith the required API-version header,model,max_tokens, andmessagesfields. - Inspect response content by block type and use the usage fields to track tokens.
- On Opus 5.5, don’t disable thinking, use manual thinking budgets, or force a tool choice.
- Budget with the selected provider’s current rates and evaluate cost and quality on your own workload.
Sources
API overview — Claude Platform Docs
Versions — Claude Platform Docs
Messages — Claude API Reference
Using the Messages API — Claude Platform Docs
Workspaces — Claude Platform Docs
Claude Opus 5.5 — Claude Platform Docs
Claude Opus 5.5 migration guide — Claude Platform Docs
Pricing — Claude Platform Docs
Thinking — Claude Platform Docs
Thinking in tool and multi-turn workflows — Claude Platform Docs
What's new in Claude Opus 5.5 — Claude Platform Docs
