Mensagens
Criar uma mensagem
$client->beta->messages->create(int maxTokens, list<BetaMessageParam> messages, Model model, ?BetaCacheControlEphemeral cacheControl, ?BetaCompactionConfig compaction, ?Container container, ?BetaContextManagementConfig contextManagement, ?BetaDiagnosticsParam diagnostics, ?FallbackCreditToken fallbackCreditToken, ?BetaFallbacksParam fallbacks, ?string inferenceGeo, ?list<BetaRequestMCPServerURLDefinition> mcpServers, ?BetaMetadata metadata, ?BetaOutputConfig outputConfig, ?BetaJSONOutputFormat outputFormat, ?ServiceTier serviceTier, ?Speed speed, ?list<string> stopSequences, ?System system, ?float temperature, ?BetaThinkingConfigParam thinking, ?BetaToolChoice toolChoice, ?list<BetaToolUnion> tools, ?int topK, ?float topP, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): BetaMessageEnvie uma lista estruturada de mensagens de entrada com conteúdo de texto e/ou imagem, e o modelo gerará a próxima mensagem na conversa.
Contar tokens em uma mensagem
$client->beta->messages->countTokens(list<BetaMessageParam> messages, Model model, ?BetaCacheControlEphemeral cacheControl, ?BetaCompactionConfig compaction, ?BetaContextManagementConfig contextManagement, ?list<BetaRequestMCPServerURLDefinition> mcpServers, ?BetaOutputConfig outputConfig, ?BetaJSONOutputFormat outputFormat, ?Speed speed, ?System system, ?BetaThinkingConfigParam thinking, ?BetaToolChoice toolChoice, ?list<Tool> tools, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): BetaMessageTokensCountConte o número de tokens em uma mensagem.
Models
class BetaAdvisorMessageIterationUsage { $type = 'advisor_message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
Usage for an advisor sub-inference iteration
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
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.
The number of output tokens which were used.
class BetaAdvisorRedactedResultBlock { $type = 'advisor_redacted_result'; $encryptedContent; $stopReason; }
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 { $type = 'advisor_redacted_result'; $encryptedContent; $stopReason; }
Opaque blob produced by a prior response; must be round-tripped verbatim.
class BetaAdvisorResultBlock { $type = 'advisor_result'; $stopReason; $text; }
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 { $type = 'advisor_result'; $text; $stopReason; }
class BetaAdvisorTool20260301 { $type = 'advisor_20260301'; $model; $name; /* 7 more */ }
class BetaAdvisorToolResultBlock { $type = 'advisor_tool_result'; $content; $toolUseID; }
class BetaAdvisorToolResultBlockParam { $type = 'advisor_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaAdvisorToolResultError { $type = 'advisor_tool_result_error'; $errorCode; }
class BetaAdvisorToolResultErrorParam { $type = 'advisor_tool_result_error'; $errorCode; }
class BetaAllThinkingTurns { $type = 'all'; }
class BetaBase64ImageSource { $type = 'base64'; $data; $mediaType; }
class BetaBase64PDFSource { $type = 'base64'; $data; $mediaType; }
class BetaBashCodeExecutionOutputBlock { $type = 'bash_code_execution_output'; $fileID; }
class BetaBashCodeExecutionOutputBlockParam { $type = 'bash_code_execution_output'; $fileID; }
class BetaBashCodeExecutionResultBlock { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaBashCodeExecutionResultBlockParam { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaBashCodeExecutionToolResultBlock { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; }
class BetaBashCodeExecutionToolResultBlockParam { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaBashCodeExecutionToolResultError { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
class BetaBashCodeExecutionToolResultErrorParam { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
class BetaBrowserCloseTabConfig { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $type = 'browser_state'; $tabs; $cacheControl; $stateChanges; }
All tabs open in the browser after this call — the full inventory, not a delta. May be empty. Whenever non-empty, exactly one entry carries active: true.
Create a cache control breakpoint at this content block.
Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
class BetaBrowserStateChange
class BetaBrowserStateChangeDownloadCompleted { $type = 'download_completed'; $downloadID; $url; /* 2 more */ }
The caller-assigned identifier for this download, stable across the state changes reporting it.
The final post-redirect URL the download was served from.
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.
The completed download's size.
class BetaBrowserStateChangeDownloadFailed { $type = 'download_failed'; $downloadID; $url; $error; }
The caller-assigned identifier for this download, stable across the state changes reporting it.
The final post-redirect URL the download was served from.
The failure or cancellation detail, when known.
class BetaBrowserStateChangeDownloadStarted { $type = 'download_started'; $downloadID; $url; }
The caller-assigned identifier for this download, stable across the state changes reporting it.
The final post-redirect URL the download was served from.
class BetaBrowserStateChangeTabOpened { $type = 'tab_opened'; $tabID; }
The tab_id of the opened tab, present in tabs.
class BetaBrowserStateTabEntry { $tabID; $title; $url; $active; }
The caller-assigned identifier for this tab, unique within the inventory.
The title 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 { $deferLoading; $enabled; }
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 { $type = 'browser_toolset_20260801'; $cacheControl; $configs; }
Create a cache control breakpoint at this content block.
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 { $type; $closeTab; $doubleClick; /* 28 more */ }
class BetaBrowserTripleClickConfig { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $type = 'ephemeral'; $ttl; }
?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 { $ephemeral1hInputTokens; $ephemeral5mInputTokens; }
The number of input tokens used to create the 1 hour cache entry.
The number of input tokens used to create the 5 minute cache entry.
class BetaCacheMissMessagesChanged { $type = 'messages_changed'; $cacheMissedInputTokens; }
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissModelChanged { $type = 'model_changed'; $cacheMissedInputTokens; }
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissPreviousMessageNotFound { $type = 'previous_message_not_found'; }
class BetaCacheMissSystemChanged { $type = 'system_changed'; $cacheMissedInputTokens; }
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissToolsChanged { $type = 'tools_changed'; $cacheMissedInputTokens; }
Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.
class BetaCacheMissUnavailable { $type = 'unavailable'; }
class BetaCitationCharLocation { $type = 'char_location'; $citedText; $documentIndex; /* 4 more */ }
class BetaCitationCharLocationParam { $type = 'char_location'; $citedText; $documentIndex; /* 3 more */ }
class BetaCitationConfig { $enabled; }
class BetaCitationContentBlockLocation { $type = 'content_block_location'; $citedText; $documentIndex; /* 4 more */ }
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.
int 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.
0-based index of the first cited block in the source's content array.
class BetaCitationContentBlockLocationParam { $type = 'content_block_location'; $citedText; $documentIndex; /* 3 more */ }
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.
int 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.
0-based index of the first cited block in the source's content array.
class BetaCitationPageLocation { $type = 'page_location'; $citedText; $documentIndex; /* 4 more */ }
class BetaCitationPageLocationParam { $type = 'page_location'; $citedText; $documentIndex; /* 3 more */ }
class BetaCitationSearchResultLocation { $type = 'search_result_location'; $citedText; $endBlockIndex; /* 4 more */ }
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.
int 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.
int 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.
0-based index of the first cited block in the source's content array.
class BetaCitationSearchResultLocationParam { $type = 'search_result_location'; $citedText; $endBlockIndex; /* 4 more */ }
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.
int 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.
int 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.
0-based index of the first cited block in the source's content array.
class BetaCitationWebSearchResultLocationParam { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
class BetaCitationsConfigParam { $enabled; }
class BetaCitationsDelta { $type = 'citations_delta'; $citation; }
class BetaCitationsWebSearchResultLocation { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
class BetaClearThinking20251015Edit { $type = 'clear_thinking_20251015'; $keep; }
Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.
class BetaClearThinking20251015EditResponse { $type = 'clear_thinking_20251015'; $clearedInputTokens; $clearedThinkingTurns; }
The type of context management edit applied.
Number of input tokens cleared by this edit.
Number of thinking turns that were cleared.
class BetaClearToolUses20250919Edit { $type = 'clear_tool_uses_20250919'; $clearAtLeast; $clearToolInputs; /* 3 more */ }
Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.
Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
Tool names whose uses are preserved from clearing
Number of tool uses to retain in the conversation
Condition that triggers the context management strategy
class BetaClearToolUses20250919EditResponse { $type = 'clear_tool_uses_20250919'; $clearedInputTokens; $clearedToolUses; }
The type of context management edit applied.
Number of input tokens cleared by this edit.
Number of tool uses that were cleared.
class BetaCodeExecutionOutputBlock { $type = 'code_execution_output'; $fileID; }
class BetaCodeExecutionOutputBlockParam { $type = 'code_execution_output'; $fileID; }
class BetaCodeExecutionResultBlock { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaCodeExecutionResultBlockParam { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
class BetaCodeExecutionTool20250522 { $type = 'code_execution_20250522'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionTool20250825 { $type = 'code_execution_20250825'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionTool20260120 { $type = 'code_execution_20260120'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionTool20260521 { $type = 'code_execution_20260521'; $name; $allowedCallers; /* 3 more */ }
"code_execution" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaCodeExecutionToolResultBlock { $type = 'code_execution_tool_result'; $content; $toolUseID; }
class BetaCodeExecutionToolResultBlockParam { $type = 'code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaCodeExecutionToolResultError { $type = 'code_execution_tool_result_error'; $errorCode; }
class BetaCodeExecutionToolResultErrorParam { $type = 'code_execution_tool_result_error'; $errorCode; }
class BetaCompact20260112Edit { $type = 'compact_20260112'; $instructions; $pauseAfterCompaction; $trigger; }
Additional instructions for summarization.
Whether to pause after compaction and return the compaction block to the user.
When to trigger compaction. Defaults to 150000 input tokens.
class BetaCompactionBlock { $type = 'compaction'; $content; $encryptedContent; $signature; }
Summary of compacted content, or null if compaction failed
Opaque metadata from prior compaction, to be round-tripped verbatim
Signature over the summary, to be sent back with the block verbatim
class BetaCompactionBlockParam { $type = 'compaction'; $cacheControl; $content; /* 2 more */ }
Create a cache control breakpoint at this content block.
Summary of previously compacted content, or null if compaction failed
Opaque metadata from prior compaction, to be round-tripped verbatim
The block's signature as returned, to be sent back verbatim
class BetaCompactionConfig { $type = 'summarize'; $instructions; }
Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.
class BetaCompactionContentBlockDelta { $type = 'compaction_delta'; $content; $encryptedContent; }
Opaque metadata from prior compaction, to be round-tripped verbatim
class BetaCompactionIterationUsage { $type = 'compaction'; $cacheCreation; $cacheCreationInputTokens; /* 3 more */ }
Usage for a compaction iteration
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
The number of input tokens which were used.
The number of output tokens which were used.
class BetaComputerCursorPositionConfig { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $type = 'computer_toolset_20260801'; $cacheControl; $configs; }
Create a cache control breakpoint at this content block.
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 { $type; $cursorPosition; $doubleClick; /* 14 more */ }
class BetaComputerTripleClickConfig { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $deferLoading; $enabled; }
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 { $id; $expiresAt; $skills; }
Identifier for the container used in this request
The time at which the container will expire.
Skills loaded in the container
class BetaContainerParams { $id; $skills; }
Container id
List of skills to load in the container
class BetaContainerSkill { $type; $skillID; $version; }
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Skill ID
The resolved version: a skill version ID for custom skills.
class BetaContainerUploadBlock { $type = 'container_upload'; $fileID; }
class BetaContainerUploadBlockParam { $type = 'container_upload'; $fileID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaContentBlock
class BetaContentBlockParam
class BetaContentBlockSource { $type = 'content'; $content; }
class BetaContextManagementConfig { $edits; }
List of context management edits to apply
class BetaContextManagementResponse { $appliedEdits; }
List of context management edits that were applied.
class BetaCountTokensContextManagementResponse { $originalInputTokens; }
The original token count before context management was applied
class BetaDiagnostics { $cacheMissReason; }
Explains why the prompt cache could not fully reuse the prefix from the request identified by diagnostics.previous_message_id. null means diagnosis is still pending — the response was serialized before the background comparison completed.
class BetaDiagnosticsParam { $previousMessageID; }
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 { $type = 'direct'; }
class BetaDocumentBlock { $type = 'document'; $citations; $source; $title; }
Citation configuration for the document
The title of the document
class BetaEncryptedCodeExecutionResultBlock { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
class BetaEncryptedCodeExecutionResultBlockParam { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
class BetaFallbackBlock { $type = 'fallback'; $from; $to; $trigger; }
The model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its model echoes the top-level model string the caller sent (alias or canonical); when the declining hop is a fallback model, its model is that model's canonical id.
The fallback model producing the content that follows this block. Its model is always the canonical id.
What caused the from model to hand over at this hop.
class BetaFallbackBlockParam { $type = 'fallback'; $from; $to; $trigger; }
Identifies one hop of a fallback transition.
Identifies one hop of a fallback transition.
The response block's trigger, echoed verbatim. Accepted and ignored by the server; any object or null is allowed.
class BetaFallbackCreditNotApplied { $type = 'not_applied'; $reason; $removeToRedeem; }
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.
?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 { $type = 'redeemed'; }
class BetaFallbackCreditTokenParam { $token; $mode; }
The opaque fallback_credit_token from a prior refusal's stop_details — the same string the bare-string form carries.
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 { $status; }
Status statusWhether the fallback-credit reprice was applied to this response's billing.
Whether the fallback-credit reprice was applied to this response's billing.
A union discriminated on type. redeemed: the retry is billed as if
the conversation had been on the retry model all along — including when the
resulting shift is zero because there was nothing to move. not_applied:
no reprice was applied; the arm's reason says why.
class BetaFallbackInfo { $model; }
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
class BetaFallbackInfoParam { $model; }
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
class BetaFallbackMessageIterationUsage { $type = 'fallback_message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
Usage for the fallback-model attempt that served the response
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
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.
The number of output tokens which were used.
class BetaFallbackParam { $model; $maxTokens; $outputConfig; /* 2 more */ }
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
Inference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
class BetaFallbackRefusalTrigger { $type = 'refusal'; $category; }
The policy category that triggered a refusal.
class BetaFallbacksParam
class list<BetaFallbackParam> { $model; $maxTokens; $outputConfig; /* 2 more */ }
Model modelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
Inference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
class BetaFileDocumentSource { $type = 'file'; $fileID; }
class BetaFileImageSource { $type = 'file'; $fileID; }
class BetaImageBlockParam { $type = 'image'; $source; $cacheControl; $transformations; }
Create a cache control breakpoint at this content block.
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.
class BetaImageTransformationsParam { $oversizedImage; }
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 { $type = 'input_json_delta'; $partialJSON; }
class BetaInputTokensClearAtLeast { $type = 'input_tokens'; $value; }
class BetaInputTokensTrigger { $type = 'input_tokens'; $value; }
class BetaInputTransformation
list<BetaIterationsUsageItem>
class BetaJSONOutputFormat { $type = 'json_schema'; $schema; }
The JSON schema of the format
class BetaMCPToolConfig { $deferLoading; $enabled; }
class BetaMCPToolDefaultConfig { $deferLoading; $enabled; }
class BetaMCPToolResultBlock { $type = 'mcp_tool_result'; $content; $isError; $toolUseID; }
class BetaMCPToolUseBlock { $type = 'mcp_tool_use'; $id; $input; /* 2 more */ }
The name of the MCP tool
The name of the MCP server
class BetaMCPToolUseBlockParam { $type = 'mcp_tool_use'; $id; $input; /* 3 more */ }
The name of the MCP server
Create a cache control breakpoint at this content block.
class BetaMCPToolset { $type = 'mcp_toolset'; $mcpServerName; $cacheControl; /* 2 more */ }
Name of the MCP server to configure tools for
Create a cache control breakpoint at this content block.
Configuration overrides for specific tools, keyed by tool name
Default configuration applied to all tools from this server
class BetaMemoryTool20250818 { $type = 'memory_20250818'; $name; $allowedCallers; /* 4 more */ }
"memory" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaMemoryTool20250818CreateCommand { $command; $fileText; $path; }
Command type identifier
Content to write to the file
Path where the file should be created
class BetaMemoryTool20250818DeleteCommand { $command; $path; }
Command type identifier
Path to the file or directory to delete
class BetaMemoryTool20250818InsertCommand { $command; $insertLine; $insertText; $path; }
Command type identifier
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; $newPath; $oldPath; }
Command type identifier
New path for the file or directory
Current path of the file or directory
class BetaMemoryTool20250818StrReplaceCommand { $command; $newStr; $oldStr; $path; }
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; $path; $viewRange; }
Command type identifier
Path to directory or file to view
Optional line range for viewing specific lines
class BetaMessage { $type = 'message'; $id; $container; /* 10 more */ }
class BetaMessageDeltaUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $fallbackCredit; /* 5 more */ }
The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens read from the cache.
Outcome of the fallback_credit_token presented on this request.
The cumulative number of input tokens which were used.
?list<BetaIterationsUsageItem> iterationsPer-iteration token usage breakdown.
Per-iteration token usage breakdown.
Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by type. For message entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to:
- Determine which iterations exceeded long context thresholds (>=200k tokens)
- Calculate the context window size from the last
messageentry - Understand token accumulation across server-side tool use loops
A compaction entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a compaction entry, even when it is the last entry. A compaction entry's tokens are not included in the top-level usage fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each compaction entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results.
The cumulative number of output tokens which were used.
?BetaOutputTokensDetails outputTokensDetailsBreakdown of output tokens by category.
Breakdown of output tokens by category.
output_tokens remains the inclusive, authoritative total used for billing.
This object provides a read-only decomposition for observability — for example,
how many of the billed output tokens were spent on internal reasoning that may
have been summarized before being returned to you.
The number of server tool requests.
class BetaMessageIterationUsage { $type = 'message'; $cacheCreation; $cacheCreationInputTokens; /* 4 more */ }
Usage for a sampling iteration
Breakdown of cached tokens by TTL
The number of input tokens used to create the cache entry.
The number of input tokens read from the cache.
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.
The number of output tokens which were used.
class BetaMessageParam { $content; $role; $clearAt; $outputConfig; }
How long this system message's text stays in front of the model. "never" (the default) renders it on every request that includes it. "next_user_message" renders it only for the user turn it follows: once a later role: "user" message exists in messages the message stays in the array (send it unchanged) but is no longer shown to the model. Only permitted on role: "system" messages.
?BetaSystemMessageOutputConfig outputConfigPer-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.
class BetaMessageTokensCount { $contextManagement; $inputTokens; }
Information about context management applied to the message.
The total number of tokens across the provided list of messages, system prompt, and tools.
class BetaMetadata { $userID; }
?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 { $effort; $format; $taskBudget; }
All possible effort levels.
A schema to specify Claude's output format in responses. See structured outputs
User-configurable total token budget across contexts.
class BetaOutputTokensDetails { $thinkingTokens; }
int 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 { $type = 'text'; $data; $mediaType; }
class BetaRawContentBlockDelta
class BetaRawContentBlockDeltaEvent { $type = 'content_block_delta'; $delta; $index; }
class BetaRawContentBlockStartEvent { $type = 'content_block_start'; $contentBlock; $index; }
class BetaRawContentBlockStopEvent { $type = 'content_block_stop'; $index; }
class BetaRawMessageDeltaEvent { $type = 'message_delta'; $contextManagement; $delta; /* 2 more */ }
Information about context management strategies applied during the request
BetaMessageDeltaUsage usageBilling and rate-limit usage.
Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
?list<BetaInputTransformation> inputTransformationsChanges the API made to the request's input before showing it to the model,
and blocks that failed a binding check but were left unchanged: one entry per
block, in request order. Two entry types today. thinking_dropped — a
thinking, redacted_thinking or connector_text block from the request's
messages that was removed from the prompt instead of being shown to the
model because it failed a binding check. thinking_mismatch_allowed — a
thinking or redacted_thinking block that failed the conversation check
(the conversation before it differs from the one it was created in, or it
carries no record of one on a model that requires it) and was shown to the
model all the same, because that check is not enforced for this request.
More entry types may be added over time; ignore types you do not recognize.
Changes the API made to the request's input before showing it to the model,
and blocks that failed a binding check but were left unchanged: one entry per
block, in request order. Two entry types today. thinking_dropped — a
thinking, redacted_thinking or connector_text block from the request's
messages that was removed from the prompt instead of being shown to the
model because it failed a binding check. thinking_mismatch_allowed — a
thinking or redacted_thinking block that failed the conversation check
(the conversation before it differs from the one it was created in, or it
carries no record of one on a model that requires it) and was shown to the
model all the same, because that check is not enforced for this request.
More entry types may be added over time; ignore types you do not recognize.
Requires anthropic-beta: thinking-binding-controls-2026-08-01. Present on
every such response from a model that supports extended thinking, as []
when there is no entry to report; without the beta, blocks are removed or
left in place all the same but nothing is reported. Removed blocks contribute
nothing to usage.input_tokens; blocks left in place count as sent. When
streaming, the array is final in message_start; the final message_delta
event carries it only when a server-side model fallback happened mid-stream,
in which case it holds the serving model's entries and replaces the one in
message_start.
class BetaRawMessageStartEvent { $type = 'message_start'; $message; }
class BetaRawMessageStopEvent { $type = 'message_stop'; }
class BetaRedactedThinkingBlock { $type = 'redacted_thinking'; $data; }
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 { $type = 'redacted_thinking'; $data; }
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 { $type = 'refusal'; $category; $explanation; /* 3 more */ }
The policy category that triggered a refusal.
?string explanationHuman-readable explanation of the refusal.
Human-readable explanation of the refusal.
This text is not guaranteed to be stable. null when no explanation is available for the category.
?string fallbackCreditTokenOpaque code that refunds the cache-miss cost when retrying this refused
request on the fallback model. Pass it as fallback_credit_token on the
retry request. Expires 5 minutes after the refusal.
Opaque code that refunds the cache-miss cost when retrying this refused
request on the fallback model. Pass it as fallback_credit_token on the
retry request. Expires 5 minutes after the refusal.
The retry is sent either with the same request body (system, messages,
tools, and other render-shaping fields), or with the same body plus one
appended assistant message whose content is the partial text (with any
trailing whitespace stripped from the final text block) and paired
server-tool blocks from this refusal — which also authorizes that
appended turn as an assistant-prefill continuation on models that otherwise
disallow prefill. A token minted mid-server-tool-loop whose partial content
was continuable may only be redeemed the second way — if a same-body retry
is rejected with a 400 saying the token must be redeemed by continuing the
partial response, retry the second way instead. Either way: same workspace,
same platform; a mismatch is a 400. Resending a token for an already-warm
prefix is permitted but yields no additional credit.
null when the refused model isn't eligible for a fallback credit.
?bool fallbackHasPrefillClaimWhether the accompanying fallback_credit_token may be redeemed with the
appended-assistant retry form. Only set when fallback_credit_token is
present.
Whether the accompanying fallback_credit_token may be redeemed with the
appended-assistant retry form. Only set when fallback_credit_token is
present.
true: retry by resending the same request body plus one appended
assistant message whose content is this response's content with any
trailing whitespace stripped from the final text block and unpaired
tool_use blocks omitted (the same appended-turn shape described on
fallback_credit_token), with the token attached. false: retry by
resending the original request body unchanged, with the token attached —
the appended-assistant form is not available for this refusal (no
continuable partial content, or the request uses output_format or a
tool_choice that forces tool use). One exception: when the request used
output_format or a forced tool_choice and the refusal arrived after
server tools (including MCP connector tools) had already executed, the
token may not be redeemable by either retry form; if the exact-body retry
is then rejected with a 400 saying the token must be redeemed by
continuing the partial response, discard the token and retry without it.
Advisory: if an appended-assistant retry is rejected with a 400 despite
true, fall back to resending the original request body with the token.
The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.
class BetaRequestDocumentBlock { $type = 'document'; $source; $cacheControl; /* 3 more */ }
Create a cache control breakpoint at this content block.
class BetaRequestMCPServerToolConfiguration { $allowedTools; $enabled; }
class BetaRequestMCPServerURLDefinition { $type = 'url'; $name; $url; /* 2 more */ }
class BetaRequestMCPToolResultBlockParam { $type = 'mcp_tool_result'; $toolUseID; $cacheControl; /* 2 more */ }
Create a cache control breakpoint at this content block.
class BetaRequestToolAdditionBlock { $type = 'tool_addition'; $tool; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaRequestToolRemovalBlock { $type = 'tool_removal'; $tool; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaSearchResultBlockParam { $type = 'search_result'; $content; $source; /* 3 more */ }
Create a cache control breakpoint at this content block.
class BetaServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
class BetaServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
class BetaServerToolUsage { $webFetchRequests; $webSearchRequests; }
The number of web fetch tool requests.
The number of web search tool requests.
class BetaServerToolUseBlock { $type = 'server_tool_use'; $id; $input; /* 2 more */ }
class BetaServerToolUseBlockParam { $type = 'server_tool_use'; $id; $input; /* 3 more */ }
Create a cache control breakpoint at this content block.
class BetaSignatureDelta { $type = 'signature_delta'; $signature; }
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 { $type; $skillID; $version; }
Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
Skill ID
Skill version or 'latest' for most recent version
enum BetaStopReason
class BetaSummarizeCompaction { $type = 'summarize'; $instructions; }
Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.
class BetaSystemMessageOutputConfig { $effort; }
All possible effort levels.
class BetaTextBlock { $type = 'text'; $citations; $text; }
?list<BetaTextCitation> citationsCitations supporting the text block.
Citations supporting the text block.
The type of citation returned will depend on the type of document being cited. Citing a PDF results in page_location, plain text results in char_location, and content document results in content_block_location.
class BetaTextBlockParam { $type = 'text'; $text; $cacheControl; $citations; }
Create a cache control breakpoint at this content block.
class BetaTextCitation
class BetaTextCitationParam
class BetaTextDelta { $type = 'text_delta'; $text; }
class BetaTextEditorCodeExecutionCreateResultBlock { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
class BetaTextEditorCodeExecutionCreateResultBlockParam { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
class BetaTextEditorCodeExecutionStrReplaceResultBlock { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
class BetaTextEditorCodeExecutionStrReplaceResultBlockParam { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
class BetaTextEditorCodeExecutionToolResultBlock { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; }
class BetaTextEditorCodeExecutionToolResultBlockParam { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaTextEditorCodeExecutionToolResultError { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
class BetaTextEditorCodeExecutionToolResultErrorParam { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
class BetaTextEditorCodeExecutionViewResultBlock { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
class BetaTextEditorCodeExecutionViewResultBlockParam { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
class BetaThinkingBlock { $type = 'thinking'; $signature; $thinking; }
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 { $prefixMismatchBehavior; }
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 { $type = 'thinking'; $signature; $thinking; }
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 { $type = 'adaptive'; $blockBinding; $display; }
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 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 { $type = 'disabled'; }
class BetaThinkingConfigEnabled { $type = 'enabled'; $budgetTokens; $blockBinding; $display; }
int 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.
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 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
class BetaThinkingDelta { $type = 'thinking_delta'; $estimatedTokens; $thinking; }
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 { $type = 'thinking_dropped'; $path; $reason; }
Always thinking_dropped for this entry type.
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.
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.
class BetaThinkingMismatchAllowedInputTransformation { $type = 'thinking_mismatch_allowed'; $path; $reason; }
Always thinking_mismatch_allowed for this entry type.
Where the block is 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.
Which binding check the block failed; the block was shown to the model all
the same. Always prefix_binding_mismatch today — the conversation before
the block differs from the conversation it was created in, or the block
carries no record of one on a model that requires it. Were the check
enforced for this request, the block would have been removed or the request
rejected (thinking.block_binding.prefix_mismatch_behavior). A removal also
takes the rest of that turn's consecutive thinking blocks, whereas here each
block is checked on its own, so thinking_mismatch_allowed entries are a
lower bound on what enforcement would remove.
class BetaThinkingTurns { $type = 'thinking_turns'; $value; }
class BetaTokenTaskBudget { $type = 'tokens'; $total; $remaining; }
The budget type. Currently only 'tokens' is supported.
Total token budget across all contexts in the session.
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 { $type; $inputSchema; $name; /* 7 more */ }
InputSchema inputSchemaJSON schema for this tool's input.
JSON schema for this tool's input.
This defines the shape of the input that your tool accepts and that the model will produce.
string nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
?string descriptionDescription of what this tool does.
Description of what this tool does.
Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.
Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.
When true, guarantees schema validation on tool names and inputs
class BetaToolBash20241022 { $type = 'bash_20241022'; $name; $allowedCallers; /* 4 more */ }
"bash" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolBash20250124 { $type = 'bash_20250124'; $name; $allowedCallers; /* 4 more */ }
"bash" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolChangeMCPToolReference { $type = 'mcp_tool_reference'; $name; $serverName; }
class BetaToolChangeMCPToolsetReference { $type = 'mcp_toolset_reference'; $serverName; }
class BetaToolChangeToolReference { $type = 'tool_reference'; $name; }
class BetaToolChoice
class BetaToolChoiceAny { $type = 'any'; $disableParallelToolUse; }
?bool 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 { $type = 'auto'; $disableParallelToolUse; }
?bool 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 { $type = 'none'; }
class BetaToolChoiceTool { $type = 'tool'; $name; $disableParallelToolUse; }
The name of the tool to use.
?bool 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 { $type = 'computer_20241022'; $displayHeightPx; $displayWidthPx; /* 7 more */ }
The height of the display in pixels.
The width of the display in pixels.
"computer" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
The X11 display number (e.g. 0, 1) for the display.
When true, guarantees schema validation on tool names and inputs
class BetaToolComputerUse20250124 { $type = 'computer_20250124'; $displayHeightPx; $displayWidthPx; /* 7 more */ }
The height of the display in pixels.
The width of the display in pixels.
"computer" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
The X11 display number (e.g. 0, 1) for the display.
When true, guarantees schema validation on tool names and inputs
class BetaToolComputerUse20251124 { $type = 'computer_20251124'; $displayHeightPx; $displayWidthPx; /* 8 more */ }
The height of the display in pixels.
The width of the display in pixels.
"computer" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
The X11 display number (e.g. 0, 1) for the display.
Whether to enable an action to take a zoomed-in screenshot of the screen.
When true, guarantees schema validation on tool names and inputs
class BetaToolReferenceBlock { $type = 'tool_reference'; $toolName; }
class BetaToolReferenceBlockParam { $type = 'tool_reference'; $toolName; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaToolResultBlockParam { $type = 'tool_result'; $toolUseID; $cacheControl; /* 3 more */ }
Create a cache control breakpoint at this content block.
For a toolset member tool_result, the toolset family of the paired tool_use.
class BetaToolSearchToolBm25_20251119 { $type; $name; $allowedCallers; /* 3 more */ }
"tool_search_tool_bm25" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolSearchToolRegex20251119 { $type; $name; $allowedCallers; /* 3 more */ }
"tool_search_tool_regex" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolSearchToolResultBlock { $type = 'tool_search_tool_result'; $content; $toolUseID; }
class BetaToolSearchToolResultBlockParam { $type = 'tool_search_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BetaToolSearchToolResultError { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
class BetaToolSearchToolResultErrorParam { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
class BetaToolSearchToolSearchResultBlock { $type = 'tool_search_tool_search_result'; $toolReferences; }
class BetaToolSearchToolSearchResultBlockParam { $type = 'tool_search_tool_search_result'; $toolReferences; }
class BetaToolTextEditor20241022 { $type = 'text_editor_20241022'; $name; $allowedCallers; /* 4 more */ }
"str_replace_editor" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolTextEditor20250124 { $type = 'text_editor_20250124'; $name; $allowedCallers; /* 4 more */ }
"str_replace_editor" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolTextEditor20250429 { $type = 'text_editor_20250429'; $name; $allowedCallers; /* 4 more */ }
"str_replace_based_edit_tool" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
When true, guarantees schema validation on tool names and inputs
class BetaToolTextEditor20250728 { $type = 'text_editor_20250728'; $name; $allowedCallers; /* 5 more */ }
"str_replace_based_edit_tool" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.
When true, guarantees schema validation on tool names and inputs
class BetaToolUnion
class BetaToolUseBlock { $type = 'tool_use'; $id; $input; /* 3 more */ }
For a toolset member tool_use, the toolset family.
class BetaToolUseBlockParam { $type = 'tool_use'; $id; $input; /* 4 more */ }
Create a cache control breakpoint at this content block.
For a toolset member tool_use, the toolset family this member belongs to.
class BetaToolUsesKeep { $type = 'tool_uses'; $value; }
class BetaToolUsesTrigger { $type = 'tool_uses'; $value; }
class BetaURLImageSource { $type = 'url'; $url; }
class BetaURLPDFSource { $type = 'url'; $url; }
class BetaUsage { $cacheCreation; $cacheCreationInputTokens; $cacheReadInputTokens; /* 9 more */ }
class BetaUserLocation { $type = 'approximate'; $city; $country; /* 2 more */ }
The city of the user.
The two letter ISO country code of the user.
The region of the user.
The IANA timezone of the user.
class BetaWebFetchBlock { $type = 'web_fetch_result'; $content; $retrievedAt; $url; }
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class BetaWebFetchBlockParam { $type = 'web_fetch_result'; $content; $url; $retrievedAt; }
Fetched content URL
ISO 8601 timestamp when the content was retrieved
class BetaWebFetchTool20250910 { $type = 'web_fetch_20250910'; $name; $allowedCallers; /* 9 more */ }
class BetaWebFetchTool20260209 { $type = 'web_fetch_20260209'; $name; $allowedCallers; /* 9 more */ }
class BetaWebFetchTool20260309 { $type = 'web_fetch_20260309'; $name; $allowedCallers; /* 10 more */ }
class BetaWebFetchTool20260318 { $type = 'web_fetch_20260318'; $name; $allowedCallers; /* 11 more */ }
class BetaWebFetchToolResultBlock { $type = 'web_fetch_tool_result'; $content; $toolUseID; $caller; }
class BetaWebFetchToolResultBlockParam { $type = 'web_fetch_tool_result'; $content; $toolUseID; /* 2 more */ }
Create a cache control breakpoint at this content block.
class BetaWebFetchToolResultErrorBlock { $type = 'web_fetch_tool_result_error'; $errorCode; }
class BetaWebFetchToolResultErrorBlockParam { $type = 'web_fetch_tool_result_error'; $errorCode; }
class BetaWebFetchURLSourceAll { $type = 'all'; }
class BetaWebFetchURLSourceExcept { $type = 'except'; $tools; }
class BetaWebFetchURLSourceNone { $type = 'none'; }
class BetaWebFetchURLSourceOnly { $type = 'only'; $tools; }
class BetaWebFetchURLSourceToolReference { $type = 'tool_reference'; $name; }
class BetaWebFetchURLSources { $clientToolResults; $serverToolResults; $userInput; }
Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].
Which server tools' results contribute fetchable URLs: "all", "none", or an only or except list of server tool names from tools[]; only web_search and web_fetch results ever contribute.
Whether URLs in user messages are fetchable: "all" or "none".
class BetaWebSearchResultBlock { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
class BetaWebSearchResultBlockParam { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
class BetaWebSearchTool20250305 { $type = 'web_search_20250305'; $name; $allowedCallers; /* 7 more */ }
"web_search" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
Parameters for the user's location. Used to provide more relevant search results.
class BetaWebSearchTool20260209 { $type = 'web_search_20260209'; $name; $allowedCallers; /* 7 more */ }
"web_search" nameName of the tool.
Name of the tool.
This is how the tool will be called by the model and in tool_use blocks.
If provided, only these domains will be included in results. Cannot be used alongside blocked_domains.
If provided, these domains will never appear in results. Cannot be used alongside allowed_domains.
Create a cache control breakpoint at this content block.
If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.
Maximum number of times the tool can be used in the API request.
When true, guarantees schema validation on tool names and inputs
Parameters for the user's location. Used to provide more relevant search results.
class BetaWebSearchTool20260318 { $type = 'web_search_20260318'; $name; $allowedCallers; /* 8 more */ }
class BetaWebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
class BetaWebSearchToolResultBlock { $type = 'web_search_tool_result'; $content; $toolUseID; $caller; }
class BetaWebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
class list<BetaWebSearchResultBlock> { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
class BetaWebSearchToolResultBlockParam { $type = 'web_search_tool_result'; $content; $toolUseID; /* 2 more */ }
Create a cache control breakpoint at this content block.
class list<BetaWebSearchResultBlockParam> { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
class BetaWebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
class BetaWebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
MensagensLotes
Criar um lote de mensagens
$client->beta->messages->batches->create(list<Request> requests, ?list<AnthropicBeta> betas, ?string userProfileID, ?string workspaceID): MessageBatchEnvie um lote de solicitações de criação de mensagens.
Recuperar um lote de mensagens
$client->beta->messages->batches->retrieve(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatchEste endpoint é idempotente e pode ser usado para fazer polling da conclusão de um lote de mensagens. Para acessar os resultados de um lote de mensagens, faça uma solicitação para o campo results_url na resposta.
Listar lotes de mensagens
$client->beta->messages->batches->list(?string afterID, ?string beforeID, ?int limit, ?list<AnthropicBeta> betas, ?string workspaceID): Page<MessageBatch>Liste todos os lotes de mensagens em um Workspace. Os lotes criados mais recentemente são retornados primeiro.
Cancelar um lote de mensagens
$client->beta->messages->batches->cancel(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatchOs lotes podem ser cancelados a qualquer momento antes do término do processamento. Depois que o cancelamento é iniciado, o lote entra em um estado canceling, momento em que o sistema pode concluir quaisquer solicitações em andamento e não interrompíveis antes de finalizar o cancelamento.
Excluir um lote de mensagens
$client->beta->messages->batches->delete(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): DeletedMessageBatchExclua um lote de mensagens.
Recuperar resultados de um lote de mensagens
$client->beta->messages->batches->results(string messageBatchID, ?list<AnthropicBeta> betas, ?string workspaceID): MessageBatchIndividualResponseFaz streaming dos resultados de um lote de mensagens como um arquivo .jsonl.