APIMODELSAPIMODELS

How to use Claude Fable 5.2 in Claude Code

TL;DR Set three environment variables and Claude Code runs on Fable 5.2: ANTHROPIC_BASE_URL=https://api.apimodels.app, your apimodels key in ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL=claude-fable-5-2. You pay per token, $4.80 input and $24 output per million (Anthropic lists $8 / $40), with cache reads at $0.12, and there is no subscription or Anthropic account involved. If the primary upstream errors, requests switch to a second channel automatically, and failed requests are not billed. It works from mainland China without a proxy, and you can top up with Alipay, PayPal, a card or USDT.

Model page: Claude Fable 5.2 API — pricing, specs and the playground

Claude Fable 5.2 is the model to put in Claude Code when the work is long and agentic: Anthropic released it on 9 November 2026, and its launch table puts it ahead of Opus 5.5 on the coding benchmarks that look most like a Claude Code session, with 69.9% on FrontierSWE v2 against 62.3% and 49.1% on FrontierCode 2.0 at xhigh effort against 45.5%. Claude Code talks to the Anthropic Messages API, so any gateway that serves /v1/messages can run it. apimodels.app serves /v1/messages and passes prompt caching through.

These are Anthropic’s published numbers, not our own runs. The cost figures below are worked out from the price list, and the actual charge for every request, with input, output and cache tokens broken out, is in the call records of your console.

Setup in three steps

First, sign up at apimodels.app, create an API key in the console and add balance. Second, set the three variables above, either in your shell profile or in ~/.claude/settings.json if you want the change to affect Claude Code only. Third, open a new terminal and run claude in your project. Do not log in with an Anthropic account when Claude Code asks; the variables replace that login.

Already running Claude Code on another model? Type /model claude-fable-5-2 inside the session to switch for that session only, and keep ANTHROPIC_MODEL as your default. The model id is written with hyphens: claude-fable-5-2, not claude-fable-5.2. Anthropic’s help center lists Claude Code 2.1.321 as the minimum version for Fable 5.2, so run claude update first if claude --version shows something older.

To check the key and the model before opening Claude Code, run the curl request at the bottom of this page. A JSON reply with a content array means everything is in place.

What one turn costs

Claude Code re-sends the whole working context on every turn, so most input tokens come back as cache reads, and the cache-read price matters more than the headline input price. On apimodels.app a Fable 5.2 cache read costs $0.12 per million, and cache writes cost $6.00 per million for both the 5-minute and the 1-hour TTL, where Anthropic charges $10 and $16.

As a worked example, a turn that re-reads 60,000 cached tokens and writes 2,000 output tokens costs about $0.0072 for the cache read plus $0.048 for the output, roughly $0.055 in total; the same turn at Anthropic’s list price is about $0.092. Thinking tokens bill as output too, so real turns usually cost more than this example, and more at higher effort.

Per 1M tokensAnthropic listapimodels.app
Input$8$4.80
Output$40$24
Cache read$0.20$0.12
Cache write, 5-minute TTL$10$6.00
Cache write, 1-hour TTL$16$6.00

Effort, and when Opus 5.5 is the better pick

Thinking is always on for Fable 5.2; depth is set by effort, which runs low, medium, high, xhigh and max. Anthropic’s launch post says Claude Code runs it at medium by default, while the API default is high. Anthropic’s launch notes compare cost per finished task rather than per token: at high effort Fable 5.2 scores 45.3% on FrontierCode 2.0, level with Opus 5.5’s best of 45.5%, at about half the cost per task; at medium effort it matches Opus 5.5’s best on the WANDR search tasks at about 40% of the cost.

Per token, Opus 5.5 is exactly half the price on apimodels.app ($2.40 / $12 against $4.80 / $24), so for short, well-scoped edits that either model gets right on the first try, Opus 5.5 or Sonnet 5.5 ($1.20 / $6) costs less. Fable 5.2 earns its price on long, ambiguous changes, multi-hour agent runs and work where a failed attempt is the expensive part.

What does not work, and who should not use it

Security work is the clearest case against Fable 5.2: its safeguards refuse most high-risk cybersecurity requests, and the reply comes back with stop_reason refusal. Anthropic’s own fallback for those requests is Opus 4.8, which is also on apimodels.app at $3 / $13 per million tokens.

Thinking cannot be switched off, and temperature, top_p, top_k and budget_tokens are dropped, so put style instructions in the prompt. Prefilling the assistant turn returns an error. Anthropic does not support forced tool calls on this model, so we send tool_choice as auto plus an instruction to call the tool; it reached the right tool in 10 of 10 of our own checks, but it is not a decoding guarantee. Anthropic’s Fast mode and the Batch API are not offered. Claude Code itself does not depend on any of these, but agents you build on the API should check them.

A single turn on a hard task can run for several minutes at high effort. That is expected; Claude Code streams the reply, and lowering effort shortens it.

Using Fable 5.2 from mainland China

Mainland China, Hong Kong and Macau are not on Anthropic’s list of supported API regions, and Anthropic requires phone verification for new accounts, so signing up for the official API from China does not work. apimodels.app and api.apimodels.app are reachable directly from mainland China without a proxy, and no Anthropic account is needed.

You can top up with Alipay, PayPal, a bank card or USDT. The same key and balance also call GPT, Gemini, DeepSeek and the image, video and audio models on the site; you change the model string, not the account.

Troubleshooting

SymptomCause and fix
Claude Code still asks you to log in to AnthropicThe variables are not loaded. Close every terminal, including the ones inside VS Code or Cursor, and open a new one.
HTTP 401Wrong or missing key. Put the raw key in ANTHROPIC_AUTH_TOKEN, without a Bearer prefix.
model not foundCheck the spelling: claude-fable-5-2 with hyphens.
claude --version is below 2.1.321Run claude update. Anthropic lists 2.1.321 as the minimum Claude Code version for Fable 5.2.
The reply is empty and stop_reason is refusalFable 5.2’s safeguards declined the request. Run that task on claude-opus-4-8 instead.
A turn runs for minutesNormal for hard tasks at high effort. Lower the effort if speed matters more.

Quick start

macOS / Linux (~/.zshrc or ~/.bashrc)

export ANTHROPIC_BASE_URL="https://api.apimodels.app"
export ANTHROPIC_AUTH_TOKEN="sk_…your_apimodels_key…"
export ANTHROPIC_MODEL="claude-fable-5-2"
# then: source ~/.zshrc && claude

Windows (PowerShell)

[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.apimodels.app", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk_…your_apimodels_key…", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-fable-5-2", "User")
# open a new terminal, then run: claude

~/.claude/settings.json (only affects Claude Code)

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.apimodels.app",
    "ANTHROPIC_AUTH_TOKEN": "sk_…your_apimodels_key…",
    "ANTHROPIC_MODEL": "claude-fable-5-2"
  }
}

cURL

curl https://api.apimodels.app/v1/messages \
  -H "x-api-key: $APIMODELS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-fable-5-2",
    "max_tokens": 16000,
    "messages": [{"role": "user", "content": "Reply with exactly: ok"}]
  }'

FAQ

Can Claude Code use Fable 5.2?

Yes. Set ANTHROPIC_BASE_URL to https://api.apimodels.app, put your apimodels key in ANTHROPIC_AUTH_TOKEN and set ANTHROPIC_MODEL to claude-fable-5-2, or type /model claude-fable-5-2 inside a session. You pay per token, $4.80 / $24 per million, with no subscription. It does not suit security research, which Fable 5.2’s safeguards mostly refuse.

Can I use Claude Fable 5.2 in China?

Yes, through apimodels.app: the site and api.apimodels.app are reachable from mainland China without a proxy, no Anthropic account is needed, and you can top up with Alipay, PayPal, a card or USDT. Anthropic’s own API does not list mainland China among its supported regions, so signing up for it directly does not work.

How much does Fable 5.2 cost per Claude Code turn?

A turn that re-reads 60,000 cached tokens and writes 2,000 output tokens comes to about $0.055 on apimodels.app, against about $0.092 at Anthropic’s list price. Thinking tokens bill as output, so real turns usually cost more, especially at high effort. Your console’s call records show the exact charge for each request.

Should I use Fable 5.2 or Opus 5.5 in Claude Code?

Use Fable 5.2 for long, ambiguous changes and multi-hour agent runs, and Opus 5.5 for short, well-scoped edits. Opus 5.5 is half the per-token price ($2.40 / $12), but Anthropic reports that Fable 5.2 at high effort matches Opus 5.5’s best FrontierCode 2.0 score at about half the cost per task, so on hard tasks the bill often favours Fable 5.2.

Does prompt caching work for Fable 5.2 through apimodels.app?

Yes. Cache-control markers are passed through, and Claude Code sets them automatically. Cache reads cost $0.12 per million, and cache writes cost $6.00 per million for both the 5-minute and the 1-hour TTL, so asking for the 1-hour cache costs nothing extra. Caches are per model, so the first request after switching models writes the cache again.

Can Cursor or other coding tools use Fable 5.2 the same way?

Yes. Tools with a custom Anthropic endpoint setting, such as Cursor’s custom Anthropic model option, use the same base URL, key and model id. Tools that only speak the OpenAI format can call POST https://api.apimodels.app/v1/chat/completions with model claude-fable-5-2; reasoning_effort is mapped to Anthropic’s effort.

Related

등재된 곳
APIMODELS on Product HuntAPIMODELS featured on ToolifyAPIMODELS featured on There's An AI For That