Claude Platform Docs

Messages

Create a Message
messages.create(MessageCreateParams**kwargs) -> Message
POST/v1/messages
Count tokens in a Message
messages.count_tokens(MessageCountTokensParams**kwargs) -> MessageTokensCount
POST/v1/messages/count_tokens
Models
class Base64ImageSource:
data: str
formatbyte
media_type: Literal["image/jpeg", "image/png", "image/gif", "image/webp"]
One of the following:
"image/jpeg"
"image/png"
"image/gif"
"image/webp"
type: Literal["base64"]
class Base64PDFSource:
data: str
formatbyte
media_type: Literal["application/pdf"]
type: Literal["base64"]
class BashCodeExecutionOutputBlock:
file_id: str
type: Literal["bash_code_execution_output"]
defaultbash_code_execution_output
class BashCodeExecutionOutputBlockParam:
file_id: str
type: Literal["bash_code_execution_output"]
class BashCodeExecutionResultBlock:
file_id: str
type: Literal["bash_code_execution_output"]
defaultbash_code_execution_output
return_code: int
stderr: str
stdout: str
type: Literal["bash_code_execution_result"]
defaultbash_code_execution_result
class BashCodeExecutionResultBlockParam:
file_id: str
type: Literal["bash_code_execution_output"]
return_code: int
stderr: str
stdout: str
type: Literal["bash_code_execution_result"]
class BashCodeExecutionToolResultBlock:
class BashCodeExecutionToolResultBlockParam:
class BashCodeExecutionToolResultError:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
type: Literal["bash_code_execution_tool_result_error"]
defaultbash_code_execution_tool_result_error
Literal["invalid_tool_input", "unavailable", "too_many_requests", 2 more]
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
class BashCodeExecutionToolResultErrorParam:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"output_file_too_large"
type: Literal["bash_code_execution_tool_result_error"]
class BrowserCloseTabConfig:

close_tab's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserDoubleClickConfig:

double_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserFileUploadConfig:

file_upload's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserFindConfig:

find's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserFormInputConfig:

form_input's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserGetPageTextConfig:

get_page_text's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserHoldKeyConfig:

hold_key's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserHoverConfig:

hover's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserJavascriptExecConfig:

javascript_exec's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserKeyConfig:

key's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserLeftClickConfig:

left_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserLeftClickDragConfig:

left_click_drag's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserLeftMouseDownConfig:

left_mouse_down's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserLeftMouseUpConfig:

left_mouse_up's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserListTabsConfig:

list_tabs's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserMiddleClickConfig:

middle_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserMouseMoveConfig:

mouse_move's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserNavigateConfig:

navigate's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserNewTabConfig:

new_tab's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserReadConsoleConfig:

read_console's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserReadNetworkConfig:

read_network's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserReadPageConfig:

read_page's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserRightClickConfig:

right_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserScreenshotConfig:

screenshot's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserScrollConfig:

scroll's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserScrollToConfig:

scroll_to's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserStateBlockParam:

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.

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.

One of the following:
class BrowserStateChangeDownloadCompleted:

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: str

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

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

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

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

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[int]

The completed download's size.

minimum0
class BrowserStateChangeDownloadFailed:

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

download_id: str

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

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

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

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

The failure or cancellation detail, when known.

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

A file download that started during this call.

download_id: str

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

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

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

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

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: str

The tab_id of the opened tab, present in tabs.

maxLength4096
minLength1
pattern^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
type: Literal["tab_opened"]
class BrowserStateTabEntry:

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: str

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

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

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

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

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

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

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

class BrowserSwitchTabConfig:

switch_tab's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserToolset20260801:

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.

class BrowserToolsetConfigs:

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.

class BrowserTripleClickConfig:

triple_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserTypeConfig:

type's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserWaitConfig:

wait's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class BrowserZoomConfig:

zoom's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class CacheControlEphemeral:
type: Literal["ephemeral"]
ttl: Optional[Literal["5m", "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"
class CacheCreation:
ephemeral_1h_input_tokens: int

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

default0
minimum0
ephemeral_5m_input_tokens: int

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

default0
minimum0
class CitationCharLocation:
cited_text: str
document_index: int
minimum0
document_title: Optional[str]
end_char_index: int
file_id: Optional[str]
start_char_index: int
minimum0
type: Literal["char_location"]
defaultchar_location
class CitationCharLocationParam:
cited_text: str
document_index: int
minimum0
document_title: Optional[str]
maxLength500
minLength1
end_char_index: int
start_char_index: int
minimum0
type: Literal["char_location"]
class CitationContentBlockLocation:
cited_text: str

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: int
minimum0
document_title: Optional[str]
end_block_index: int

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: Optional[str]
start_block_index: int

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

minimum0
type: Literal["content_block_location"]
defaultcontent_block_location
class CitationContentBlockLocationParam:
cited_text: str

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: int
minimum0
document_title: Optional[str]
maxLength500
minLength1
end_block_index: int

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: int

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

minimum0
type: Literal["content_block_location"]
class CitationPageLocation:
cited_text: str
document_index: int
minimum0
document_title: Optional[str]
end_page_number: int
file_id: Optional[str]
start_page_number: int
minimum1
type: Literal["page_location"]
defaultpage_location
class CitationPageLocationParam:
cited_text: str
document_index: int
minimum0
document_title: Optional[str]
maxLength500
minLength1
end_page_number: int
start_page_number: int
minimum1
type: Literal["page_location"]
class CitationSearchResultLocationParam:
cited_text: str

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: int

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: int

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: str
start_block_index: int

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

minimum0
title: Optional[str]
type: Literal["search_result_location"]
class CitationWebSearchResultLocationParam:
cited_text: str
encrypted_index: str
title: Optional[str]
maxLength512
minLength1
type: Literal["web_search_result_location"]
url: str
minLength1
class CitationsConfig:
enabled: bool
defaultfalse
class CitationsConfigParam:
enabled: Optional[bool]
class CitationsDelta:
class CitationsSearchResultLocation:
cited_text: str

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: int

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: int

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: str
start_block_index: int

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

minimum0
title: Optional[str]
type: Literal["search_result_location"]
defaultsearch_result_location
class CitationsWebSearchResultLocation:
cited_text: str
encrypted_index: str
title: Optional[str]
maxLength512
type: Literal["web_search_result_location"]
defaultweb_search_result_location
url: str
class CodeExecutionOutputBlock:
file_id: str
type: Literal["code_execution_output"]
defaultcode_execution_output
class CodeExecutionOutputBlockParam:
file_id: str
type: Literal["code_execution_output"]
class CodeExecutionResultBlock:
file_id: str
type: Literal["code_execution_output"]
defaultcode_execution_output
return_code: int
stderr: str
stdout: str
type: Literal["code_execution_result"]
defaultcode_execution_result
class CodeExecutionResultBlockParam:
file_id: str
type: Literal["code_execution_output"]
return_code: int
stderr: str
stdout: str
type: Literal["code_execution_result"]
class CodeExecutionTool20250522:
class CodeExecutionTool20250825:
class CodeExecutionTool20260120:

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

class CodeExecutionTool20260521:

Code execution tool with REPL state persistence.

class CodeExecutionToolResultBlock:

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

One of the following:
tool_use_id: str
pattern^srvtoolu_[a-zA-Z0-9_]+$
type: Literal["code_execution_tool_result"]
defaultcode_execution_tool_result

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

One of the following:
class CodeExecutionToolResultBlockParam:

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

One of the following:
tool_use_id: str
pattern^srvtoolu_[a-zA-Z0-9_]+$
type: Literal["code_execution_tool_result"]
cache_control: Optional[CacheControlEphemeral]

Create a cache control breakpoint at this content block.

type: Literal["ephemeral"]
ttl: Optional[Literal["5m", "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"

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

One of the following:
class CodeExecutionToolResultError:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
type: Literal["code_execution_tool_result_error"]
defaultcode_execution_tool_result_error
Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
class CodeExecutionToolResultErrorParam:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
type: Literal["code_execution_tool_result_error"]
class ComputerCursorPositionConfig:

cursor_position's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerDoubleClickConfig:

double_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerHoldKeyConfig:

hold_key's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerKeyConfig:

key's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerLeftClickConfig:

left_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerLeftClickDragConfig:

left_click_drag's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerLeftMouseDownConfig:

left_mouse_down's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerLeftMouseUpConfig:

left_mouse_up's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerMiddleClickConfig:

middle_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerMouseMoveConfig:

mouse_move's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerRightClickConfig:

right_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerScreenshotConfig:

screenshot's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerScrollConfig:

scroll's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerToolset20260801:

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.

class ComputerToolsetConfigs:

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.

class ComputerTripleClickConfig:

triple_click's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerTypeConfig:

type's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerWaitConfig:

wait's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class ComputerZoomConfig:

zoom's config overrides.

defer_loading: Optional[bool]

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

enabled: Optional[bool]

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.

class Container:

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

id: str

Identifier for the container used in this request

expires_at: datetime

The time at which the container will expire.

formatdate-time
skills: Optional[List[ContainerSkill]]

Skills loaded in the container

skill_id: str

Skill ID

maxLength64
minLength1
type: Literal["anthropic", "custom"]

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

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

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

maxLength64
minLength1
class ContainerParams:

Container parameters with skills to be loaded.

id: Optional[str]

Container id

skills: Optional[List[SkillParams]]

List of skills to load in the container

maxItems20
skill_id: str

Skill ID

maxLength64
minLength1
type: Literal["anthropic", "custom"]

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

One of the following:
"anthropic"
"custom"
version: Optional[str]

Skill version or 'latest' for most recent version

maxLength64
minLength1
class ContainerSkill:

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

skill_id: str

Skill ID

maxLength64
minLength1
type: Literal["anthropic", "custom"]

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

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

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

maxLength64
minLength1
class ContainerUploadBlock:

Response model for a file uploaded to the container.

file_id: str
type: Literal["container_upload"]
defaultcontainer_upload
class ContainerUploadBlockParam:

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: str
type: Literal["container_upload"]
cache_control: Optional[CacheControlEphemeral]

Create a cache control breakpoint at this content block.

type: Literal["ephemeral"]
ttl: Optional[Literal["5m", "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"

Response model for a file uploaded to the container.

One of the following:

Regular text content.

One of the following:
class ContentBlockSource:
content: Union[str, List[ContentBlockSourceContent]]
One of the following:
str
One of the following:
class TextBlockParam:
class ImageBlockParam:
type: Literal["content"]
One of the following:
class TextBlockParam:
class ImageBlockParam:
class DirectCaller:

Tool invocation directly from the model.

type: Literal["direct"]
class DocumentBlock:
class DocumentBlockParam:
class EncryptedCodeExecutionResultBlock:

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

file_id: str
type: Literal["code_execution_output"]
defaultcode_execution_output
encrypted_stdout: str
return_code: int
stderr: str
type: Literal["encrypted_code_execution_result"]
defaultencrypted_code_execution_result
class EncryptedCodeExecutionResultBlockParam:

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

file_id: str
type: Literal["code_execution_output"]
encrypted_stdout: str
return_code: int
stderr: str
type: Literal["encrypted_code_execution_result"]
class FileDocumentSource:
file_id: str
type: Literal["file"]
class FileImageSource:
file_id: str
type: Literal["file"]
class ImageBlockParam:
class ImageTransformationsParam:

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[Literal["downsize", "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"
class InputJSONDelta:
partial_json: str
type: Literal["input_json_delta"]
defaultinput_json_delta
class JSONOutputFormat:
schema: Dict[str, object]

The JSON schema of the format

type: Literal["json_schema"]
class MemoryTool20250818:
class Message:

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

One of the following:
Optional[MessageCreateParamsContainer]

Container identifier for reuse across requests.

One of the following:
class ContainerParams:

Container parameters with skills to be loaded.

id: Optional[str]

Container id

skills: Optional[List[SkillParams]]

List of skills to load in the container

maxItems20
skill_id: str

Skill ID

maxLength64
minLength1
type: Literal["anthropic", "custom"]

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

One of the following:
"anthropic"
"custom"
version: Optional[str]

Skill version or 'latest' for most recent version

maxLength64
minLength1
str
class MessageDeltaUsage:
class MessageParam:
class MessageTokensCount:
input_tokens: int

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

class Metadata:
user_id: Optional[str]

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
Union[Literal["claude-sonnet-5", "claude-fable-5", "claude-mythos-5", 12 more], str]

The model that will complete your prompt.

See models for additional details and options.

One of the following:
class OutputConfig:
effort: Optional[Literal["low", "medium", "high", 2 more]]

All possible effort levels.

One of the following:
"low"
"medium"
"high"
"xhigh"
"max"
format: Optional[JSONOutputFormat]

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

schema: Dict[str, object]

The JSON schema of the format

type: Literal["json_schema"]
class OutputTokensDetails:
thinking_tokens: int

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.

default0
minimum0
class PlainTextSource:
data: str
media_type: Literal["text/plain"]
type: Literal["text"]
One of the following:
class RawContentBlockDeltaEvent:
One of the following:
index: int
type: Literal["content_block_delta"]
defaultcontent_block_delta
class RawContentBlockStartEvent:
class RawContentBlockStopEvent:
index: int
type: Literal["content_block_stop"]
defaultcontent_block_stop
class RawMessageDeltaEvent:
class RawMessageStartEvent:
message: Message
type: Literal["message_start"]
defaultmessage_start
class RawMessageStopEvent:
type: Literal["message_stop"]
defaultmessage_stop
One of the following:
class RedactedThinkingBlock:
data: str

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: Literal["redacted_thinking"]
defaultredacted_thinking
class RedactedThinkingBlockParam:
data: str

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: Literal["redacted_thinking"]
class RefusalStopDetails:

Structured information about a refusal.

category: Optional[Literal["cyber", "bio", "frontier_llm", 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: Optional[str]

Human-readable explanation of the refusal.

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

type: Literal["refusal"]
defaultrefusal
class SearchResultBlockParam:
class ServerToolCaller:

Tool invocation generated by a server-side tool.

tool_id: str
pattern^srvtoolu_[a-zA-Z0-9_]+$
type: Literal["code_execution_20250825"]
class ServerToolCaller20260120:
tool_id: str
pattern^srvtoolu_[a-zA-Z0-9_]+$
type: Literal["code_execution_20260120"]
class ServerToolUsage:
web_fetch_requests: int

The number of web fetch tool requests.

default0
minimum0
web_search_requests: int

The number of web search tool requests.

default0
minimum0
class ServerToolUseBlock:
class ServerToolUseBlockParam:
class SignatureDelta:
signature: str

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: Literal["signature_delta"]
defaultsignature_delta
class SkillParams:

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

skill_id: str

Skill ID

maxLength64
minLength1
type: Literal["anthropic", "custom"]

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

One of the following:
"anthropic"
"custom"
version: Optional[str]

Skill version or 'latest' for most recent version

maxLength64
minLength1
Literal["end_turn", "max_tokens", "stop_sequence", 4 more]
One of the following:
"end_turn"
"max_tokens"
"stop_sequence"
"tool_use"
"pause_turn"
"refusal"
"model_context_window_exceeded"
class TextBlock:
class TextBlockParam:
One of the following:
One of the following:
class TextDelta:
text: str
type: Literal["text_delta"]
defaulttext_delta
class TextEditorCodeExecutionCreateResultBlock:
is_file_update: bool
type: Literal["text_editor_code_execution_create_result"]
defaulttext_editor_code_execution_create_result
class TextEditorCodeExecutionCreateResultBlockParam:
is_file_update: bool
type: Literal["text_editor_code_execution_create_result"]
class TextEditorCodeExecutionStrReplaceResultBlock:
lines: Optional[List[str]]
new_lines: Optional[int]
new_start: Optional[int]
old_lines: Optional[int]
old_start: Optional[int]
type: Literal["text_editor_code_execution_str_replace_result"]
defaulttext_editor_code_execution_str_replace_result
class TextEditorCodeExecutionStrReplaceResultBlockParam:
type: Literal["text_editor_code_execution_str_replace_result"]
lines: Optional[List[str]]
new_lines: Optional[int]
new_start: Optional[int]
old_lines: Optional[int]
old_start: Optional[int]
class TextEditorCodeExecutionToolResultBlock:
class TextEditorCodeExecutionToolResultBlockParam:
class TextEditorCodeExecutionToolResultError:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
error_message: Optional[str]
type: Literal["text_editor_code_execution_tool_result_error"]
defaulttext_editor_code_execution_tool_result_error
Literal["invalid_tool_input", "unavailable", "too_many_requests", 2 more]
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
class TextEditorCodeExecutionToolResultErrorParam:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
"file_not_found"
type: Literal["text_editor_code_execution_tool_result_error"]
error_message: Optional[str]
class TextEditorCodeExecutionViewResultBlock:
content: str
file_type: Literal["text", "image", "pdf"]
One of the following:
"text"
"image"
"pdf"
num_lines: Optional[int]
start_line: Optional[int]
total_lines: Optional[int]
type: Literal["text_editor_code_execution_view_result"]
defaulttext_editor_code_execution_view_result
class TextEditorCodeExecutionViewResultBlockParam:
content: str
file_type: Literal["text", "image", "pdf"]
One of the following:
"text"
"image"
"pdf"
type: Literal["text_editor_code_execution_view_result"]
num_lines: Optional[int]
start_line: Optional[int]
total_lines: Optional[int]
class ThinkingBlock:
signature: str

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: str

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

type: Literal["thinking"]
defaultthinking
class ThinkingBlockParam:
signature: str

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: str

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

type: Literal["thinking"]
class ThinkingConfigAdaptive:
type: Literal["adaptive"]
display: Optional[Literal["summarized", "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"
class ThinkingConfigDisabled:
type: Literal["disabled"]
class ThinkingConfigEnabled:
budget_tokens: int

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: Literal["enabled"]
display: Optional[Literal["summarized", "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"

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.

One of the following:
class ThinkingDelta:
thinking: str

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: Literal["thinking_delta"]
defaultthinking_delta
class Tool:
class ToolBash20250124:

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.

One of the following:
class ToolChoiceAny:

The model will use any available tools.

type: Literal["any"]
disable_parallel_tool_use: Optional[bool]

Whether to disable parallel tool use.

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

class ToolChoiceAuto:

The model will automatically decide whether to use tools.

type: Literal["auto"]
disable_parallel_tool_use: Optional[bool]

Whether to disable parallel tool use.

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

class ToolChoiceNone:

The model will not be allowed to use tools.

type: Literal["none"]
class ToolChoiceTool:

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

name: str

The name of the tool to use.

type: Literal["tool"]
disable_parallel_tool_use: Optional[bool]

Whether to disable parallel tool use.

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

class ToolReferenceBlock:
tool_name: str
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: Literal["tool_reference"]
defaulttool_reference
class ToolReferenceBlockParam:

Tool reference block that can be included in tool_result content.

tool_name: str
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: Literal["tool_reference"]
cache_control: Optional[CacheControlEphemeral]

Create a cache control breakpoint at this content block.

type: Literal["ephemeral"]
ttl: Optional[Literal["5m", "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"
class ToolResultBlockParam:
class ToolSearchToolBm25_20251119:
class ToolSearchToolRegex20251119:
class ToolSearchToolResultBlock:
class ToolSearchToolResultBlockParam:
class ToolSearchToolResultError:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
error_message: Optional[str]
type: Literal["tool_search_tool_result_error"]
defaulttool_search_tool_result_error
Literal["invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded"]
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
class ToolSearchToolResultErrorParam:
One of the following:
"invalid_tool_input"
"unavailable"
"too_many_requests"
"execution_time_exceeded"
type: Literal["tool_search_tool_result_error"]
error_message: Optional[str]
class ToolSearchToolSearchResultBlock:
tool_references: List[ToolReferenceBlock]
tool_name: str
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: Literal["tool_reference"]
defaulttool_reference
type: Literal["tool_search_tool_search_result"]
defaulttool_search_tool_search_result
class ToolSearchToolSearchResultBlockParam:
tool_references: List[ToolReferenceBlockParam]
tool_name: str
maxLength256
minLength1
pattern^[a-zA-Z0-9_-]{1,256}$
type: Literal["tool_reference"]
cache_control: Optional[CacheControlEphemeral]

Create a cache control breakpoint at this content block.

type: Literal["ephemeral"]
ttl: Optional[Literal["5m", "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: Literal["tool_search_tool_search_result"]
class ToolTextEditor20250124:
class ToolTextEditor20250429:
class ToolTextEditor20250728:

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

One of the following:
class ToolUseBlock:
class ToolUseBlockParam:
class URLImageSource:
type: Literal["url"]
url: str
class URLPDFSource:
type: Literal["url"]
url: str
class Usage:
class UserLocation:
type: Literal["approximate"]
city: Optional[str]

The city of the user.

maxLength255
minLength1
country: Optional[str]

The two letter ISO country code of the user.

maxLength2
minLength2
region: Optional[str]

The region of the user.

maxLength255
minLength1
timezone: Optional[str]

The IANA timezone of the user.

maxLength255
minLength1
class WebFetchBlock:
content: DocumentBlock
retrieved_at: Optional[str]

ISO 8601 timestamp when the content was retrieved

type: Literal["web_fetch_result"]
defaultweb_fetch_result
url: str

Fetched content URL

class WebFetchBlockParam:
type: Literal["web_fetch_result"]
url: str

Fetched content URL

retrieved_at: Optional[str]

ISO 8601 timestamp when the content was retrieved

class WebFetchTool20250910:
class WebFetchTool20260209:
class WebFetchTool20260309:

Web fetch tool with use_cache parameter for bypassing cached content.

class WebFetchTool20260318:
class WebFetchToolResultBlock:
class WebFetchToolResultBlockParam:
class WebFetchToolResultErrorBlock:
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: Literal["web_fetch_tool_result_error"]
defaultweb_fetch_tool_result_error
class WebFetchToolResultErrorBlockParam:
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: Literal["web_fetch_tool_result_error"]
Literal["invalid_tool_input", "url_too_long", "url_not_allowed", 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"
class WebSearchResultBlock:
encrypted_content: str
page_age: Optional[str]
title: str
type: Literal["web_search_result"]
defaultweb_search_result
url: str
class WebSearchResultBlockParam:
encrypted_content: str
title: str
type: Literal["web_search_result"]
url: str
page_age: Optional[str]
class WebSearchTool20250305:
class WebSearchTool20260209:
class WebSearchTool20260318:
class WebSearchToolRequestError:
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"
type: Literal["web_search_tool_result_error"]
class WebSearchToolResultBlock:
One of the following:
class WebSearchToolResultError:
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"
type: Literal["web_search_tool_result_error"]
defaultweb_search_tool_result_error
encrypted_content: str
page_age: Optional[str]
title: str
type: Literal["web_search_result"]
defaultweb_search_result
url: str
class WebSearchToolResultBlockParam:
One of the following:
encrypted_content: str
title: str
type: Literal["web_search_result"]
url: str
page_age: Optional[str]
class WebSearchToolRequestError:
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"
type: Literal["web_search_tool_result_error"]
class WebSearchToolResultError:
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"
type: Literal["web_search_tool_result_error"]
defaultweb_search_tool_result_error
Literal["invalid_tool_input", "unavailable", "max_uses_exceeded", 3 more]
One of the following:
"invalid_tool_input"
"unavailable"
"max_uses_exceeded"
"too_many_requests"
"query_too_long"
"request_too_large"

MessagesBatches

Create a Message Batch
messages.batches.create(BatchCreateParams**kwargs) -> MessageBatch
POST/v1/messages/batches
Retrieve a Message Batch
messages.batches.retrieve(strmessage_batch_id) -> MessageBatch
GET/v1/messages/batches/{message_batch_id}
List Message Batches
messages.batches.list(BatchListParams**kwargs) -> SyncPage[MessageBatch]
GET/v1/messages/batches
Cancel a Message Batch
messages.batches.cancel(strmessage_batch_id) -> MessageBatch
POST/v1/messages/batches/{message_batch_id}/cancel
Delete a Message Batch
messages.batches.delete(strmessage_batch_id) -> DeletedMessageBatch
DELETE/v1/messages/batches/{message_batch_id}
Retrieve Message Batch results
messages.batches.results(strmessage_batch_id) -> MessageBatchIndividualResponse
GET/v1/messages/batches/{message_batch_id}/results