One change
Batches
api/beta/messages/batches
Nearest release: v2.1.247, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/beta/messages/batches Changed · +112 / -16 lines
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
from line 18
- `string` - - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 31 more` + - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 38 more` - `"message-batches-2024-09-24"`
from line 88
- `"mid-conversation-tool-changes-2026-07-01"` + - `"compact-2026-01-12"` + + - `"computer-use-2025-11-24"` + + - `"mcp-tunnels-2026-06-22"` + + - `"structured-outputs-2025-11-13"` + + - `"task-budgets-2026-03-13"` + + - `"thinking-display-updates-2026-08-18"` + + - `"ce-user-management-2026-07-13"` + - `"anthropic-user-profile-id": optional string` The user profile ID to attribute the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.
from line 1802
- `type: "enabled"` - - `display: optional "summarized" or "omitted" or null` + - `display: optional "summarized" or "omitted" or "updates" or null` Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1810
- `"omitted"` + - `"updates"` + - `BetaThinkingConfigDisabled object` - `type: "disabled"`
from line 1820
- `type: "adaptive"` - - `display: optional "summarized" or "omitted" or null` + - `display: optional "summarized" or "omitted" or "updates" or null` Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
from line 1828
- `"omitted"` + - `"updates"` + - `Default = "default"` - `inference_geo: optional string or null`
from line 4105
- `string` - - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 31 more` + - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 38 more` - `"message-batches-2024-09-24"`
from line 4175
- `"mid-conversation-tool-changes-2026-07-01"` + - `"compact-2026-01-12"` + + - `"computer-use-2025-11-24"` + + - `"mcp-tunnels-2026-06-22"` + + - `"structured-outputs-2025-11-13"` + + - `"task-budgets-2026-03-13"` + + - `"thinking-display-updates-2026-08-18"` + + - `"ce-user-management-2026-07-13"` + ### Returns - `BetaMessageBatch object`
from line 4365
- `string` - - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 31 more` + - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 38 more` - `"message-batches-2024-09-24"`
from line 4435
- `"mid-conversation-tool-changes-2026-07-01"` + - `"compact-2026-01-12"` + + - `"computer-use-2025-11-24"` + + - `"mcp-tunnels-2026-06-22"` + + - `"structured-outputs-2025-11-13"` + + - `"task-budgets-2026-03-13"` + + - `"thinking-display-updates-2026-08-18"` + + - `"ce-user-management-2026-07-13"` + ### Returns - `data: array of BetaMessageBatch`
from line 4634
- `string` - - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 31 more` + - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 38 more` - `"message-batches-2024-09-24"`
from line 4704
- `"mid-conversation-tool-changes-2026-07-01"` + - `"compact-2026-01-12"` + + - `"computer-use-2025-11-24"` + + - `"mcp-tunnels-2026-06-22"` + + - `"structured-outputs-2025-11-13"` + + - `"task-budgets-2026-03-13"` + + - `"thinking-display-updates-2026-08-18"` + + - `"ce-user-management-2026-07-13"` + ### Returns - `BetaMessageBatch object`
from line 4885
- `string` - - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 31 more` + - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 38 more` - `"message-batches-2024-09-24"`
from line 4955
- `"mid-conversation-tool-changes-2026-07-01"` + - `"compact-2026-01-12"` + + - `"computer-use-2025-11-24"` + + - `"mcp-tunnels-2026-06-22"` + + - `"structured-outputs-2025-11-13"` + + - `"task-budgets-2026-03-13"` + + - `"thinking-display-updates-2026-08-18"` + + - `"ce-user-management-2026-07-13"` + ### Returns - `BetaDeletedMessageBatch object`
from line 5028
- `string` - - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 31 more` + - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 38 more` - `"message-batches-2024-09-24"`
from line 5098
- `"mid-conversation-tool-changes-2026-07-01"` + - `"compact-2026-01-12"` + + - `"computer-use-2025-11-24"` + + - `"mcp-tunnels-2026-06-22"` + + - `"structured-outputs-2025-11-13"` + + - `"task-budgets-2026-03-13"` + + - `"thinking-display-updates-2026-08-18"` + + - `"ce-user-management-2026-07-13"` + ### Returns - `BetaMessageBatchIndividualResponse object`
from line 6547
Per-iteration token usage breakdown. - Each entry represents one sampling iteration, with its own input/output token counts and cache statistics. This allows you to: + Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by `type`. For `message` entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to: - Determine which iterations exceeded long context thresholds (>=200k tokens) - - Calculate the true context window size from the last iteration + - Calculate the context window size from the last `message` entry - Understand token accumulation across server-side tool use loops + A `compaction` entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a `compaction` entry, even when it is the last entry. A `compaction` entry's tokens are not included in the top-level `usage` fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each `compaction` entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results. + - `BetaMessageIterationUsage object` Token usage for a sampling iteration.
from line 8375
The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking). - - `"general_harms"` - - The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category. - - - `explanation: string or null` - - Human-readable explanation of the refusal. - - This text is not guaranteed to be stable. `null` when no explanation is available for the category. - - - `fallback_credit_token: string or null` - - Opaque code that refunds the cache-miss cost when retrying this refused - request on the fallback model. Pass it as `fallback_credit_token` on the - retry request. Expires 5 minutes after the refusal. - - The retry is sent either with the same request body (`system`, `messages`, - `tools`, and other render-shaping fields), or with the same body plus one - appended `assistant` message whose content is the partial text (with any - trailing whitespace stripped from the final text block) and paired - server-tool blocks from this refusal — which also authorizes that - appended turn as an assistant-prefill continuation on models that otherwise - disallow prefill. A token minted mid-server-tool-loop whose partial content - was continuable may only be redeemed the second way — if a same-body retry - is rejected with a 400 saying the token must be redeemed by continuing the - partial response, retry the second way instead. Either way: same workspace, - same platform; a mismatch is a 400. Resending a token for an already-warm - prefix is permitted but yields no additional credit. - - `null` when the refused model isn't eligible for a fallback credit. - - - `fallback_has_prefill_claim: boolean or null` - - Whether the accompanying `fallback_credit_token` may be redeemed with the - appended-assistant retry form. Only set when `fallback_credit_token` is - present. - - `true`: retry by resending the same request body plus one appended - `assistant` message whose content is this response's `content` with any - trailing whitespace stripped from the final text block and unpaired - `tool_use` blocks omitted (the same appended-turn shape described on - `fallback_credit_token`), with the token attached. `false`: retry by - resending the original request body unchanged, with the token attached — - the appended-assistant form is not available for this refusal (no - continuable partial content, or the reques + -