Messages
Create a Message
BetaMessage beta().messages().create(params, requestOptions = RequestOptions.none())Count tokens in a Message
BetaMessageTokensCount beta().messages().countTokens(params, requestOptions = RequestOptions.none())Models
class BetaAdvisorMessageIterationUsage:Token usage for an advisor sub-inference iteration.
Token usage for an advisor sub-inference iteration.
Optional<BetaCacheCreation> cacheCreationBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
long ephemeral1hInputTokensThe number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
long ephemeral5mInputTokensThe number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
long cacheCreationInputTokensThe number of input tokens used to create the cache entry.
The number of input tokens used to create the cache entry.
long cacheReadInputTokensThe number of input tokens read from the cache.
The number of input tokens read from the cache.
long inputTokensThe number of input tokens which were used.
The number of input tokens which were used.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
long outputTokensThe number of output tokens which were used.
The number of output tokens which were used.
Usage for an advisor sub-inference iteration
class BetaAdvisorRedactedResultBlock:
Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.
The advisor sub-inference's stop reason (same values as the top-level message stop_reason).
class BetaAdvisorRedactedResultBlockParam:
Opaque blob produced by a prior response; must be round-tripped verbatim.
class BetaAdvisorResultBlock:
The advisor sub-inference's stop reason (same values as the top-level message stop_reason). max_tokens indicates the advisor's output was truncated at the tool's max_tokens value or the advisor model's policy cap.
class BetaAdvisorResultBlockParam:
class BetaAdvisorTool20260301:
class BetaAdvisorToolResultBlock:
class BetaAdvisorToolResultBlockParam:
class BetaAdvisorToolResultError:
ErrorCode errorCode
class BetaAdvisorToolResultErrorParam:
ErrorCode errorCode
class BetaAllThinkingTurns:
class BetaBase64ImageSource:
String data
MediaType mediaType
class BetaBase64PdfSource:
String data
class BetaBashCodeExecutionOutputBlock:
class BetaBashCodeExecutionOutputBlockParam:
class BetaBashCodeExecutionResultBlock:
List<BetaBashCodeExecutionOutputBlock> content
class BetaBashCodeExecutionResultBlockParam:
List<BetaBashCodeExecutionOutputBlockParam> content
class BetaBashCodeExecutionToolResultBlock:
class BetaBashCodeExecutionToolResultBlockParam:
class BetaBashCodeExecutionToolResultError:
ErrorCode errorCode
class BetaBashCodeExecutionToolResultErrorParam:
ErrorCode errorCode
class BetaBrowserCloseTabConfig:close_tab's config overrides.
close_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserDoubleClickConfig:double_click's config overrides.
double_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserFileUploadConfig:file_upload's config overrides.
file_upload's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserFindConfig:find's config overrides.
find's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserFormInputConfig:form_input's config overrides.
form_input's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserGetPageTextConfig:get_page_text's config overrides.
get_page_text's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserHoldKeyConfig:hold_key's config overrides.
hold_key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserHoverConfig:hover's config overrides.
hover's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserJavascriptExecConfig:javascript_exec's config overrides.
javascript_exec's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserKeyConfig:key's config overrides.
key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserLeftClickConfig:left_click's config overrides.
left_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserLeftClickDragConfig:left_click_drag's config overrides.
left_click_drag's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserLeftMouseDownConfig:left_mouse_down's config overrides.
left_mouse_down's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserLeftMouseUpConfig:left_mouse_up's config overrides.
left_mouse_up's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserListTabsConfig:list_tabs's config overrides.
list_tabs's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserMiddleClickConfig:middle_click's config overrides.
middle_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserMouseMoveConfig:mouse_move's config overrides.
mouse_move's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserNavigateConfig:navigate's config overrides.
navigate's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserNewTabConfig:new_tab's config overrides.
new_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserReadConsoleConfig:read_console's config overrides.
read_console's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserReadNetworkConfig:read_network's config overrides.
read_network's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserReadPageConfig:read_page's config overrides.
read_page's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserRightClickConfig:right_click's config overrides.
right_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserScreenshotConfig:screenshot's config overrides.
screenshot's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserScrollConfig:scroll's config overrides.
scroll's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserScrollToConfig:scroll_to's config overrides.
scroll_to's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserStateBlockParam: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.
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.
class BetaBrowserStateChange: unionA tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
Carries only the tab_id; the tab's title and url live on its
tabs entry, which must include the same tab_id. A tab opened
during a failed call gets no deferred tab_opened; it simply appears
in the next result's tabs inventory.
class BetaBrowserStateChangeDownloadCompleted:A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
A file download that finished during this call, reported with the
same download_id as its download_started — or without a prior
download_started, when the download finished during the call that
started it (at most one state change per download_id per result).
String downloadIdThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
String urlThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
Optional<String> pathWhere 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.
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.
Optional<Long> sizeBytesThe completed download's size.
The completed download's size.
class BetaBrowserStateChangeDownloadFailed:A file download that failed — or was cancelled — during this call.
A file download that failed — or was cancelled — during this call.
String downloadIdThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
String urlThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
Optional<String> errorThe failure or cancellation detail, when known.
The failure or cancellation detail, when known.
class BetaBrowserStateChangeDownloadStarted:A file download that started during this call.
A file download that started during this call.
String downloadIdThe caller-assigned identifier for this download, stable across the state changes reporting it.
The caller-assigned identifier for this download, stable across the state changes reporting it.
String urlThe final post-redirect URL the download was served from.
The final post-redirect URL the download was served from.
class BetaBrowserStateChangeTabOpened:A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
A tab this call's execution opened that remains open at its end —
the creation delta of the tabs inventory, not an event log.
Carries only the tab_id; the tab's title and url live on its
tabs entry, which must include the same tab_id. A tab opened
during a failed call gets no deferred tab_opened; it simply appears
in the next result's tabs inventory.
String tabIdThe tab_id of the opened tab, present in tabs.
The tab_id of the opened tab, present in tabs.
class BetaBrowserStateTabEntry:One open browser tab reported in a browser_state block's tabs
inventory.
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.
String tabIdThe caller-assigned identifier for this tab, unique within the inventory.
The caller-assigned identifier for this tab, unique within the inventory.
String titleThe title of the page the tab is showing. May be empty.
The title of the page the tab is showing. May be empty.
String urlThe URL of the page the tab is showing. May be empty.
The URL of the page the tab is showing. May be empty.
Whether this tab is the active tab after this call. Whenever tabs is non-empty, exactly one entry is marked active: true.
class BetaBrowserSwitchTabConfig:switch_tab's config overrides.
switch_tab's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserToolset20260801: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.
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.
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
Optional<BetaBrowserToolsetConfigs> configsPer-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
class BetaBrowserToolsetConfigs:Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for browser_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
class BetaBrowserTripleClickConfig:triple_click's config overrides.
triple_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserTypeConfig:type's config overrides.
type's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserWaitConfig:wait's config overrides.
wait's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaBrowserZoomConfig:zoom's config overrides.
zoom's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaCacheControlEphemeral:
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaCacheCreation:
long ephemeral1hInputTokensThe number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
long ephemeral5mInputTokensThe number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
class BetaCacheMissMessagesChanged:
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissModelChanged:
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissPreviousMessageNotFound:
class BetaCacheMissSystemChanged:
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissToolsChanged:
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissUnavailable:
class BetaCitationCharLocation:
long documentIndex
long startCharIndex
class BetaCitationCharLocationParam:
long documentIndex
Optional<String> documentTitle
long startCharIndex
class BetaCitationConfig:
class BetaCitationContentBlockLocation:
String citedTextThe full text of the cited block range, concatenated.
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.
long documentIndex
long endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
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.
long startBlockIndex0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class BetaCitationContentBlockLocationParam:
String citedTextThe full text of the cited block range, concatenated.
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.
long documentIndex
Optional<String> documentTitle
long endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
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.
long startBlockIndex0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class BetaCitationPageLocation:
long documentIndex
long startPageNumber
class BetaCitationPageLocationParam:
long documentIndex
Optional<String> documentTitle
long startPageNumber
class BetaCitationSearchResultLocation:
String citedTextThe full text of the cited block range, concatenated.
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.
long endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
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.
long searchResultIndex0-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.
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.
long startBlockIndex0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class BetaCitationSearchResultLocationParam:
String citedTextThe full text of the cited block range, concatenated.
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.
long endBlockIndexExclusive 0-based end index of the cited block range in the source's content array.
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.
long searchResultIndex0-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.
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.
long startBlockIndex0-based index of the first cited block in the source's content array.
0-based index of the first cited block in the source's content array.
class BetaCitationWebSearchResultLocationParam:
Optional<String> title
String url
class BetaCitationsConfigParam:
class BetaCitationsDelta:
class BetaCitationsWebSearchResultLocation:
Optional<String> title
class BetaClearThinking20251015Edit:
Optional<Keep> keepNumber of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
class BetaThinkingTurns:
long value
class BetaAllThinkingTurns:
class BetaClearThinking20251015EditResponse:
long clearedInputTokensNumber of input tokens cleared by this edit.
Number of input tokens cleared by this edit.
long clearedThinkingTurnsNumber of thinking turns that were cleared.
Number of thinking turns that were cleared.
The type of context management edit applied.
class BetaClearToolUses20250919Edit:
class BetaClearToolUses20250919EditResponse:
long clearedInputTokensNumber of input tokens cleared by this edit.
Number of input tokens cleared by this edit.
long clearedToolUsesNumber of tool uses that were cleared.
Number of tool uses that were cleared.
The type of context management edit applied.
class BetaCodeExecutionOutputBlock:
class BetaCodeExecutionOutputBlockParam:
class BetaCodeExecutionResultBlock:
List<BetaCodeExecutionOutputBlock> content
class BetaCodeExecutionResultBlockParam:
List<BetaCodeExecutionOutputBlockParam> content
class BetaCodeExecutionTool20250522:
class BetaCodeExecutionTool20250825:
class BetaCodeExecutionTool20260120:Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
class BetaCodeExecutionTool20260521:Code execution tool with REPL state persistence.
Code execution tool with REPL state persistence.
class BetaCodeExecutionToolResultBlock:
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
String toolUseId
class BetaCodeExecutionToolResultBlockContent: unionCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class BetaCodeExecutionToolResultBlockParam:
Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
String toolUseId
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaCodeExecutionToolResultBlockParamContent: unionCode execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
class BetaCodeExecutionToolResultError:
BetaCodeExecutionToolResultErrorCode errorCode
enum BetaCodeExecutionToolResultErrorCode:
class BetaCodeExecutionToolResultErrorParam:
BetaCodeExecutionToolResultErrorCode errorCode
class BetaCompact20260112Edit:Automatically compact older context when reaching the configured trigger threshold.
Automatically compact older context when reaching the configured trigger threshold.
Additional instructions for summarization.
Whether to pause after compaction and return the compaction block to the user.
Optional<BetaInputTokensTrigger> triggerWhen to trigger compaction. Defaults to 150000 input tokens.
When to trigger compaction. Defaults to 150000 input tokens.
long value
class BetaCompactionBlock:A compaction block returned when autocompact is triggered.
A compaction block returned when autocompact is triggered.
When content is None, it indicates the compaction failed to produce a valid summary (e.g., malformed output from the model). Clients may round-trip compaction blocks with null content; the server treats them as no-ops.
Summary of compacted content, or null if compaction failed
Opaque metadata from prior compaction, to be round-tripped verbatim
class BetaCompactionBlockParam:A compaction block containing summary of previous context.
A compaction block containing summary of previous context.
Users should round-trip these blocks from responses to subsequent requests to maintain context across compaction boundaries.
When content is None, the block represents a failed compaction. The server treats these as no-ops. Empty string content is not allowed.
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
Summary of previously compacted content, or null if compaction failed
Opaque metadata from prior compaction, to be round-tripped verbatim
class BetaCompactionContentBlockDelta:
Opaque metadata from prior compaction, to be round-tripped verbatim
class BetaCompactionIterationUsage:Token usage for a compaction iteration.
Token usage for a compaction iteration.
Optional<BetaCacheCreation> cacheCreationBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
long ephemeral1hInputTokensThe number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
long ephemeral5mInputTokensThe number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
long cacheCreationInputTokensThe number of input tokens used to create the cache entry.
The number of input tokens used to create the cache entry.
long cacheReadInputTokensThe number of input tokens read from the cache.
The number of input tokens read from the cache.
long inputTokensThe number of input tokens which were used.
The number of input tokens which were used.
long outputTokensThe number of output tokens which were used.
The number of output tokens which were used.
Usage for a compaction iteration
class BetaComputerCursorPositionConfig:cursor_position's config overrides.
cursor_position's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerDoubleClickConfig:double_click's config overrides.
double_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerHoldKeyConfig:hold_key's config overrides.
hold_key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerKeyConfig:key's config overrides.
key's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerLeftClickConfig:left_click's config overrides.
left_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerLeftClickDragConfig:left_click_drag's config overrides.
left_click_drag's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerLeftMouseDownConfig:left_mouse_down's config overrides.
left_mouse_down's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerLeftMouseUpConfig:left_mouse_up's config overrides.
left_mouse_up's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerMiddleClickConfig:middle_click's config overrides.
middle_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerMouseMoveConfig:mouse_move's config overrides.
mouse_move's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerRightClickConfig:right_click's config overrides.
right_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerScreenshotConfig:screenshot's config overrides.
screenshot's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerScrollConfig:scroll's config overrides.
scroll's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerToolset20260801:The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
The computer toolset: a single tools[] entry (carrying no
name) that declares the computer tool family. The model is
served the family's tool with any members disabled via configs
removed from its schema. Every member is enabled by default, zoom
included. The single-tool options display_number and
enable_zoom are not fields of a toolset entry — it carries only
type, configs, and cache_control; zoom is controlled
via configs.zoom.enabled.
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
Optional<BetaComputerToolsetConfigs> configsPer-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
class BetaComputerToolsetConfigs:Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
Per-member configuration for computer_toolset_20260801: one
optional field per member tool, keyed by the member name — the same
name the member's tool_use blocks carry. Every member is an
accepted key, and a member's defaults apply wherever its key is
absent. Unknown keys are rejected: the field set is this toolset
version's complete member set.
class BetaComputerTripleClickConfig:triple_click's config overrides.
triple_click's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerTypeConfig:type's config overrides.
type's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerWaitConfig:wait's config overrides.
wait's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaComputerZoomConfig:zoom's config overrides.
zoom's config overrides.
Defer loading for this member. Must resolve to the same value on every enabled member of the toolset.
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 BetaContainer:Information about the container used in the request (for the code execution tool)
Information about the container used in the request (for the code execution tool)
Identifier for the container used in this request
LocalDateTime expiresAtThe time at which the container will expire.
The time at which the container will expire.
Optional<List<BetaContainerSkill>> skillsSkills loaded in the container
Skills loaded in the container
String skillIdSkill ID
Skill ID
Type typeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
String versionThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
class BetaContainerParams:Container parameters with skills to be loaded.
Container parameters with skills to be loaded.
Container id
Optional<List<BetaSkillParams>> skillsList of skills to load in the container
List of skills to load in the container
String skillIdSkill ID
Skill ID
Type typeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Optional<String> versionSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
class BetaContainerSkill:A skill that was loaded in a container (response model).
A skill that was loaded in a container (response model).
String skillIdSkill ID
Skill ID
Type typeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
String versionThe resolved version: a skill version ID for custom skills.
The resolved version: a skill version ID for custom skills.
class BetaContainerUploadBlock:Response model for a file uploaded to the container.
Response model for a file uploaded to the container.
class BetaContainerUploadBlockParam: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.
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.
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaContentBlock: unionResponse model for a file uploaded to the container.
Response model for a file uploaded to the container.
class BetaContentBlockParam: unionRegular text content.
Regular text content.
class BetaContentBlockSource:
Content content
class BetaTextBlockParam:
class BetaImageBlockParam:
class BetaContentBlockSourceContent: union
class BetaTextBlockParam:
class BetaImageBlockParam:
class BetaContextManagementConfig:
class BetaContextManagementResponse:
List<AppliedEdit> appliedEditsList of context management edits that were applied.
List of context management edits that were applied.
class BetaClearToolUses20250919EditResponse:
long clearedInputTokensNumber of input tokens cleared by this edit.
Number of input tokens cleared by this edit.
long clearedToolUsesNumber of tool uses that were cleared.
Number of tool uses that were cleared.
The type of context management edit applied.
class BetaClearThinking20251015EditResponse:
long clearedInputTokensNumber of input tokens cleared by this edit.
Number of input tokens cleared by this edit.
long clearedThinkingTurnsNumber of thinking turns that were cleared.
Number of thinking turns that were cleared.
The type of context management edit applied.
class BetaCountTokensContextManagementResponse:
The original token count before context management was applied
class BetaDiagnostics:Response envelope for request-level diagnostics. Present (possibly
null) whenever the caller supplied diagnostics on the request.
Response envelope for request-level diagnostics. Present (possibly
null) whenever the caller supplied diagnostics on the request.
class BetaDiagnosticsParam:Request-level diagnostics. Currently carries the previous response
id for prompt-cache divergence reporting.
Request-level diagnostics. Currently carries the previous response id for prompt-cache divergence reporting.
Optional<String> previousMessageIdThe id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.
The id (msg_...) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns diagnostics.cache_miss_reason when the prompt-cache prefix could not be reused. Pass null on the first turn to opt in without a prior message to compare.
class BetaDirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class BetaDocumentBlock:
Optional<BetaCitationConfig> citationsCitation configuration for the document
Citation configuration for the document
Source source
class BetaBase64PdfSource:
String data
class BetaPlainTextSource:
The title of the document
class BetaEncryptedCodeExecutionResultBlock:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
List<BetaCodeExecutionOutputBlock> content
class BetaEncryptedCodeExecutionResultBlockParam:Code execution result with encrypted stdout for PFC + web_search results.
Code execution result with encrypted stdout for PFC + web_search results.
List<BetaCodeExecutionOutputBlockParam> content
class BetaFallbackBlock:Marks the point in content where one model's output gives way to the next.
Marks the point in content where one model's output gives way to the next.
One block appears per hop where a preceding model actually ran this turn and
declined. A turn where no preceding model ran and declined has no such
boundary and carries no block — the signal for whether a fallback model
served the response is the presence of a fallback_message entry in
usage.iterations, not this block.
The block is treated like a server-tool content block for streaming: it
arrives via the standard content_block_start / content_block_stop
pair and carries no deltas.
class BetaFallbackBlockParam:A fallback block echoed back from a prior response.
A fallback block echoed back from a prior response.
Accepted in messages[].content and not rendered into the prompt; not
validated against the request's fallbacks chain or top-level model.
Echo the assistant turn back verbatim, including this block in its original position. The block marks the boundary between content produced before and after a fallback hop, and the server relies on that boundary to validate the turn: when thinking runs flank the boundary, omitting the block merges them into one span the server cannot validate (the request is rejected), and moving it into the middle of a single run is likewise rejected; between non-thinking blocks the block's placement has no validation effect.
Identifies one hop of a fallback transition.
Identifies one hop of a fallback transition.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
Identifies one hop of a fallback transition.
Identifies one hop of a fallback transition.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
The response block's trigger, echoed verbatim. Accepted and ignored by the server; any object or null is allowed.
class BetaFallbackCreditNotApplied:No reprice was applied; reason says why.
No reprice was applied; reason says why.
Reason reasonWhy the reprice was not applied.
Why the reprice was not applied.
A closed enum; additions to the redemption-check vocabulary arrive as deliberate schema updates.
Optional<List<String>> removeToRedeemRequest fields to remove before retrying, so the retry can redeem this
token.
Request fields to remove before retrying, so the retry can redeem this token.
Present exactly when reason is variant_fields_present — never null,
never an empty array; absent otherwise. Fields are named only from your own request, and only after
the sealed variant hash matched. A served best-effort retry has already
been billed at normal price; nothing redeems retroactively, but a corrected
re-send inside the token's five-minute window can still redeem.
class BetaFallbackCreditRedeemed:The reprice was applied: the retry is billed as if the conversation
had been on the retry model all along.
The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.
class BetaFallbackCreditTokenParam:Object form of fallback_credit_token: the token plus a redemption
mode.
Object form of fallback_credit_token: the token plus a redemption
mode.
Requires anthropic-beta: fallback-credit-2026-07-01; without that
header the field accepts the bare string only. The bare string and the
mode-less object are equivalent (both select strict), so wrapping
an existing token changes nothing by itself.
String tokenThe opaque fallback_credit_token from a prior refusal's stop_details — the same string the bare-string form carries.
The opaque fallback_credit_token from a prior refusal's stop_details — the same string the bare-string form carries.
Optional<Mode> modeHow a failing token affects the retry. strict (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. best_effort: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's usage.fallback_credit. Two failures stay hard in both modes: a malformed token, and combining fallback_credit_token with fallbacks.
How a failing token affects the retry. strict (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. best_effort: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's usage.fallback_credit. Two failures stay hard in both modes: a malformed token, and combining fallback_credit_token with fallbacks.
class BetaFallbackCreditUsage:Outcome of the fallback_credit_token presented on this request.
Outcome of the fallback_credit_token presented on this request.
class BetaFallbackInfo:Identifies one hop of a fallback transition.
Identifies one hop of a fallback transition.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
class BetaFallbackInfoParam:Identifies one hop of a fallback transition.
Identifies one hop of a fallback transition.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
class BetaFallbackMessageIterationUsage:Token usage for the fallback-model attempt of a server-side fallback request.
Token usage for the fallback-model attempt of a server-side fallback request.
Produced in place of a message entry for whichever hop served the
response. A declined hop produces the existing message entry. Whether
a fallback model served the response is signalled by the presence of this
entry in usage.iterations.
Optional<BetaCacheCreation> cacheCreationBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
long ephemeral1hInputTokensThe number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
long ephemeral5mInputTokensThe number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
long cacheCreationInputTokensThe number of input tokens used to create the cache entry.
The number of input tokens used to create the cache entry.
long cacheReadInputTokensThe number of input tokens read from the cache.
The number of input tokens read from the cache.
long inputTokensThe number of input tokens which were used.
The number of input tokens which were used.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
long outputTokensThe number of output tokens which were used.
The number of output tokens which were used.
Usage for the fallback-model attempt that served the response
class BetaFallbackParam:One entry in the fallbacks chain on a /v1/messages request.
One entry in the fallbacks chain on a /v1/messages request.
model is required. The override fields (max_tokens, thinking,
output_config, and speed) set the corresponding parameter for this
attempt only and are validated as if the request were made to model.
Any other key is rejected at parse time.
class BetaFallbackRefusalTrigger:The from model declined for policy reasons.
The from model declined for policy reasons.
Optional<Category> categoryThe policy category that triggered a refusal.
The policy category that triggered a refusal.
The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.
The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.
The request could assist the development of competing AI models, which is restricted under Anthropic's commercial terms. Benign machine learning work can also trigger this category.
The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use adaptive thinking.
The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.
class BetaFallbacksParam: unionOpt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. The string "default" requests the requested model's server-defined default fallback configuration.
Opt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. The string "default" requests the requested model's server-defined default fallback configuration.
class BetaFileDocumentSource:
class BetaFileImageSource:
class BetaImageBlockParam:
class BetaImageTransformationsParam:Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
Configures the transformations the server applies to this image before the model observes it. Each key names a condition the server transforms images for; its value selects the transformation applied. Omitted keys keep their default behavior, and an empty object is equivalent to omitting the field.
Optional<OversizedImage> oversizedImageWhat the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
What the server does when this image exceeds the model's maximum image size. "downsize" (the default) scales the image down to fit, which changes the dimensions the model observes without telling you. "error" instead rejects the request with a 400 error naming the image's dimensions and the largest dimensions that fit, so you can scale the image deliberately — your image is never silently scaled down.
class BetaInputJsonDelta:
class BetaInputTokensClearAtLeast:
long value
class BetaInputTokensTrigger:
long value
class BetaJsonOutputFormat:
The JSON schema of the format
class BetaMcpToolConfig:Configuration for a specific tool in an MCP toolset.
Configuration for a specific tool in an MCP toolset.
class BetaMcpToolDefaultConfig:Default configuration for tools in an MCP toolset.
Default configuration for tools in an MCP toolset.
class BetaMcpToolResultBlock:
class BetaMcpToolUseBlock:
String id
The name of the MCP tool
The name of the MCP server
class BetaMcpToolUseBlockParam:
String id
The name of the MCP server
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaMcpToolset:Configuration for a group of tools from an MCP server.
Configuration for a group of tools from an MCP server.
Allows configuring enabled status and defer_loading for all tools from an MCP server, with optional per-tool overrides.
class BetaMemoryTool20250818:
class BetaMemoryTool20250818Command: union
class BetaMemoryTool20250818CreateCommand:
Command type identifier
Content to write to the file
Path where the file should be created
class BetaMemoryTool20250818DeleteCommand:
Command type identifier
Path to the file or directory to delete
class BetaMemoryTool20250818InsertCommand:
Command type identifier
long insertLineLine number where text should be inserted
Line number where text should be inserted
Text to insert at the specified line
Path to the file where text should be inserted
class BetaMemoryTool20250818RenameCommand:
Command type identifier
New path for the file or directory
Current path of the file or directory
class BetaMemoryTool20250818StrReplaceCommand:
Command type identifier
Text to replace with
Text to search for and replace
Path to the file where text should be replaced
class BetaMemoryTool20250818ViewCommand:
Command type identifier
Path to directory or file to view
Optional<List<Long>> viewRangeOptional line range for viewing specific lines
Optional line range for viewing specific lines
class BetaMessage:
class BetaMessageDeltaUsage:
class BetaMessageIterationUsage:Token usage for a sampling iteration.
Token usage for a sampling iteration.
Optional<BetaCacheCreation> cacheCreationBreakdown of cached tokens by TTL
Breakdown of cached tokens by TTL
long ephemeral1hInputTokensThe number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 1 hour cache entry.
long ephemeral5mInputTokensThe number of input tokens used to create the 5 minute cache entry.
The number of input tokens used to create the 5 minute cache entry.
long cacheCreationInputTokensThe number of input tokens used to create the cache entry.
The number of input tokens used to create the cache entry.
long cacheReadInputTokensThe number of input tokens read from the cache.
The number of input tokens read from the cache.
long inputTokensThe number of input tokens which were used.
The number of input tokens which were used.
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
long outputTokensThe number of output tokens which were used.
The number of output tokens which were used.
Usage for a sampling iteration
class BetaMessageParam:
class BetaMessageTokensCount:
Optional<BetaCountTokensContextManagementResponse> contextManagementInformation about context management applied to the message.
Information about context management applied to the message.
The original token count before context management was applied
The total number of tokens across the provided list of messages, system prompt, and tools.
class BetaMetadata:
Optional<String> userIdAn external identifier for the user who is associated with the request.
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.
class BetaOutputConfig:
Optional<Effort> effortAll possible effort levels.
All possible effort levels.
Optional<BetaJsonOutputFormat> formatA schema to specify Claude's output format in responses. See structured outputs
A schema to specify Claude's output format in responses. See structured outputs
The JSON schema of the format
Optional<BetaTokenTaskBudget> taskBudgetUser-configurable total token budget across contexts.
User-configurable total token budget across contexts.
long totalTotal token budget across all contexts in the session.
Total token budget across all contexts in the session.
The budget type. Currently only 'tokens' is supported.
Optional<Long> remainingRemaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
class BetaOutputTokensDetails:
long thinkingTokensNumber of output tokens the model generated as internal reasoning, including
the thinking-block delimiter tokens.
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.
class BetaPlainTextSource:
class BetaRawContentBlockDelta: union
class BetaRawContentBlockDeltaEvent:
BetaRawContentBlockDelta delta
class BetaRawContentBlockStartEvent:
class BetaRawContentBlockStopEvent:
class BetaRawMessageDeltaEvent:
class BetaRawMessageStartEvent:
BetaMessage message
class BetaRawMessageStopEvent:
class BetaRawMessageStreamEvent: union
class BetaRawMessageStartEvent:
BetaMessage message
class BetaRawMessageDeltaEvent:
class BetaRawMessageStopEvent:
class BetaRawContentBlockStartEvent:
class BetaRawContentBlockDeltaEvent:
BetaRawContentBlockDelta delta
class BetaRawContentBlockStopEvent:
class BetaRedactedThinkingBlock:
String dataThe 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.
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.
class BetaRedactedThinkingBlockParam:
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.
class BetaRefusalStopDetails:Structured information about a refusal.
Structured information about a refusal.
class BetaRequestDocumentBlock:
class BetaRequestMcpServerToolConfiguration:
class BetaRequestMcpServerUrlDefinition:
Optional<BetaRequestMcpServerToolConfiguration> toolConfiguration
class BetaRequestMcpToolResultBlockParam:
class BetaRequestToolAdditionBlock:Mid-conversation directive to surface a declared tool.
Mid-conversation directive to surface a declared tool.
tool references a tool (or MCP toolset) by name from the request's
tools; it is offered to the model from this point in the
conversation onward.
class BetaRequestToolRemovalBlock:Mid-conversation directive to withdraw a tool.
Mid-conversation directive to withdraw a tool.
tool references a tool (or MCP toolset) by name from the request's
tools; it is no longer offered to the model from this point in the
conversation onward.
class BetaSearchResultBlockParam:
class BetaServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
String toolId
class BetaServerToolCaller20260120:
String toolId
class BetaServerToolUsage:
long webFetchRequestsThe number of web fetch tool requests.
The number of web fetch tool requests.
long webSearchRequestsThe number of web search tool requests.
The number of web search tool requests.
class BetaServerToolUseBlock:
class BetaServerToolUseBlockParam:
class BetaSignatureDelta:
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.
class BetaSkillParams:Specification for a skill to be loaded in a container (request model).
Specification for a skill to be loaded in a container (request model).
String skillIdSkill ID
Skill ID
Type typeType of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Optional<String> versionSkill version or 'latest' for most recent version
Skill version or 'latest' for most recent version
enum BetaStopReason:
class BetaSystemMessageOutputConfig:Per-message output configuration on a role:"system" input message.
Per-message output configuration on a role:"system" input message.
Fields here apply per-turn; format remains top-level only. An
empty {} is accepted on a message that carries content; a message
with neither content nor output_config fields is rejected.
Optional<Effort> effortAll possible effort levels.
All possible effort levels.
class BetaTextBlock:
class BetaTextBlockParam:
class BetaTextCitation: union
class BetaTextCitationParam: union
class BetaTextDelta:
class BetaTextEditorCodeExecutionCreateResultBlock:
class BetaTextEditorCodeExecutionCreateResultBlockParam:
class BetaTextEditorCodeExecutionStrReplaceResultBlock:
class BetaTextEditorCodeExecutionStrReplaceResultBlockParam:
class BetaTextEditorCodeExecutionToolResultBlock:
class BetaTextEditorCodeExecutionToolResultBlockParam:
class BetaTextEditorCodeExecutionToolResultError:
ErrorCode errorCode
class BetaTextEditorCodeExecutionToolResultErrorParam:
ErrorCode errorCode
class BetaTextEditorCodeExecutionViewResultBlock:
FileType fileType
class BetaTextEditorCodeExecutionViewResultBlockParam:
FileType fileType
class BetaThinkingBlock:
String signatureA value used to verify that this thinking block was generated by Claude when it is passed back to the API.
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.
The text of Claude's thinking process for this block.
class BetaThinkingBlockBinding:Controls for block binding: what happens when a thinking block this
request sends back fails the conversation check. Every field is optional;
an empty object means every default.
Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. Every field is optional; an empty object means every default.
Optional<BetaThinkingPrefixMismatchBehavior> prefixMismatchBehaviorWhat happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
What happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
class BetaThinkingBlockParam:
String signatureThe 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.
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.
The thinking text of this block as returned by the API.
class BetaThinkingConfigAdaptive:
Optional<BetaThinkingBlockBinding> blockBindingControls for block binding: what happens when a thinking block this
request sends back fails the conversation check. Every field is optional;
an empty object means every default.
Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. Every field is optional; an empty object means every default.
Optional<BetaThinkingPrefixMismatchBehavior> prefixMismatchBehaviorWhat happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
What happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
Optional<Display> displayControls 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.
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.
class BetaThinkingConfigDisabled:
class BetaThinkingConfigEnabled:
long budgetTokensDetermines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.
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.
Optional<BetaThinkingBlockBinding> blockBindingControls for block binding: what happens when a thinking block this
request sends back fails the conversation check. Every field is optional;
an empty object means every default.
Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. Every field is optional; an empty object means every default.
Optional<BetaThinkingPrefixMismatchBehavior> prefixMismatchBehaviorWhat happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
What happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
Optional<Display> displayControls 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.
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.
class BetaThinkingConfigParam: unionConfiguration for enabling Claude's extended thinking.
Configuration for enabling Claude's extended thinking.
When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your max_tokens limit.
See extended thinking for details.
class BetaThinkingDelta:
Per-frame increment of a coarse, running estimate of the tokens this thinking block has produced so far. Present whenever the thinking-token-count-2026-05-13 beta is set; null unless thinking.display resolves to "omitted" and a count is due this frame. Sum the increments across thinking_delta frames on this block for a progress indicator. Each increment is a non-negative multiple of a fixed quantum and the cadence is rate-limited, so this is a deliberately lossy display hint, not a billable count; usage.output_tokens remains authoritative.
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.
class BetaThinkingDroppedInputTransformation:
Where the removed block was in your request, as messages.{i}.content.{j}:
i indexes the messages array you sent and j that message's content
array — the same form error messages use.
Reason reasonWhich binding check removed the block: model_binding_mismatch — it was
created by a model whose reasoning the requested model may not read;
prefix_binding_mismatch — the conversation before it differs from the
conversation it was created in (the rest of that turn's consecutive thinking
blocks are removed with it, each with this reason);
organization_binding_mismatch — it was created under a different
organization (an Anthropic organization, AWS account or Google Cloud project)
and this organization is not one of its additional organizations;
end_user_binding_mismatch — it was created for a different end user, or
was removed by the consumer-organization binding. A block that would fail
several checks reports one reason, in this order of precedence:
organization_binding_mismatch, end_user_binding_mismatch,
model_binding_mismatch, prefix_binding_mismatch.
Which binding check removed the block: model_binding_mismatch — it was
created by a model whose reasoning the requested model may not read;
prefix_binding_mismatch — the conversation before it differs from the
conversation it was created in (the rest of that turn's consecutive thinking
blocks are removed with it, each with this reason);
organization_binding_mismatch — it was created under a different
organization (an Anthropic organization, AWS account or Google Cloud project)
and this organization is not one of its additional organizations;
end_user_binding_mismatch — it was created for a different end user, or
was removed by the consumer-organization binding. A block that would fail
several checks reports one reason, in this order of precedence:
organization_binding_mismatch, end_user_binding_mismatch,
model_binding_mismatch, prefix_binding_mismatch.
Always thinking_dropped for this entry type.
enum BetaThinkingPrefixMismatchBehavior:What happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
What happens when a thinking block in messages fails the conversation
check: it was created in a different conversation, or the messages before
it have changed since. "error" (the default) fails the request with a
400 error. "drop_block" removes the failing blocks and the request
proceeds; the model no longer sees the dropped reasoning.
class BetaThinkingTurns:
long value
class BetaTokenTaskBudget:User-configurable total token budget across contexts.
User-configurable total token budget across contexts.
long totalTotal token budget across all contexts in the session.
Total token budget across all contexts in the session.
The budget type. Currently only 'tokens' is supported.
Optional<Long> remainingRemaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.
class BetaTool:
class BetaToolBash20241022:
class BetaToolBash20250124:
class BetaToolChangeMcpToolReference:Reference to a single MCP tool by its server and remote name — the
same server_name/name pair mcp_tool_use carries.
Reference to a single MCP tool by its server and remote name — the
same server_name/name pair mcp_tool_use carries.
class BetaToolChangeMcpToolsetReference:Reference to every tool in the named MCP server's toolset.
Reference to every tool in the named MCP server's toolset.
class BetaToolChangeToolReference:Reference to a single tool the caller declared directly in
tools[]. Does not accept the composed {server}_{name} form the
server assigns to MCP-resolved tools — use mcp_tool_reference or
mcp_toolset_reference for those.
Reference to a single tool the caller declared directly in
tools[]. Does not accept the composed {server}_{name} form the
server assigns to MCP-resolved tools — use mcp_tool_reference or
mcp_toolset_reference for those.
String name
class BetaToolChoice: unionHow the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
class BetaToolChoiceAuto:The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
Optional<Boolean> disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output at most one tool use.
class BetaToolChoiceAny:The model will use any available tools.
The model will use any available tools.
Optional<Boolean> disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
class BetaToolChoiceTool:The model will use the specified tool with tool_choice.name.
The model will use the specified tool with tool_choice.name.
The name of the tool to use.
Optional<Boolean> disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
class BetaToolChoiceNone:The model will not be allowed to use tools.
The model will not be allowed to use tools.
class BetaToolChoiceAny:The model will use any available tools.
The model will use any available tools.
Optional<Boolean> disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
class BetaToolChoiceAuto:The model will automatically decide whether to use tools.
The model will automatically decide whether to use tools.
Optional<Boolean> disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output at most one tool use.
class BetaToolChoiceNone:The model will not be allowed to use tools.
The model will not be allowed to use tools.
class BetaToolChoiceTool:The model will use the specified tool with tool_choice.name.
The model will use the specified tool with tool_choice.name.
The name of the tool to use.
Optional<Boolean> disableParallelToolUseWhether to disable parallel tool use.
Whether to disable parallel tool use.
Defaults to false. If set to true, the model will output exactly one tool use.
class BetaToolComputerUse20241022:
class BetaToolComputerUse20250124:
class BetaToolComputerUse20251124:
class BetaToolReferenceBlock:
String toolName
class BetaToolReferenceBlockParam:Tool reference block that can be included in tool_result content.
Tool reference block that can be included in tool_result content.
String toolName
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaToolResultBlockParam:
class BetaToolSearchToolBm25_20251119:
class BetaToolSearchToolRegex20251119:
class BetaToolSearchToolResultBlock:
class BetaToolSearchToolResultBlockParam:
class BetaToolSearchToolResultError:
ErrorCode errorCode
class BetaToolSearchToolResultErrorParam:
ErrorCode errorCode
class BetaToolSearchToolSearchResultBlock:
List<BetaToolReferenceBlock> toolReferences
String toolName
class BetaToolSearchToolSearchResultBlockParam:
List<BetaToolReferenceBlockParam> toolReferences
String toolName
Optional<BetaCacheControlEphemeral> cacheControlCreate a cache control breakpoint at this content block.
Create a cache control breakpoint at this content block.
Optional<Ttl> ttlThe time-to-live for the cache control breakpoint.
The time-to-live for the cache control breakpoint.
This may be one the following values:
5m: 5 minutes1h: 1 hour
Defaults to 5m. See prompt caching pricing for details.
class BetaToolTextEditor20241022:
class BetaToolTextEditor20250124:
class BetaToolTextEditor20250429:
class BetaToolTextEditor20250728:
class BetaToolUnion: unionCode execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
class BetaToolUseBlock:
String id
String name
Optional<Caller> callerTool invocation directly from the model.
Tool invocation directly from the model.
class BetaDirectCaller:Tool invocation directly from the model.
Tool invocation directly from the model.
class BetaServerToolCaller:Tool invocation generated by a server-side tool.
Tool invocation generated by a server-side tool.
String toolId
class BetaServerToolCaller20260120:
String toolId
Optional<String> toolsetNameFor a toolset member tool_use, the toolset family.
For a toolset member tool_use, the toolset family.
class BetaToolUseBlockParam:
class BetaToolUsesKeep:
long value
class BetaToolUsesTrigger:
long value
class BetaUrlImageSource:
class BetaUrlPdfSource:
class BetaUsage:
class BetaUserLocation:
Optional<String> cityThe city of the user.
The city of the user.
Optional<String> countryThe two letter ISO country code of the user.
The two letter ISO country code of the user.
Optional<String> regionThe region of the user.
The region of the user.
Optional<String> timezoneThe IANA timezone of the user.
The IANA timezone of the user.
class BetaWebFetchBlock:
class BetaWebFetchBlockParam:
BetaRequestDocumentBlock content
Fetched content URL
ISO 8601 timestamp when the content was retrieved
class BetaWebFetchTool20250910:
class BetaWebFetchTool20260209:
class BetaWebFetchTool20260309:Web fetch tool with use_cache parameter for bypassing cached content.
Web fetch tool with use_cache parameter for bypassing cached content.