Messages
Create a Message
Count tokens in a Message
Models
BrowserStateChange = BrowserStateChangeTabOpened { tab_id, type } or BrowserStateChangeDownloadStarted { download_id, type, url } or BrowserStateChangeDownloadCompleted { download_id, type, url, 2 more } or BrowserStateChangeDownloadFailed { download_id, type, url, error }A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
Carries only the tab_id; the tab's title and url live on its
tabs entry, which must include the same tab_id. A tab opened
during a failed call gets no deferred tab_opened; it simply appears
in the next result's tabs inventory.
A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
tab_id is the caller-assigned identifier for the tab; title and
url describe the page the tab is currently showing and may be empty
strings (a blank tab legitimately has both empty). active marks the
tab that is active after this call; whenever tabs is non-empty,
exactly one entry is marked.
Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
Counted separately from document_index; server-side web search results are not included in this count.
Always equals the contents of content[start_block_index:end_block_index] joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.
Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.
Counted separately from document_index; server-side web search results are not included in this count.
CodeExecutionToolResultBlockContent = CodeExecutionToolResultError { error_code, type } or CodeExecutionResultBlock { content, return_code, stderr, 2 more } or EncryptedCodeExecutionResultBlock { content, encrypted_stdout, return_code, 2 more }Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
CodeExecutionToolResultBlockParamContent = CodeExecutionToolResultErrorParam { error_code, type } or CodeExecutionResultBlockParam { content, return_code, stderr, 2 more } or EncryptedCodeExecutionResultBlockParam { content, encrypted_stdout, return_code, 2 more }Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
ContentBlock = TextBlock { citations, text, type } or ThinkingBlock { signature, thinking, type } or RedactedThinkingBlock { data, type } or 9 moreResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
ContentBlockParam = TextBlockParam { text, type, cache_control, citations } or ImageBlockParam { source, type, cache_control, transformations } or DocumentBlockParam { source, type, cache_control, 3 more } or 13 moreRegular text content.
Regular text content.
ContentBlockSourceContent = TextBlockParam { text, type, cache_control, citations } or ImageBlockParam { source, type, cache_control, transformations }
Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
What the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
What the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
MessageCountTokensTool = Tool { input_schema, name, allowed_callers, 7 more } or ToolBash20250124 { name, type, allowed_callers, 4 more } or CodeExecutionTool20250522 { name, type, allowed_callers, 3 more } or 18 moreCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
See models for additional details and options.
A schema to specify Claude's output format in responses. See structured outputs
A schema to specify Claude's output format in responses. See structured outputs
Reflects the raw reasoning the model produced, not the (possibly shorter)
summarized thinking text returned in the response body. Computed by
re-tokenizing the raw reasoning text, so it may differ from the model's exact
generation count by a small number of tokens. Always ≤ output_tokens;
output_tokens - thinking_tokens approximates the non-reasoning output.
RawContentBlockDelta = TextDelta { text, type } or InputJSONDelta { partial_json, type } or CitationsDelta { citation, type } or 2 more
RawMessageStreamEvent = RawMessageStartEvent { message, type } or RawMessageDeltaEvent { delta, type, usage } or RawMessageStopEvent { type } or 3 more
Pass redacted_thinking blocks back to the API unchanged when continuing a multi-turn conversation.
See extended thinking for details.
The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.
The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.
The request could assist the development of competing AI models, which is restricted under Anthropic's commercial terms. Benign machine learning work can also trigger this category.
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.
TextCitation = CitationCharLocation { cited_text, document_index, document_title, 4 more } or CitationPageLocation { cited_text, document_index, document_title, 4 more } or CitationContentBlockLocation { cited_text, document_index, document_title, 4 more } or 2 more
TextCitationParam = CitationCharLocationParam { cited_text, document_index, document_title, 3 more } or CitationPageLocationParam { cited_text, document_index, document_title, 3 more } or CitationContentBlockLocationParam { cited_text, document_index, document_title, 3 more } or 2 more
This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.
See extended thinking for details.
Must be ≥1024 and less than max_tokens.
See extended thinking for details.
ThinkingConfigParam = ThinkingConfigEnabled { budget_tokens, type, display } or ThinkingConfigDisabled { type } or ThinkingConfigAdaptive { type, display }Configuration for enabling Claude's extended thinking.
Configuration for enabling Claude's extended thinking.
When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your max_tokens limit.
See extended thinking for details.
ToolChoice = ToolChoiceAuto { type, disable_parallel_tool_use } or ToolChoiceAny { type, disable_parallel_tool_use } or ToolChoiceTool { name, type, disable_parallel_tool_use } or ToolChoiceNone { type }How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
Create a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
ToolUnion = Tool { input_schema, name, allowed_callers, 7 more } or ToolBash20250124 { name, type, allowed_callers, 4 more } or CodeExecutionTool20250522 { name, type, allowed_callers, 3 more } or 18 moreCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
The two letter ISO country code of the user.
The two letter ISO country code of the user.
The IANA timezone of the user.
The IANA timezone of the user.