LogoWan API Docs
Homepage
X (Twitter)
Homepage

Get started

OverviewIntegration guideCheck balanceDelete a task

Wan models

Wan 3.0Wan 3.0 PrimeWan 3.0 ProWan 3.0 Prime Pro

Seedance models

Seedance 2.5Seedance 2.5 FlashSeedance 2.0Seedance 2.0 FastSeedance 2.0 Mini

Image models

Seedream 5.0 ProSeedream 5.5 API

Language models

Claude APIClaude Haiku 5.5Claude Sonnet 5.5Claude Opus 5.5Claude Fable 5.2GPT APIGPT Luna 6GPT Terra 6.1GPT Sol 6.1GPT Astra 6
X (Twitter)

Claude Sonnet 5.5 API

Claude Sonnet 5.5 API: adaptive and between-tools thinking, parameter limits, streaming and live input, output and cache prices by group.

This reference covers Claude Sonnet 5.5 and its own Messages parameters. Use claude-sonnet-5-5 with POST https://api.wanapi.app/v1/messages. Compare Claude models.

Model settings

SettingClaude Sonnet 5.5
Model IDclaude-sonnet-5-5
Context window1M tokens
Maximum synchronous output128000 tokens, including thinking
Thinking modesAdaptive or between_tools
Default efforthigh
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-sonnet-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-sonnet-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

ParameterType / requiredOfficial constraints and defaults
modelstring, requiredclaude-sonnet-5-5.
max_tokensinteger, required0–128000, including thinking tokens. Officially, 0 populates the prompt cache without generating output; see Current API coverage below.
messagesobject array, requiredAt least one conversation message, at most 100000. Each has role and content; content is a string or content-block array. Ordinary turns use user/assistant. Mid-conversation system messages follow the official placement rules.
systemstring or text-block arrayTop-level instructions. Text blocks can include cache breakpoints.
thinkingobjectDefault: {"type":"adaptive"}. The other supported mode is {"type":"between_tools"}. Manual budgets and disabled are rejected.
thinking.displayenumAdaptive mode only: omitted (default) or summarized. An omitted summary does not mean thinking is disabled.
thinking.block_bindingobject, betaAdaptive mode only. Requires thinking-binding-controls-2026-08-01; follow the official preserved-thinking contract.
output_config.effortenum or nulllow, medium, high, xhigh, max; default high. Null leaves the default in effect.
output_config.formatobject or nullStructured JSON output: {"type":"json_schema","schema":{...}}. Use the supported JSON Schema subset.
streambooleanDefault false; true returns SSE events.
stop_sequencesstring arrayOfficially stops generation at a matching string. The upstream compatibility check did not enforce this behavior.
temperaturenumber or nullOnly 1 is accepted for compatibility; omit it. Other non-null values are rejected.
top_pnumber or nullOnly 0.99–1 is accepted for compatibility; omit it.
top_kno non-null valueSampling is unsupported; omit this property.
toolsobject arrayClient tools have name, input_schema, and optional description / strictness settings. Server tools use their versioned official definitions.
tool_choiceobjectauto (default) or none. any and named forced tool are rejected. auto may include disable_parallel_tool_use.
metadata.user_idstring or nullAt most 512 characters; use an opaque identifier.
cache_controlobject or nulltype: "ephemeral"; ttl: "5m" (default) or "1h". Sonnet 5.5 requires at least 512 cacheable tokens. Block-level cache breakpoints are also supported by the official API.
diagnosticsobject or nullprevious_message_id: string of at most 256 characters or null. Requests cache-divergence diagnostics.
service_tierenumauto (default) or standard_only.
speedenum or nullOmit or use standard / null. Sonnet 5.5 does not support fast.
inference_geostring or nullThe official default comes from the account settings. An accepted request alone does not verify geographic processing.
fallbacksstring, object array or null, beta"default" or up to three fallback entries. Each requires model; optional overrides are max_tokens, thinking, output_config and speed. See the fallback rules below.
fallback_credit_tokenstring, object or nullA token from a prior refusal, or {"token":"...","mode":"strict"}. Object form requires fallback-credit-2026-07-01; mode is strict (default) or best_effort. Cannot accompany a non-null fallbacks value.
containerstring, object or nullContainer ID, or container configuration with optional id and skills (at most 20). Skills use the official type, identifier and version fields.
context_managementobject or nullOfficial context-edit configuration, including edits; null omits the setting. Model-specific edit compatibility still applies.
mcp_serversobject arrayOfficial MCP server definitions, subject to the required beta version and server authentication. An empty-array probe does not verify remote MCP execution.
compactionobject or null, beta{"type":"summarize"}, with compact-2026-09-04; null omits compaction. Enabled compaction cannot be combined with non-null context_management, stop sequences or structured-output format. The signed compaction behavior did not pass the current test.
messages[].output_config.effortenum, betaPer-message effort on a system message; requires mid-conversation-output-config-2026-07-01. Effort-only system messages may appear anywhere; content-bearing system groups follow the official placement rules. It must not change effort in between_tools mode.

Thinking and tools

between_tools accepts only its type property and effort low, medium or high. Do not send display, budget_tokens or block_binding with it. Example:

{
  "model": "claude-sonnet-5-5",
  "max_tokens": 1024,
  "thinking": {"type": "between_tools"},
  "output_config": {"effort": "medium"},
  "messages": [{"role": "user", "content": "Explain this concept briefly."}]
}

Assistant prefilling is unsupported. To continue a pause_turn, replay the returned server-tool assistant content unchanged. Compaction summarizes existing history and is not an assistant prefill. Preserve thinking blocks and signatures exactly; do not move them between models or edit earlier history without following the official binding rules.

On the native Claude API, computer use requires computer_toolset_20260801; computer_20251124 is rejected. Advisor configurations using claude-opus-4-8, claude-opus-4-7 or claude-sonnet-5 are also rejected for this executor.

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 Sonnet 5.5

claude-sonnet-5-5

Claude Sonnet 5.5 — USD per 1 million tokens
Billable tokensclaude · Default
All input lengths
Input (uncached)$1
Output$5
Cache read$0.05
Cache write · 5 minutes$1.25
Cache write · 1 hour$2

— 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-sonnet-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-sonnet-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-sonnet-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.

Model references

  • Official Sonnet 5.5 overview
  • Sonnet 5.5 changes and restrictions
  • Messages parameter reference
  • Per-message effort
  • On-demand compaction
  • Refusals and fallback
  • Fallback credit

Claude Haiku 5.5

Claude Haiku 5.5 API: adaptive or disabled thinking, forced tools, request parameters, streaming and live token prices by group.

Claude Opus 5.5

Claude Opus 5.5 API: adaptive thinking, medium default effort, request parameters, streaming and live token prices by group.

Table of Contents

Model settingsConnect and send a requestCurrent API coverageParametersThinking and toolsMedia inputPricingResponse and streamingOpenAI-compatible formatsUsage logs and errorsModel references