Claude Platform Docs

Messages

Create a Message
$ ant messages create
POST/v1/messages
Count tokens in a Message
$ ant messages count-tokens
POST/v1/messages/count_tokens
Models
base64_image_source: object{ data, media_type, type }
data: string
formatbyte
media_type: "image/jpeg" or "image/png" or "image/gif" or "image/webp"
One of the following:
"image/jpeg"
"image/png"
"image/gif"
"image/webp"
type: "base64"
base64_pdf_source: object{ data, media_type, type }
data: string
formatbyte
media_type: "application/pdf"
type: "base64"
bash_code_execution_output_block: object{ file_id, type }
file_id: string
type: "bash_code_execution_output"
bash_code_execution_output_block_param: object{ file_id, type }
file_id: string
type: "bash_code_execution_output"
bash_code_execution_result_block: object{ content, return_code, stderr, 2 more }
content: array of BashCodeExecutionOutputBlock { file_id, type }
file_id: string
type: "bash_code_execution_output"
return_code: number
stderr: string
stdout: string
type: "bash_code_execution_result"
bash_code_execution_result_block_param: object{ content, return_code, stderr, 2 more }
content: array of BashCodeExecutionOutputBlockParam { file_id, type }
file_id: string
type: "bash_code_execution_output"
return_code: number
stderr: string
stdout: string
type: "bash_code_execution_result"
bash_code_execution_tool_result_block: object{ content, tool_use_id, type }
bash_code_execution_tool_result_block_param: object{ content, tool_use_id, type, cache_control }
bash_code_execution_tool_result_error: object{ error_code, type }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
type: "bash_code_execution_tool_result_error"
bash_code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
bash_code_execution_tool_result_error_param: object{ error_code, type }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
type: "bash_code_execution_tool_result_error"
browser_close_tab_config: object{ defer_loading, enabled }

close_tab's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_double_click_config: object{ defer_loading, enabled }

double_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_file_upload_config: object{ defer_loading, enabled }

file_upload's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_find_config: object{ defer_loading, enabled }

find's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_form_input_config: object{ defer_loading, enabled }

form_input's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_get_page_text_config: object{ defer_loading, enabled }

get_page_text's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_hold_key_config: object{ defer_loading, enabled }

hold_key's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_hover_config: object{ defer_loading, enabled }

hover's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_javascript_exec_config: object{ defer_loading, enabled }

javascript_exec's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_key_config: object{ defer_loading, enabled }

key's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_left_click_config: object{ defer_loading, enabled }

left_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_left_click_drag_config: object{ defer_loading, enabled }

left_click_drag's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_left_mouse_down_config: object{ defer_loading, enabled }

left_mouse_down's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_left_mouse_up_config: object{ defer_loading, enabled }

left_mouse_up's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_list_tabs_config: object{ defer_loading, enabled }

list_tabs's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_middle_click_config: object{ defer_loading, enabled }

middle_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_mouse_move_config: object{ defer_loading, enabled }

mouse_move's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_navigate_config: object{ defer_loading, enabled }

navigate's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_new_tab_config: object{ defer_loading, enabled }

new_tab's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_read_console_config: object{ defer_loading, enabled }

read_console's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_read_network_config: object{ defer_loading, enabled }

read_network's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_read_page_config: object{ defer_loading, enabled }

read_page's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_right_click_config: object{ defer_loading, enabled }

right_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_screenshot_config: object{ defer_loading, enabled }

screenshot's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_scroll_config: object{ defer_loading, enabled }

scroll's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_scroll_to_config: object{ defer_loading, enabled }

scroll_to's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_state_block_param: object{ tabs, type, cache_control, state_changes }

The caller's browser state after a browser toolset member call — the full inventory of open tabs, which tab is active, and any side effects (tabs opened, download state changes) the call produced.

At most one per tool_result, only on a non-error result answering a browser toolset member tool_use. The server renders the model-visible text from it; the model never sees the raw fields.

browser_state_change: 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.

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.

browser_state_change_download_completed: object{ download_id, type, url, 2 more }

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).

download_id: string

The caller-assigned identifier for this download, stable across the state changes reporting it.

maxLength4096
minLength1
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type: "download_completed"
url: string

The final post-redirect URL the download was served from.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
path: optional string

Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.

pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
maxLength4096
size_bytes: optional number

The completed download's size.

minimum0
browser_state_change_download_failed: object{ download_id, type, url, error }

A file download that failed — or was cancelled — during this call.

download_id: string

The caller-assigned identifier for this download, stable across the state changes reporting it.

maxLength4096
minLength1
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type: "download_failed"
url: string

The final post-redirect URL the download was served from.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
error: optional string

The failure or cancellation detail, when known.

pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
maxLength4096
browser_state_change_download_started: object{ download_id, type, url }

A file download that started during this call.

download_id: string

The caller-assigned identifier for this download, stable across the state changes reporting it.

maxLength4096
minLength1
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type: "download_started"
url: string

The final post-redirect URL the download was served from.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
browser_state_change_tab_opened: object{ tab_id, type }

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.

tab_id: string

The tab_id of the opened tab, present in tabs.

maxLength4096
minLength1
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type: "tab_opened"
browser_state_tab_entry: object{ tab_id, title, url, active }

One open browser tab reported in a browser_state block's tabs inventory.

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.

tab_id: string

The caller-assigned identifier for this tab, unique within the inventory.

maxLength4096
minLength1
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
title: string

The title of the page the tab is showing. May be empty.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
url: string

The URL of the page the tab is showing. May be empty.

maxLength4096
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
active: optional boolean

Whether this tab is the active tab after this call. Whenever tabs is non-empty, exactly one entry is marked active: true.

browser_switch_tab_config: object{ defer_loading, enabled }

switch_tab's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_toolset_20260801: object{ type, allowed_callers, cache_control, configs }

The browser toolset: a single tools[] entry (carrying no name) that declares the browser tool family. The model is served the family's tool with any members disabled via configs removed from its schema.

browser_toolset_configs: object{ close_tab, double_click, file_upload, 28 more }

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.

browser_triple_click_config: object{ defer_loading, enabled }

triple_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_type_config: object{ defer_loading, enabled }

type's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_wait_config: object{ defer_loading, enabled }

wait's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

browser_zoom_config: object{ defer_loading, enabled }

zoom's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

cache_control_ephemeral: object{ type, ttl }
type: "ephemeral"
ttl: optional "5m" or "1h"

The time-to-live for the cache control breakpoint.

This may be one the following values:

  • 5m: 5 minutes
  • 1h: 1 hour

Defaults to 5m. See prompt caching pricing for details.

One of the following:
"5m"
"1h"
cache_creation: object{ ephemeral_1h_input_tokens, ephemeral_5m_input_tokens }
ephemeral_1h_input_tokens: number

The number of input tokens used to create the 1 hour cache entry.

minimum0
ephemeral_5m_input_tokens: number

The number of input tokens used to create the 5 minute cache entry.

minimum0
citation_char_location: object{ cited_text, document_index, document_title, 4 more }
cited_text: string
document_index: number
minimum0
document_title: string
end_char_index: number
file_id: string
start_char_index: number
minimum0
type: "char_location"
citation_char_location_param: object{ cited_text, document_index, document_title, 3 more }
cited_text: string
document_index: number
minimum0
document_title: string
maxLength500
minLength1
end_char_index: number
start_char_index: number
minimum0
type: "char_location"
citation_content_block_location: object{ cited_text, document_index, document_title, 4 more }
cited_text: string

The full text of the cited block range, concatenated.

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.

document_index: number
minimum0
document_title: string
end_block_index: number

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

file_id: string
start_block_index: number

0-based index of the first cited block in the source's content array.

minimum0
type: "content_block_location"
citation_content_block_location_param: object{ cited_text, document_index, document_title, 3 more }
cited_text: string

The full text of the cited block range, concatenated.

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.

document_index: number
minimum0
document_title: string
maxLength500
minLength1
end_block_index: number

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

start_block_index: number

0-based index of the first cited block in the source's content array.

minimum0
type: "content_block_location"
citation_page_location: object{ cited_text, document_index, document_title, 4 more }
cited_text: string
document_index: number
minimum0
document_title: string
end_page_number: number
file_id: string
start_page_number: number
minimum1
type: "page_location"
citation_page_location_param: object{ cited_text, document_index, document_title, 3 more }
cited_text: string
document_index: number
minimum0
document_title: string
maxLength500
minLength1
end_page_number: number
start_page_number: number
minimum1
type: "page_location"
citation_search_result_location_param: object{ cited_text, end_block_index, search_result_index, 4 more }
cited_text: string

The full text of the cited block range, concatenated.

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.

end_block_index: number

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

search_result_index: number

0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.

Counted separately from document_index; server-side web search results are not included in this count.

minimum0
source: string
start_block_index: number

0-based index of the first cited block in the source's content array.

minimum0
title: string
type: "search_result_location"
citation_web_search_result_location_param: object{ cited_text, encrypted_index, title, 2 more }
cited_text: string
encrypted_index: string
title: string
maxLength512
minLength1
type: "web_search_result_location"
url: string
minLength1
citations_config: object{ enabled }
enabled: boolean
citations_config_param: object{ enabled }
enabled: optional boolean
citations_delta: object{ citation, type }
citations_search_result_location: object{ cited_text, end_block_index, search_result_index, 4 more }
cited_text: string

The full text of the cited block range, concatenated.

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.

end_block_index: number

Exclusive 0-based end index of the cited block range in the source's content array.

Always greater than start_block_index; a single-block citation has end_block_index = start_block_index + 1.

search_result_index: number

0-based index of the cited search result among all search_result content blocks in the request, in the order they appear across messages and tool results.

Counted separately from document_index; server-side web search results are not included in this count.

minimum0
source: string
start_block_index: number

0-based index of the first cited block in the source's content array.

minimum0
title: string
type: "search_result_location"
citations_web_search_result_location: object{ cited_text, encrypted_index, title, 2 more }
cited_text: string
encrypted_index: string
title: string
maxLength512
type: "web_search_result_location"
url: string
code_execution_output_block: object{ file_id, type }
file_id: string
type: "code_execution_output"
code_execution_output_block_param: object{ file_id, type }
file_id: string
type: "code_execution_output"
code_execution_result_block: object{ content, return_code, stderr, 2 more }
content: array of CodeExecutionOutputBlock { file_id, type }
file_id: string
type: "code_execution_output"
return_code: number
stderr: string
stdout: string
type: "code_execution_result"
code_execution_result_block_param: object{ content, return_code, stderr, 2 more }
content: array of CodeExecutionOutputBlockParam { file_id, type }
file_id: string
type: "code_execution_output"
return_code: number
stderr: string
stdout: string
type: "code_execution_result"
code_execution_tool_20250522: object{ name, type, allowed_callers, 3 more }
code_execution_tool_20250825: object{ name, type, allowed_callers, 3 more }
code_execution_tool_20260120: object{ name, type, allowed_callers, 3 more }

Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

code_execution_tool_20260521: object{ name, type, allowed_callers, 3 more }

Code execution tool with REPL state persistence.

code_execution_tool_result_block: object{ content, tool_use_id, type }
code_execution_tool_result_block_content: 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_tool_result_block_param: object{ content, tool_use_id, type, cache_control }
code_execution_tool_result_block_param_content: 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_tool_result_error: object{ error_code, type }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
type: "code_execution_tool_result_error"
code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
code_execution_tool_result_error_param: object{ error_code, type }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
type: "code_execution_tool_result_error"
computer_cursor_position_config: object{ defer_loading, enabled }

cursor_position's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_double_click_config: object{ defer_loading, enabled }

double_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_hold_key_config: object{ defer_loading, enabled }

hold_key's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_key_config: object{ defer_loading, enabled }

key's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_left_click_config: object{ defer_loading, enabled }

left_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_left_click_drag_config: object{ defer_loading, enabled }

left_click_drag's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_left_mouse_down_config: object{ defer_loading, enabled }

left_mouse_down's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_left_mouse_up_config: object{ defer_loading, enabled }

left_mouse_up's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_middle_click_config: object{ defer_loading, enabled }

middle_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_mouse_move_config: object{ defer_loading, enabled }

mouse_move's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_right_click_config: object{ defer_loading, enabled }

right_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_screenshot_config: object{ defer_loading, enabled }

screenshot's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_scroll_config: object{ defer_loading, enabled }

scroll's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_toolset_20260801: object{ type, allowed_callers, cache_control, configs }

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.

computer_toolset_configs: object{ cursor_position, double_click, hold_key, 14 more }

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.

computer_triple_click_config: object{ defer_loading, enabled }

triple_click's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_type_config: object{ defer_loading, enabled }

type's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_wait_config: object{ defer_loading, enabled }

wait's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

computer_zoom_config: object{ defer_loading, enabled }

zoom's config overrides.

defer_loading: optional boolean

Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.

enabled: optional boolean

Whether this member is offered to the model. Default is per member, per the toolset's documentation. A member whose enabled resolves false is withheld from the served schema.

container: object{ id, expires_at, skills }

Information about the container used in the request (for the code execution tool)

id: string

Identifier for the container used in this request

expires_at: string

The time at which the container will expire.

formatdate-time
skills: array of ContainerSkill { skill_id, type, version }

Skills loaded in the container

skill_id: string

Skill ID

maxLength64
minLength1
type: "anthropic" or "custom"

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

One of the following:
"anthropic"
"custom"
version: string

The resolved version: a skill version ID for custom skills.

maxLength64
minLength1
container_params: object{ id, skills }

Container parameters with skills to be loaded.

id: optional string

Container id

skills: optional array of SkillParams { skill_id, type, version }

List of skills to load in the container

maxItems20
skill_id: string

Skill ID

maxLength64
minLength1
type: "anthropic" or "custom"

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

One of the following:
"anthropic"
"custom"
version: optional string

Skill version or 'latest' for most recent version

maxLength64
minLength1
container_skill: object{ skill_id, type, version }

A skill that was loaded in a container (response model).

skill_id: string

Skill ID

maxLength64
minLength1
type: "anthropic" or "custom"

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

One of the following:
"anthropic"
"custom"
version: string

The resolved version: a skill version ID for custom skills.

maxLength64
minLength1
container_upload_block: object{ file_id, type }

Response model for a file uploaded to the container.

file_id: string
type: "container_upload"
container_upload_block_param: object{ file_id, type, cache_control }

A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.

file_id: string
type: "container_upload"
cache_control: optional object{ type, ttl }

Create a cache control breakpoint at this content block.

type: "ephemeral"
ttl: optional "5m" or "1h"

The time-to-live for the cache control breakpoint.

This may be one the following values:

  • 5m: 5 minutes
  • 1h: 1 hour

Defaults to 5m. See prompt caching pricing for details.

One of the following:
"5m"
"1h"
content_block: TextBlock { citations, text, type } or ThinkingBlock { signature, thinking, type } or RedactedThinkingBlock { data, type } or 9 more

Response model for a file uploaded to the container.

content_block_param: TextBlockParam { text, type, cache_control, citations } or ImageBlockParam { source, type, cache_control, transformations } or DocumentBlockParam { source, type, cache_control, 3 more } or 13 more

Regular text content.

content_block_source: object{ content, type }
content_block_source_content: TextBlockParam { text, type, cache_control, citations } or ImageBlockParam { source, type, cache_control, transformations }
direct_caller: object{ type }

Tool invocation directly from the model.

type: "direct"
document_block: object{ citations, source, title, type }
document_block_param: object{ source, type, cache_control, 3 more }
encrypted_code_execution_result_block: object{ content, encrypted_stdout, return_code, 2 more }

Code execution result with encrypted stdout for PFC + web_search results.

content: array of CodeExecutionOutputBlock { file_id, type }
file_id: string
type: "code_execution_output"
encrypted_stdout: string
return_code: number
stderr: string
type: "encrypted_code_execution_result"
encrypted_code_execution_result_block_param: object{ content, encrypted_stdout, return_code, 2 more }

Code execution result with encrypted stdout for PFC + web_search results.

content: array of CodeExecutionOutputBlockParam { file_id, type }
file_id: string
type: "code_execution_output"
encrypted_stdout: string
return_code: number
stderr: string
type: "encrypted_code_execution_result"
file_document_source: object{ file_id, type }
file_id: string
type: "file"
file_image_source: object{ file_id, type }
file_id: string
type: "file"
image_block_param: object{ source, type, cache_control, transformations }
image_transformations_param: object{ oversized_image }

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.

oversized_image: optional "downsize" or "error"

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.

One of the following:
"downsize"
"error"
input_json_delta: object{ partial_json, type }
partial_json: string
type: "input_json_delta"
json_output_format: object{ schema, type }
schema: map[unknown]

The JSON schema of the format

type: "json_schema"
memory_tool_20250818: object{ name, type, allowed_callers, 4 more }
message: object{ id, container, content, 7 more }
message_count_tokens_tool: 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 more

Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

message_create_params_container: ContainerParams { id, skills } or string

Container identifier for reuse across requests.

container_params: object{ id, skills }

Container parameters with skills to be loaded.

id: optional string

Container id

skills: optional array of SkillParams { skill_id, type, version }

List of skills to load in the container

maxItems20
skill_id: string

Skill ID

maxLength64
minLength1
type: "anthropic" or "custom"

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

One of the following:
"anthropic"
"custom"
version: optional string

Skill version or 'latest' for most recent version

maxLength64
minLength1
union_member_1: string
message_delta_usage: object{ cache_creation_input_tokens, cache_read_input_tokens, input_tokens, 3 more }
message_param: object{ content, role }
message_tokens_count: object{ input_tokens }
input_tokens: number

The total number of tokens across the provided list of messages, system prompt, and tools.

metadata: object{ user_id }
user_id: optional string

An external identifier for the user who is associated with the request.

This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.

maxLength512
output_config: object{ effort, format }
effort: optional "low" or "medium" or "high" or 2 more

All possible effort levels.

One of the following:
"low"
"medium"
"high"
"xhigh"
"max"
format: optional object{ schema, type }

A schema to specify Claude's output format in responses. See structured outputs

schema: map[unknown]

The JSON schema of the format

type: "json_schema"
output_tokens_details: object{ thinking_tokens }
thinking_tokens: number

Number of output tokens the model generated as internal reasoning, including the thinking-block delimiter tokens.

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.

minimum0
plain_text_source: object{ data, media_type, type }
data: string
media_type: "text/plain"
type: "text"
raw_content_block_delta: TextDelta { text, type } or InputJSONDelta { partial_json, type } or CitationsDelta { citation, type } or 2 more
raw_content_block_delta_event: object{ delta, index, type }
raw_content_block_start_event: object{ content_block, index, type }
raw_content_block_stop_event: object{ index, type }
index: number
type: "content_block_stop"
raw_message_delta_event: object{ delta, type, usage }
raw_message_start_event: object{ message, type }
raw_message_stop_event: object{ type }
type: "message_stop"
raw_message_stream_event: RawMessageStartEvent { message, type } or RawMessageDeltaEvent { delta, type, usage } or RawMessageStopEvent { type } or 3 more
redacted_thinking_block: object{ data, type }
data: string

The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.

Pass redacted_thinking blocks back to the API unchanged when continuing a multi-turn conversation.

See extended thinking for details.

type: "redacted_thinking"
redacted_thinking_block_param: object{ data, type }
data: string

The data value of this redacted thinking block, exactly as returned by the API in a previous response. Opaque and encrypted; pass it back unchanged.

type: "redacted_thinking"
refusal_stop_details: object{ category, explanation, type }

Structured information about a refusal.

category: "cyber" or "bio" or "frontier_llm" or 2 more

The policy category that triggered a refusal.

One of the following:
"cyber"

The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.

"bio"

The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.

"frontier_llm"

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.

"reasoning_extraction"

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.

"general_harms"

The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.

explanation: string

Human-readable explanation of the refusal.

This text is not guaranteed to be stable. null when no explanation is available for the category.

type: "refusal"
search_result_block_param: object{ content, source, title, 3 more }
server_tool_caller: object{ tool_id, type }

Tool invocation generated by a server-side tool.

tool_id: string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type: "code_execution_20250825"
server_tool_caller_20260120: object{ tool_id, type }
tool_id: string
pattern^srvtoolu_[a-zA-Z0-9_]+$
type: "code_execution_20260120"
server_tool_usage: object{ web_fetch_requests, web_search_requests }
web_fetch_requests: number

The number of web fetch tool requests.

minimum0
web_search_requests: number

The number of web search tool requests.

minimum0
server_tool_use_block: object{ id, caller, input, 2 more }
server_tool_use_block_param: object{ id, input, name, 3 more }
signature_delta: object{ signature, type }
signature: string

The signature for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a signature_delta event just before the block's content_block_stop event.

type: "signature_delta"
skill_params: object{ skill_id, type, version }

Specification for a skill to be loaded in a container (request model).

skill_id: string

Skill ID

maxLength64
minLength1
type: "anthropic" or "custom"

Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)

One of the following:
"anthropic"
"custom"
version: optional string

Skill version or 'latest' for most recent version

maxLength64
minLength1
stop_reason: "end_turn" or "max_tokens" or "stop_sequence" or 4 more
"end_turn"
"max_tokens"
"stop_sequence"
"tool_use"
"pause_turn"
"refusal"
"model_context_window_exceeded"
text_block: object{ citations, text, type }
text_block_param: object{ text, type, cache_control, citations }
text_citation: 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
text_citation_param: 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
text_delta: object{ text, type }
text: string
type: "text_delta"
text_editor_code_execution_create_result_block: object{ is_file_update, type }
is_file_update: boolean
type: "text_editor_code_execution_create_result"
text_editor_code_execution_create_result_block_param: object{ is_file_update, type }
is_file_update: boolean
type: "text_editor_code_execution_create_result"
text_editor_code_execution_str_replace_result_block: object{ lines, new_lines, new_start, 3 more }
lines: array of string
new_lines: number
new_start: number
old_lines: number
old_start: number
type: "text_editor_code_execution_str_replace_result"
text_editor_code_execution_str_replace_result_block_param: object{ type, lines, new_lines, 3 more }
type: "text_editor_code_execution_str_replace_result"
lines: optional array of string
new_lines: optional number
new_start: optional number
old_lines: optional number
old_start: optional number
text_editor_code_execution_tool_result_block: object{ content, tool_use_id, type }
text_editor_code_execution_tool_result_block_param: object{ content, tool_use_id, type, cache_control }
text_editor_code_execution_tool_result_error: object{ error_code, error_message, type }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
error_message: string
type: "text_editor_code_execution_tool_result_error"
text_editor_code_execution_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
text_editor_code_execution_tool_result_error_param: object{ error_code, type, error_message }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or 2 more
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
type: "text_editor_code_execution_tool_result_error"
error_message: optional string
text_editor_code_execution_view_result_block: object{ content, file_type, num_lines, 3 more }
content: string
file_type: "text" or "image" or "pdf"
One of the following:
"text"
"image"
"pdf"
num_lines: number
start_line: number
total_lines: number
type: "text_editor_code_execution_view_result"
text_editor_code_execution_view_result_block_param: object{ content, file_type, type, 3 more }
content: string
file_type: "text" or "image" or "pdf"
One of the following:
"text"
"image"
"pdf"
type: "text_editor_code_execution_view_result"
num_lines: optional number
start_line: optional number
total_lines: optional number
thinking_block: object{ signature, thinking, type }
signature: string

A value used to verify that this thinking block was generated by Claude when it is passed back to the API.

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.

thinking: string

The text of Claude's thinking process for this block.

type: "thinking"
thinking_block_param: object{ signature, thinking, type }
signature: string

The signature value of this thinking block, exactly as returned by the API in a previous response. Used to verify that the block was generated by Claude.

Thinking blocks must be passed back unmodified and in their original order; a modified block results in a 400 invalid_request_error.

thinking: string

The thinking text of this block as returned by the API.

type: "thinking"
thinking_config_adaptive: object{ type, display }
type: "adaptive"
display: optional "summarized" or "omitted"

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.

One of the following:
"summarized"
"omitted"
thinking_config_disabled: object{ type }
type: "disabled"
thinking_config_enabled: object{ budget_tokens, type, display }
budget_tokens: number

Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.

Must be ≥1024 and less than max_tokens.

See extended thinking for details.

minimum1024
type: "enabled"
display: optional "summarized" or "omitted"

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.

One of the following:
"summarized"
"omitted"
thinking_config_param: ThinkingConfigEnabled { budget_tokens, type, display } or ThinkingConfigDisabled { type } or ThinkingConfigAdaptive { type, display }

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.

thinking_delta: object{ thinking, type }
thinking: string

The incremental thinking text for this content block. Concatenate the thinking values of successive thinking_delta events to assemble the block's full thinking value.

type: "thinking_delta"
tool: object{ input_schema, name, allowed_callers, 7 more }
tool_bash_20250124: object{ name, type, allowed_callers, 4 more }
tool_choice: 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.

tool_choice_any: object{ type, disable_parallel_tool_use }

The model will use any available tools.

type: "any"
disable_parallel_tool_use: optional boolean

Whether to disable parallel tool use.

Defaults to false. If set to true, the model will output exactly one tool use.

tool_choice_auto: object{ type, disable_parallel_tool_use }

The model will automatically decide whether to use tools.

type: "auto"
disable_parallel_tool_use: optional boolean

Whether to disable parallel tool use.

Defaults to false. If set to true, the model will output at most one tool use.

tool_choice_none: object{ type }

The model will not be allowed to use tools.

type: "none"
tool_choice_tool: object{ name, type, disable_parallel_tool_use }

The model will use the specified tool with tool_choice.name.

name: string

The name of the tool to use.

type: "tool"
disable_parallel_tool_use: optional boolean

Whether to disable parallel tool use.

Defaults to false. If set to true, the model will output exactly one tool use.

tool_reference_block: object{ tool_name, type }
tool_name: string
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: "tool_reference"
tool_reference_block_param: object{ tool_name, type, cache_control }

Tool reference block that can be included in tool_result content.

tool_name: string
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: "tool_reference"
cache_control: optional object{ type, ttl }

Create a cache control breakpoint at this content block.

type: "ephemeral"
ttl: optional "5m" or "1h"

The time-to-live for the cache control breakpoint.

This may be one the following values:

  • 5m: 5 minutes
  • 1h: 1 hour

Defaults to 5m. See prompt caching pricing for details.

One of the following:
"5m"
"1h"
tool_result_block_param: object{ tool_use_id, type, cache_control, 3 more }
tool_search_tool_bm25_20251119: object{ name, type, allowed_callers, 3 more }
tool_search_tool_regex_20251119: object{ name, type, allowed_callers, 3 more }
tool_search_tool_result_block: object{ content, tool_use_id, type }
tool_search_tool_result_block_param: object{ content, tool_use_id, type, cache_control }
tool_search_tool_result_error: object{ error_code, error_message, type }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
error_message: string
type: "tool_search_tool_result_error"
tool_search_tool_result_error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
tool_search_tool_result_error_param: object{ error_code, type, error_message }
error_code: "invalid_tool_input" or "unavailable" or "too_many_requests" or "execution_time_exceeded"
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
type: "tool_search_tool_result_error"
error_message: optional string
tool_search_tool_search_result_block: object{ tool_references, type }
tool_references: array of ToolReferenceBlock { tool_name, type }
tool_name: string
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: "tool_reference"
type: "tool_search_tool_search_result"
tool_search_tool_search_result_block_param: object{ tool_references, type }
tool_references: array of ToolReferenceBlockParam { tool_name, type, cache_control }
tool_name: string
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: "tool_reference"
cache_control: optional object{ type, ttl }

Create a cache control breakpoint at this content block.

type: "ephemeral"
ttl: optional "5m" or "1h"

The time-to-live for the cache control breakpoint.

This may be one the following values:

  • 5m: 5 minutes
  • 1h: 1 hour

Defaults to 5m. See prompt caching pricing for details.

One of the following:
"5m"
"1h"
type: "tool_search_tool_search_result"
tool_text_editor_20250124: object{ name, type, allowed_callers, 4 more }
tool_text_editor_20250429: object{ name, type, allowed_callers, 4 more }
tool_text_editor_20250728: object{ name, type, allowed_callers, 5 more }
tool_union: 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 more

Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

tool_use_block: object{ id, caller, input, 3 more }
tool_use_block_param: object{ id, input, name, 4 more }
url_image_source: object{ type, url }
type: "url"
url: string
url_pdf_source: object{ type, url }
type: "url"
url: string
usage: object{ cache_creation, cache_creation_input_tokens, cache_read_input_tokens, 6 more }
user_location: object{ type, city, country, 2 more }
type: "approximate"
city: optional string

The city of the user.

maxLength255
minLength1
country: optional string

The two letter ISO country code of the user.

maxLength2
minLength2
region: optional string

The region of the user.

maxLength255
minLength1
timezone: optional string

The IANA timezone of the user.

maxLength255
minLength1
web_fetch_block: object{ content, retrieved_at, type, url }
web_fetch_block_param: object{ content, type, url, retrieved_at }
web_fetch_tool_20250910: object{ name, type, allowed_callers, 8 more }
web_fetch_tool_20260209: object{ name, type, allowed_callers, 8 more }
web_fetch_tool_20260309: object{ name, type, allowed_callers, 9 more }

Web fetch tool with use_cache parameter for bypassing cached content.

web_fetch_tool_20260318: object{ name, type, allowed_callers, 10 more }
web_fetch_tool_result_block: object{ caller, content, tool_use_id, type }
web_fetch_tool_result_block_param: object{ content, tool_use_id, type, 2 more }
web_fetch_tool_result_error_block: object{ error_code, type }
error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 6 more
One of the following:
"invalid_tool_input"
"url_too_long"
"url_not_allowed"
"url_not_in_prior_context"
"url_not_accessible"
"unsupported_content_type"
"too_many_requests"
"max_uses_exceeded"
"unavailable"
type: "web_fetch_tool_result_error"
web_fetch_tool_result_error_block_param: object{ error_code, type }
error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 6 more
One of the following:
"invalid_tool_input"
"url_too_long"
"url_not_allowed"
"url_not_in_prior_context"
"url_not_accessible"
"unsupported_content_type"
"too_many_requests"
"max_uses_exceeded"
"unavailable"
type: "web_fetch_tool_result_error"
web_fetch_tool_result_error_code: "invalid_tool_input" or "url_too_long" or "url_not_allowed" or 6 more
"invalid_tool_input"
"url_too_long"
"url_not_allowed"
"url_not_in_prior_context"
"url_not_accessible"
"unsupported_content_type"
"too_many_requests"
"max_uses_exceeded"
"unavailable"
web_search_result_block: object{ encrypted_content, page_age, title, 2 more }
encrypted_content: string
page_age: string
title: string
type: "web_search_result"
url: string
web_search_result_block_param: object{ encrypted_content, title, type, 2 more }
encrypted_content: string
title: string
type: "web_search_result"
url: string
page_age: optional string
web_search_tool_20250305: object{ name, type, allowed_callers, 7 more }
web_search_tool_20260209: object{ name, type, allowed_callers, 7 more }
web_search_tool_20260318: object{ name, type, allowed_callers, 8 more }
web_search_tool_request_error: object{ error_code, type }
error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"
type: "web_search_tool_result_error"
web_search_tool_result_block: object{ caller, content, tool_use_id, type }
web_search_tool_result_block_content: WebSearchToolResultError { error_code, type } or array of WebSearchResultBlock { encrypted_content, page_age, title, 2 more }
web_search_tool_result_block_param: object{ content, tool_use_id, type, 2 more }
web_search_tool_result_block_param_content: array of WebSearchResultBlockParam { encrypted_content, title, type, 2 more } or WebSearchToolRequestError { error_code, type }
web_search_tool_result_error: object{ error_code, type }
error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"
type: "web_search_tool_result_error"
web_search_tool_result_error_code: "invalid_tool_input" or "unavailable" or "max_uses_exceeded" or 3 more
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"

MessagesBatches

Create a Message Batch
$ ant messages:batches create
POST/v1/messages/batches
Retrieve a Message Batch
$ ant messages:batches retrieve
GET/v1/messages/batches/{message_batch_id}
List Message Batches
$ ant messages:batches list
GET/v1/messages/batches
Cancel a Message Batch
$ ant messages:batches cancel
POST/v1/messages/batches/{message_batch_id}/cancel
Delete a Message Batch
$ ant messages:batches delete
DELETE/v1/messages/batches/{message_batch_id}
Retrieve Message Batch results
$ ant messages:batches results
GET/v1/messages/batches/{message_batch_id}/results