Skip to content

Claude model behaviour

Anthropic's API as it behaves in practice — streaming event types, prefilling, token counting, tool use and the limits that shape how a Claude integration is written.

The Anthropic Messages API is small. One endpoint, a handful of top-level parameters, and a response whose content is a list of typed blocks. Almost everything that surprises people building on it comes not from the surface but from the shapes that move through it: which block types can appear together, what the same field means in a streamed response versus a buffered one, and which parameter is a hint the model can ignore rather than a limit the server enforces.

These pages are about those shapes. Each one takes a single field, parameter or block type and follows it end to end — the request that produces it, the response that carries it, and the error you get when it is wrong. Where a figure is a documented limit it is named and attributed, and where it is expected to change with the next model release it is marked as such rather than presented as a constant.

Claude's Context Window: 200K, 1M, and What Fills It Fastest

The documented input limits per Claude model family, what counts against them, and a worked example of how quickly tool definitions and history consume the budget.

9 min read

Claude's Max Output Tokens per Model

The documented per-model output ceiling, why max_tokens is required, and why the large ceilings are only reachable on a streamed request.

8 min read

The system Parameter in the Claude API: A Field, Not a Message

Where the system prompt goes in a Messages API request, what error you get if you put it in the messages array, and what the array form of the field buys you.

8 min read

stop_sequences in the Claude API: What Comes Back When One Fires

How the stop_sequences array changes generation, which two response fields tell you a sequence fired, and why the matched text is not in the output.

7 min read

Claude's tool_use and tool_result Content Blocks, End to End

A full request, tool_use response, tool_result reply and final answer, with each field of both block types explained in place.

9 min read

Forcing a Specific Tool Call in the Claude API

The four tool_choice variants, what each one changes about the response you get back, and the constraints that come with forcing a call.

8 min read

Claude's Streaming Event Types, From message_start to message_stop

Every server-sent event type in a streamed Messages API response, in the order they arrive, and which fields each one carries.

9 min read

Prompt Caching in the Claude API: cache_control Breakpoints and the TTL

Where the cache_control marker goes, the prefix rule that decides whether you get a hit, the two TTLs, and the usage fields that prove it worked.

9 min read

Extended Thinking in Claude: budget_tokens and What Replaced It

What the budget_tokens parameter does, how it trades off against the visible answer inside max_tokens, and which models now reject it.

9 min read

Claude's Computer Use Tool: How Screenshots and Actions Round-Trip

The specific tool_use loop behind computer use — what the model emits, what you execute, and how a screenshot goes back in a tool_result.

9 min read

Claude's Citations Feature: How Source Spans Come Back in the Response

How to enable citations on a document block and what the citation objects attached to the response text actually contain.

8 min read

What a Declined Response Looks Like in the Claude API

The stop_reason and stop_details a declined request returns, why it arrives as an HTTP 200, and how its shape differs from a normal completion.

8 min read

Claude Vision: Image Size and Token Cost per Image

Anthropic's documented pixels-to-tokens formula, applied to three real image sizes, with the resize ceiling that caps what any single image can cost.

8 min read

PDF Input in the Claude API: How Pages Become Tokens

Why a PDF page costs what it costs in the Claude API, derived from the two things Anthropic does to each page, with a twenty-page document priced end to end.

8 min read

Claude's Dated Model Snapshots and Why the -latest Alias Moves

How Anthropic's model id naming works, what changes under you when you call an alias, and the one field in the response that tells you which weights actually answered.

8 min read

Claude's Model Deprecation Policy and Retirement Notice Window

The lifecycle states an Anthropic model passes through, the minimum notice the published policy commits to, and what a request to a retired model actually returns.

7 min read

Why Claude's Token Counts Differ From GPT's on the Same Text

The three separate reasons two providers report different token counts for identical text, and why the difference makes a per-million price comparison unreliable.

9 min read

The count_tokens Endpoint in the Claude API

How to price and size a Claude request before you send it, using the token-counting endpoint with the exact body you intend to submit.

8 min read

Claude's Temperature Parameter Range and Default

The documented 0.0 to 1.0 range and its default, why the ceiling is where it is, and what happens to a temperature value copied from an OpenAI configuration.

7 min read

Forcing JSON Output From Claude Without a Dedicated JSON Mode

Claude has no response_format parameter; the supported route to structured output is a single forced tool call, and this is the full mechanism with a working example.

9 min read

Why max_tokens Is Required in the Claude API

The 400 you get when max_tokens is missing, why Anthropic has no default for it, and why setting it to the model maximum is the wrong fix.

7 min read

What Happens Past Claude's 200K Context Window

The prompt-is-too-long error, the token count Anthropic hands you inside it, and why a prompt that fits can still be rejected.

8 min read

Why the Claude API Rejects a Second System Message

The validation error from putting a system-role message in the messages array, why Anthropic made system a top-level field, and how to port code that sends several.

8 min read

Interleaved Thinking and Tool Use in Claude

How the interleaved-thinking beta lets Claude reason between tool calls, and what that does to the order of blocks you have to send back.

9 min read

Claude Haiku’s Context Window and Output Cap

The documented context and output limits across the Haiku line, and the error you get when max_tokens exceeds the model's cap.

7 min read

Claude’s stop_reason Field: Every Value and What Triggers It

Each documented stop_reason value, the condition that produces it, and what your code should do differently for each one.

9 min read

Prefilling Claude’s Assistant Turn: How It Changes the Response

How a trailing assistant message constrains Claude's first tokens, what comes back in the response, and the restrictions on using it.

8 min read

Beta Headers in the Claude API: How Features Ship Before General Availability

How the anthropic-beta header opts a single request into pre-GA behaviour, and the specific failures you get when it is missing.

8 min read

Claude’s Message Batches API: Async Processing and the 24-Hour Window

How to submit, poll and read a Claude batch, with the documented completion window, discount and per-batch limits.

9 min read

Claude and Multiple Images in One Request: Ordering Rules

The documented per-request image limits, and how position in the content array is what lets your text refer to a specific image.

8 min read

Claude’s Knowledge Cutoff by Model

The documented training cutoff for each Claude generation, and why Anthropic publishes a second, earlier 'reliable knowledge' date.

8 min read

Token-Efficient Tool Use in the Claude API

The beta header that trims the token overhead of tool calls, what Anthropic reports it saves, and how to measure the difference on your own tools.

8 min read

Why Claude Sometimes Returns Text and a Tool Call in the Same Turn

Why an assistant turn can contain a text block and a tool_use block at once, what order they arrive in, and what you must send back.

8 min read

disable_parallel_tool_use in the Claude API

The tool_choice flag that limits Claude to one tool call per turn, how it interacts with auto, any and tool, and when forcing sequence is worth the round trips.

8 min read

Other topics