Parameter reference
Written by a person. Last read by a person on 2026-09-04, 4 days ago. Its facts were checked by the eval suite on 2026-09-07.
You know what you are doing and need a parameter name, a header, a stop reason or a limit, without reading the explanation around it.
Reference only. This page states what things are; the other pages explain when to reach for them. Scoped to the streaming workflow rather than the whole API.
Request parameters
| Parameter | Notes |
|---|---|
model |
Model ID. This site's examples use claude-opus-5. A typo produces 404, not 400 |
max_tokens |
A ceiling on output, not a target. Does not factor into output-token rate limits, so there is no rate-limit reason to keep it small |
messages |
The full conversation. The API is stateless; you resend history every request |
system |
Instructions outside the conversation. Kept stable, it is also the natural cache prefix |
stream |
Set by .stream(). Passing stream=True to .create() gives the raw event iterator with no accumulation |
Client configuration
| Option | Default | Notes |
|---|---|---|
max_retries |
2 | Retries connection errors, 429 and 5xx with exponential backoff, honoring retry-after |
timeout |
10 minutes | Timeouts are themselves retried, so worst-case wall clock is timeout multiplied by attempts plus one |
base_url |
Anthropic API | Also settable by environment variable |
Response headers
Prefixed anthropic-ratelimit-, in families for requests, tokens, input
tokens and output tokens. Each family has three members.
| Suffix | Reports |
|---|---|
-limit |
The maximum in any rate limit period |
-remaining |
What is left. Token counts are rounded to the nearest thousand |
-reset |
When the limit is fully replenished, as an RFC 3339 timestamp |
Plus retry-after on a throttled response, in seconds — absent on the
spend-cap 429 — and request-id on every response.
Streaming events
| Event | Meaning |
|---|---|
message_start |
The message exists; usage figures begin here |
content_block_start |
A block begins. Its type says what kind |
content_block_delta |
A piece of that block. The delta.type says which channel |
content_block_stop |
That block is complete |
message_delta |
Top-level updates, including stop_reason |
message_stop |
The message is complete |
An error can arrive after a 200 as a mid-stream event. It does not follow the standard error mechanism, which is why handling belongs inside the loop as well as around it.
Stop reasons
| Value | Meaning |
|---|---|
end_turn |
Finished naturally |
max_tokens |
Hit your ceiling. The response is truncated |
stop_sequence |
Hit a stop sequence you supplied |
tool_use |
Wants a tool result to continue |
refusal |
Declined on safety grounds. Check stop_details before reading content |
Errors
| Status | Type | Retryable |
|---|---|---|
| 400 | invalid_request_error |
No |
| 401 | authentication_error |
No |
| 402 | billing_error |
No |
| 403 | permission_error |
No |
| 404 | not_found_error |
No |
| 409 | conflict_error |
After resolving the conflict |
| 413 | request_too_large |
No |
| 429 | rate_limit_error |
Usually — not when it is the spend cap |
| 500 | api_error |
Yes |
| 504 | timeout_error |
Yes |
| 529 | overloaded_error |
Yes |
Limits
| Limit | Value |
|---|---|
| Maximum request size, Messages API | 32 MB |
| Rate limits | Per organization, per model, separately for requests, input tokens and output tokens |
| Cached input tokens | Do not count toward the input-token limit on most models |
Where these facts come from
Every value on this page is read from data/volatile.yaml, which records a source URL and a
verification date for each entry. The primary sources are
errors,
rate limits and
streaming.
Nothing here was written from memory. That is checkable rather than asserted: the eval suite fails the build if any of these values appears in prose as a literal instead of a reference.