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 Fable 5.2 API

Claude Fable 5.2 API: adaptive thinking, high default effort, native parameters, beta requirements and live token prices by group.

This reference covers Claude Fable 5.2 and its own Messages parameters. Use claude-fable-5-2 with POST https://api.wanapi.app/v1/messages. Compare Claude models.

Model settings

SettingClaude Fable 5.2
Model IDclaude-fable-5-2
Context window1M tokens
Maximum synchronous output128000 tokens, including thinking
Thinking modesAdaptive, always on
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-fable-5-2",
    "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-fable-5-2",
    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

FieldType / defaultConstraint
modelRequired stringclaude-fable-5-2. Use the exact ID; grouping is automatic.
max_tokensRequired integer0–128000, including thinking. Zero cannot accompany stream true, structured output or forced tools.
messagesRequired array1–100000 official turns; empty only for a thread continuation after pause_turn.
systemString or text-block arrayOmit entirely on thread continuation.
thinkingObject, adaptive by defaultOnly adaptive. display: omitted (default), summarized, updates or null.
output_configObjecteffort: low, medium, high (default), xhigh, max or null. Optional format and task_budget.
output_formatObject or nullDeprecated structured-output alias; prefer output_config.format.
stop_sequencesString arrayNot nullable; incompatible with on-demand compaction.
streamBoolean, falseSSE when true; not nullable.
toolsArrayOfficial client tools and server tools/toolsets. Client tools are executed by your application.
tool_choiceObjectauto or none; forced tool calls are rejected.
metadataObjectuser_id string or null, up to 512 characters.
cache_controlObject or nulltype ephemeral, ttl 5m or 1h.
containerString, object or nullOptional id and up to 20 skills.
context_managementObject or nullOfficial context edits; requires the appropriate beta.
mcp_serversArrayUp to 20 HTTPS servers; requires the appropriate MCP beta.
diagnosticsObject or nullprevious_message_id string or null, up to 256 characters.
service_tierauto or standard_onlyOptional; not nullable.
inference_geoString or nullglobal or us, subject to account availability.
speedString or nullstandard, fast or null; fast needs no beta.
compactionObject or nulltype summarize, optional instructions up to 16384 Unicode characters.
fallbacksdefault, array or nullUp to three distinct targets; official server-side-fallback beta required.
fallback_credit_tokenString, object or nullToken up to 2048 characters; official credit beta required; cannot accompany fallbacks.
threadObject or nullcreate, or continue with previous_message_id; message-threads-2026-08-12 required.

Thinking and tools

Claude Fable 5.2 uses adaptive thinking with high effort by default. It does not support enabled, disabled or between_tools thinking, or budget_tokens. thinking.display: updates needs thinking-display-updates-2026-08-18. thinking.block_binding allows prefix_mismatch_behavior error, drop_block or null with thinking-binding-controls-2026-08-01.

output_config.task_budget requires task-budgets-2026-03-13, type tokens, integer total of at least 20000, and optional nonnegative integer remaining. Omit remaining when using compaction or replaying a signed compaction block. On-demand compaction requires compact-2026-09-04 and cannot accompany context_management, stop_sequences, structured output or forced tools. Threshold compaction uses compact-2026-01-12, with an input_tokens trigger of at least 50000.

Per-message effort on system messages requires mid-conversation-output-config-2026-07-01. Final assistant prefill is rejected; official pause_turn and compaction continuations remain valid.

Use computer_toolset_20260801 for computer use. Advisor tools require advisor-tool-2026-03-01 and a supported target. Your application controls tool execution and permissions.

Thread continuation sends only new messages and must omit system and tools. It cannot accompany compaction or context edits other than keeping all thinking. State expires after five minutes without a request; retain your conversation locally. State-dependent constraints are checked when continuing.

Fable 5.2 fallback targets are Claude Opus 4.8 and Claude Opus 5. Advanced beta execution and fast-mode charging require live verification; the request schema is not a measured capability guarantee.

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 Fable 5.2

claude-fable-5-2

Claude Fable 5.2 — USD per 1 million tokens
Billable tokensclaude · Default
All input lengths
Input (uncached)$4
Output$20
Cache read$0.1
Cache write · 5 minutes$5
Cache write · 1 hour$8

— 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-fable-5-2",
  "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-fable-5-2","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-fable-5-2. 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

  • Model overview
  • Messages reference
  • Thinking

Claude Opus 5.5

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

GPT API

GPT Luna 6, Terra 6.1, Sol 6.1 and Astra 6: OpenAI Responses and Chat Completions, model IDs, reasoning controls and live token prices.

Table of Contents

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