Claude Opus 5.5 API
Claude Opus 5.5 API: adaptive thinking, medium default effort, request parameters, streaming and live token prices by group.
This reference covers Claude Opus 5.5 and its own Messages parameters. Use claude-opus-5-5 with POST https://api.wanapi.app/v1/messages. Compare Claude models.
Model settings
| Setting | Claude Opus 5.5 |
|---|---|
| Model ID | claude-opus-5-5 |
| Context window | 1M tokens |
| Maximum synchronous output | 128000 tokens, including thinking |
| Thinking modes | Adaptive, always on |
| Default effort | medium |
Forced tool calls (any / tool) | Not supported |
Connect and send a request
Create a key in API key settings. One API key works across all models and groups. Keep it in your server environment as WAN_API_KEY. Send anthropic-version: 2023-06-01; add anthropic-beta only for features that require it.
curl https://api.wanapi.app/v1/messages \
-H "x-api-key: $WAN_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Explain the purpose of a database index in three sentences."}]
}'import os
import anthropic
client = anthropic.Anthropic(
api_key=os.environ["WAN_API_KEY"],
base_url="https://api.wanapi.app",
)
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain the purpose of a database index in three sentences."}],
)
print("".join(block.text for block in message.content if block.type == "text"))Current API coverage
The table below describes this model's native contract. Wan API currently forwards requests through a compatibility layer. Use a positive max_tokens value: the gateway currently replaces 0 with a generation budget, so it cannot be used for cache-only prewarming here.
The current gateway does not forward diagnostics, compaction, fallbacks, fallback_credit_token or thread. It also filters speed, service_tier and inference_geo in the current channel configuration. These fields are documented below to explain the model's contract, but they are not available through this connection yet. A successful response does not mean an ignored field took effect. Beta features that need these fields share the same limitation.
Parameters
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | Yes | — | claude-opus-5-5. |
max_tokens | integer | Yes | — | 0–128000. Includes the tokens spent on thinking. 0 only pre-warms the prompt cache. |
messages | object[] | Yes | — | Alternating user and assistant turns; content is a string or an array of content blocks. The last turn must be user. Exception: to continue a pause_turn response, send its content back as the last assistant message. |
system | string or object[] | No | — | System prompt. |
thinking | object | No | {"type": "adaptive"} | Thinking is adaptive and always on. display: omitted (default) or summarized. |
output_config.effort | enum | No | medium | low, medium, high, xhigh, max. Steers how much the model thinks. |
output_config.format | object | No | — | A JSON schema for structured output. |
stop_sequences | string[] | No | — | Stop when one of these strings is generated. |
stream | boolean | No | false | Stream the response as server-sent events. |
temperature | number | No | — | Only 1 (the default) is accepted, for backwards compatibility; any other value returns a 400 error. Leave it out. |
top_p | number | No | — | Only values from 0.99 to 1 are accepted, for backwards compatibility; any other value returns a 400 error. Leave it out. |
top_k | integer | No | — | Not accepted: any value returns a 400 error. Leave it out. |
tools | object[] | No | — | Tool definitions. |
tool_choice | object | No | — | auto or none; forcing a tool (any or tool) is not supported by this model. |
metadata.user_id | string | No | — | An opaque id for your end user, up to 512 characters. |
cache_control | object | No | — | Top-level prompt-cache breakpoint. |
container, context_management, mcp_servers, diagnostics, service_tier, inference_geo, speed | — | No | — | Native optional fields; see Current API coverage for fields filtered by this connection. |
Thinking and tools
Claude Opus 5.5 always uses adaptive thinking: the model decides how much to think, and output_config.effort steers it. Higher effort usually means more output tokens, a longer wait and a higher cost. With thinking.display set to summarized, the response includes thinking blocks you can show; with omitted, they are left out. Thinking tokens are billed as output tokens.
Media input
For images and PDFs, use publicly accessible HTTP(S) URLs in a user message's content blocks. Host your files yourself; this integration does not provide a Files API or uploads. Example image input:
{"role":"user","content":[
{"type":"image","source":{"type":"url","url":"https://example.com/chart.png"}},
{"type":"text","text":"What does this chart show?"}
]}Use a document block for a PDF. Keep tool-use IDs, complete thinking blocks and signatures unchanged when continuing a conversation. Your application executes client tools and returns their results; declaring a tool does not execute it.
Pricing
USD per 1 million tokens
Current rates include each group’s multiplier. Prices are cached for up to 2 minutes.
One API key works across all models and groups. Default marks the first eligible group in the automatic routing order; the request is billed at the rates of the group actually selected.
Claude Opus 5.5
claude-opus-5-5
| Billable tokens | claude · Default |
|---|---|
| All input lengths | |
| Input (uncached) | $2 |
| Output | $10 |
| Cache read | $0.1 |
| Cache write · 5 minutes | $2.5 |
| Cache write · 1 hour | $4 |
— means no verified quote is available; it does not mean free.
Cache rates apply only when the response reports the corresponding cache usage. Do not count cached tokens again as uncached input.
Multiply each billable token count by its matching rate and divide the total by 1,000,000. Thinking tokens are included in output tokens, not charged a second time. Cache reads, 5-minute writes and 1-hour writes have separate rates. For length-based pricing, choose the applicable band before calculating the request cost.
Response and streaming
A completed message includes id, type, role, model, content, stop_reason and usage. Read text blocks from content; the first block may instead be thinking or a tool call. This example is illustrative:
{
"id": "msg_example",
"type": "message",
"role": "assistant",
"model": "claude-opus-5-5",
"content": [{"type": "text", "text": "A database index helps locate rows without scanning the whole table."}],
"stop_reason": "end_turn",
"usage": {"input_tokens": 24, "output_tokens": 18}
}Set stream: true for SSE and use curl -N. Handle message_start, content_block_start, content_block_delta, content_block_stop, message_delta and message_stop, plus ping and stream errors. Read final usage rather than treating every chunk as a complete response.
OpenAI-compatible formats
The same model ID works with POST /v1/chat/completions and POST /v1/responses. Use Authorization: Bearer YOUR_API_KEY and the OpenAI SDK base URL https://api.wanapi.app/v1. Chat Completions uses messages; Responses uses input. Their fields are converted to Messages, so use /v1/messages for the native parameters documented above.
curl https://api.wanapi.app/v1/chat/completions \
-H "Authorization: Bearer $WAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-5-5","max_tokens":256,"messages":[{"role":"user","content":"Reply with OK."}]}'Usage logs and errors
LLM logs show completed calls from the last 7 days, with the model, input tokens, output tokens and cost. Refresh after a call and filter by claude-opus-5-5. Use Task logs for images and videos.
Inspect the HTTP status and error object when a request fails. Check the key, balance, model ID and supported parameter combinations. A refusal or output-limit stop is different from an HTTP error. If a request or stream is interrupted, check the logs before retrying: a new request can incur another charge.
Claude Sonnet 5.5
Claude Sonnet 5.5 API: adaptive and between-tools thinking, parameter limits, streaming and live input, output and cache prices by group.
Claude Fable 5.2
Claude Fable 5.2 API: adaptive thinking, high default effort, native parameters, beta requirements and live token prices by group.