Fable 5.2
The deepest. For the hardest, longest work.
- ID
claude-fable-5-2- Input
- $8 / M tokens
- Output
- $40 / M tokens
mysticalcomputer.com
A developer's field guide to Claude.
Ten short chapters, from the first request to agents that work on their own. Written for builders, checked against Anthropic's documentation, and kept on one quiet page with no trackers, no cookies and nothing loaded from anywhere else.
BEGIN ↓I
Four names, one temperament: pick by the weight of the work.
Claude comes in tiers. Each tier is the same idea at a different scale: how much it thinks, how fast it answers, what it costs. Every current model reads a one-million-token context and can write up to 128K tokens in one reply. The model ID is the whole string. Never add a date to it.
The deepest. For the hardest, longest work.
claude-fable-5-2The one to reach for first.
claude-opus-5-5Speed and skill for everyday code and agents.
claude-sonnet-5-5The quick one. High volume, low cost.
claude-haiku-5-5Prices are Anthropic's first-party API rates as of November 2026, per million tokens. Haiku 5.5's price applies to prompts up to 100K tokens; longer prompts cost more. Earlier models such as Opus 5, Sonnet 5 and the 4.x line are still served, and prices change, so check the documentation before you budget. Claude Mythos 5.2 matches Fable 5.2 and is open only to verified organizations.
II
One endpoint. Everything else is a feature of it.
Every conversation with Claude goes through a single endpoint, POST /v1/messages. Tools, thinking, structured output and caching are all options on that one request. Use the official SDK for your language. Don't hand-roll HTTP unless you are in a shell script.
pip install anthropic
npm install @anthropic-ai/sdk
import anthropic client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from the environment response = client.messages.create( model="claude-opus-5-5", max_tokens=16000, messages=[{"role": "user", "content": "What is the capital of France?"}], ) # content is a list of blocks: text, thinking, tool_use... check the type first for block in response.content: if block.type == "text": print(block.text)
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic(); // reads ANTHROPIC_API_KEY from the environment const response = await client.messages.create({ model: "claude-opus-5-5", max_tokens: 16000, messages: [{ role: "user", content: "What is the capital of France?" }], }); // content is a list of blocks: text, thinking, tool_use... check the type first for (const block of response.content) { if (block.type === "text") console.log(block.text); }
The client finds its credentials by itself: ANTHROPIC_API_KEY, or a login profile from Anthropic's ant command-line tool. Never commit a key, and never put one in a front-end page.
Check response.stop_reason before you trust the content. end_turn means the reply is finished and max_tokens means it was cut off. tool_use means Claude is waiting for your tool, and refusal means it declined.
III
You don't set how long it thinks. You set how hard it tries.
Current models use adaptive thinking: Claude decides when to reason, and how much. The old fixed "thinking budget" (budget_tokens) is gone on the current models, and sending it returns an error. You steer with one setting, effort, which takes low, medium, high, xhigh or max.
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=16000,
thinking={"type": "adaptive", "display": "summarized"}, # show a readable summary
output_config={"effort": "high"}, # low | medium | high | xhigh | max
messages=[{"role": "user", "content": "Solve this step by step..."}],
)
for block in response.content:
if block.type == "thinking":
print("Thinking:", block.thinking)
elif block.type == "text":
print("Answer:", block.text)
medium, one step below most other models. Set effort explicitly so you always know what you are getting.{"type": "between_tools"} is the thinking-off mode."display": "summarized". If users watch the stream, turn that on, or the start of the reply looks like a long pause.low for chat and sub-tasks, high to xhigh for coding and long agent work, max only when correctness matters more than cost. Measure before you raise a default.IV
Give it hands, and it reaches into the world.
You describe a function. Claude decides when to call it and returns a tool_use block with the arguments. You run the function and send back a tool_result, and the loop continues until Claude has its answer. The SDK's tool runner runs that loop for you.
import anthropic from anthropic import beta_tool client = anthropic.Anthropic() @beta_tool def get_weather(location: str, unit: str = "celsius") -> str: """Get current weather for a location. Args: location: City and state, e.g., San Francisco, CA. unit: Temperature unit, either "celsius" or "fahrenheit". """ return f"72°F and sunny in {location}" # your real lookup goes here runner = client.beta.messages.tool_runner( model="claude-opus-5-5", max_tokens=16000, tools=[get_weather], messages=[{"role": "user", "content": "What's the weather in Paris?"}], ) for message in runner: # one message per turn; stops when Claude is done print(message)
| Tool | Type | What it does |
|---|---|---|
| Web search | web_search_20260209 | Searches the web and cites what it found, filtering results as it goes |
| Web fetch | web_fetch_20260209 | Reads a page whose URL is already in the conversation |
| Code execution | code_execution_20260521 | Runs code in a sandbox Anthropic hosts |
| Tool search | tool_search_tool_bm25_20251119 | Lets Claude find the right tool among hundreds without loading them all |
strict: true on a tool definition guarantees the arguments match its schema. The schema also needs additionalProperties: false and a required list.tool_use blocks. Run them all, then send every result back in a single message. If a tool fails, return its result with is_error: true rather than dropping it.tool_choice any or tool returns an error on Opus 5.5, Sonnet 5.5 and Fable 5.2. Use auto, name the tool in the prompt, and use structured outputs when all you need is JSON.V
What it has read once, it need not read at full price again.
Prompt caching stores the start of your request, so the next request that begins the same way reads it at a fraction of the price and much faster. The match is a strict prefix: change one byte early on and everything after it is recomputed. Order is tools, then system, then messages. Put what never changes first and what always changes last.
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=16000,
cache_control={"type": "ephemeral"}, # cache everything up to the last block
system="You are an expert on this large document...",
messages=[{"role": "user", "content": "Summarize the key points"}],
)
# Proof it worked: this should be above zero on the second identical call
print(response.usage.cache_read_input_tokens)
cache_read_input_tokens stays at zero, look for one of these.{"role": "system"} message to messages instead of editing the top-level system prompt. The cached history stays valid.response.content back each turn, not just the text, or the compaction state is lost.VI
Ask for a shape, and the answer arrives in it.
Structured outputs make the reply match a schema you give. In Python, describe the shape as a Pydantic model and the SDK returns a validated object. Without the SDK, put the schema in output_config.format; the older output_format parameter on create() is deprecated.
from pydantic import BaseModel class ContactInfo(BaseModel): name: str email: str plan: str interests: list[str] demo_requested: bool response = client.messages.parse( model="claude-opus-5-5", max_tokens=16000, messages=[{"role": "user", "content": "Extract: Jane Doe (jane@co.com) wants Enterprise, " "interested in API and SDKs, wants a demo."}], output_format=ContactInfo, ) contact = response.parsed_output # a validated ContactInfo print(contact.name, contact.interests)
Prefill is gone. Ending the conversation with a half-written assistant reply to force a format now returns an error on current models. Use structured outputs or say what you want in the system prompt.
VII
When one request becomes ten thousand.
| Need | Reach for | Why |
|---|---|---|
| Lots of work, no hurry | Message Batches | Runs asynchronously at half the price. Results come back in any order, so match them by custom_id. |
| Same file, many requests | Files API | Upload once and refer to it by file_id. Out of beta, no header needed. |
| Answers sooner | Fast mode | speed: "fast" on Opus 5.5 gives up to 2.5× faster output at double the price. |
| An agent that knows its budget | Task budgets (beta) | Claude sees a token countdown and finishes cleanly instead of being cut off. |
| Long replies | Streaming | Required for very large max_tokens. Use the SDK's final-message helper if you don't need each event. |
| What does it cost? | Token counting | POST /v1/messages/count_tokens gives exact counts before you send. |
Opus 5.5 can also run on Amazon Bedrock, Google Cloud and Microsoft Foundry through each platform's own SDK client. Features and prices vary by platform, so check before you rely on one.
VIII
Not one answer, but a sequence of choices.
An agent is Claude in a loop, choosing its own next tool call. Build one only when the job is truly open-ended, the result is worth the extra cost, and mistakes can be caught. A single call or a fixed workflow covers most things. When you do build one, the real question is who runs the loop and who hosts it.
| Approach | You write | Runs on | Choose it when |
|---|---|---|---|
| Manual loop | The whole while stop_reason == "tool_use" loop | Your servers | You want to control every step |
| Tool runner | Just the tool functions | Your servers | You host it but don't want to write the loop |
| Managed Agents (beta) | An agent config, plus your own tools | Anthropic: the loop and a sandbox for each session | Long-running, scheduled or multi-agent work, with nothing to host |
| Claude Agent SDK | A prompt and options | Your servers, with Claude Code's built-in tools | You want a ready-made coding and file agent of your own |
The Model Context Protocol is an open standard for connecting a model to tools and data: a database, a ticket tracker, your own API. Write an MCP server once and Claude Code, the Claude apps, the Agent SDK and the API's MCP connector can all use it.
The tool runner and the Agent SDK sound alike but are different packages. The tool runner lives in the regular anthropic SDK and only loops over tools you define. The Agent SDK is Claude Code packaged as a library. Its documentation is at code.claude.com.
IX
The model, given a terminal and the patience of a colleague.
Claude Code is Anthropic's agent for software work. It reads your repository, runs commands, edits files and opens pull requests, and asks first before anything you haven't allowed. It runs in the terminal, the desktop app on Mac and Windows, the web at claude.ai/code (where sessions run in a cloud container), and VS Code and JetBrains.
| Part | What it is |
|---|---|
CLAUDE.md | The project's memory. A file in the repository that every session reads first: how to build, what never to touch, where the traps are. |
| Skills | Packaged instructions for a recurring job, such as a review checklist or a deploy runbook, loaded when the task calls for them. |
| Subagents | Helpers with their own context for searches and side tasks, so the main conversation stays focused. |
| Hooks | Your own scripts, run by the harness before or after a tool call: format on save, block a dangerous command. |
| MCP servers | Your tools and data, connected through the standard from Chapter VIII. |
| Plugins | Skills, hooks, commands and servers bundled together and shared with a team. |
Write CLAUDE.md as you would brief a sharp new colleague. Record what is true and what has gone wrong before. Skip the pep talk.
X
Everyone falls into these once. Fall into them here instead.
budget_tokens, assistant prefill, temperature (removed from the newest models), and forcing a tool with tool_choice. Each of these returns an error on the newest models.max_tokens too low cuts the reply off partway. Use about 16,000 without streaming and about 64,000 with it.stop_reason: "refusal". Check for it before you read the content. The newest models can retry on another model automatically (the beta fallbacks parameter).