Messages
Create a Message
$client->messages->create(int maxTokens, list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?MessageCreateParamsContainer container, ?string inferenceGeo, ?Metadata metadata, ?OutputConfig outputConfig, ?ServiceTier serviceTier, ?list<string> stopSequences, ?System system, ?float temperature, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<ToolUnion> tools, ?int topK, ?float topP, ?string userProfileID, ?string workspaceID): MessageSend a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
Count tokens in a Message
$client->messages->countTokens(list<MessageParam> messages, Model model, ?CacheControlEphemeral cacheControl, ?OutputConfig outputConfig, ?System system, ?ThinkingConfigParam thinking, ?ToolChoice toolChoice, ?list<MessageCountTokensTool> tools, ?string userProfileID, ?string workspaceID): MessageTokensCountCount the number of tokens in a Message.
Models
class Base64ImageSource { $type = 'base64'; $data; $mediaType; }
class Base64PDFSource { $type = 'base64'; $data; $mediaType; }
class BashCodeExecutionOutputBlock { $type = 'bash_code_execution_output'; $fileID; }
class BashCodeExecutionOutputBlockParam { $type = 'bash_code_execution_output'; $fileID; }
class BashCodeExecutionResultBlock { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
class BashCodeExecutionResultBlockParam { $type = 'bash_code_execution_result'; $content; $returnCode; /* 2 more */ }
class BashCodeExecutionToolResultBlock { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; }
class BashCodeExecutionToolResultBlockParam { $type = 'bash_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class BashCodeExecutionToolResultError { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
class BashCodeExecutionToolResultErrorParam { $type = 'bash_code_execution_tool_result_error'; $errorCode; }
class BrowserCloseTabConfig { $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 BrowserDoubleClickConfig { $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 BrowserFileUploadConfig { $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 BrowserFindConfig { $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 BrowserFormInputConfig { $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 BrowserGetPageTextConfig { $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 BrowserHoldKeyConfig { $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 BrowserHoverConfig { $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 BrowserJavascriptExecConfig { $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 BrowserKeyConfig { $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 BrowserLeftClickConfig { $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 BrowserLeftClickDragConfig { $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 BrowserLeftMouseDownConfig { $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 BrowserLeftMouseUpConfig { $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 BrowserListTabsConfig { $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 BrowserMiddleClickConfig { $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 BrowserMouseMoveConfig { $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 BrowserNavigateConfig { $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 BrowserNewTabConfig { $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 BrowserReadConsoleConfig { $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 BrowserReadNetworkConfig { $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 BrowserReadPageConfig { $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 BrowserRightClickConfig { $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 BrowserScreenshotConfig { $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 BrowserScrollConfig { $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 BrowserScrollToConfig { $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 BrowserStateBlockParam { $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 BrowserStateChange
class BrowserStateChangeDownloadCompleted { $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 BrowserStateChangeDownloadFailed { $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 BrowserStateChangeDownloadStarted { $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 BrowserStateChangeTabOpened { $type = 'tab_opened'; $tabID; }
The tab_id of the opened tab, present in tabs.
class BrowserStateTabEntry { $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 BrowserSwitchTabConfig { $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 BrowserToolset20260801 { $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 BrowserToolsetConfigs { $type; $closeTab; $doubleClick; /* 28 more */ }
class BrowserTripleClickConfig { $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 BrowserTypeConfig { $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 BrowserWaitConfig { $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 BrowserZoomConfig { $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 CacheControlEphemeral { $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 CacheCreation { $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 CitationCharLocation { $type = 'char_location'; $citedText; $documentIndex; /* 4 more */ }
class CitationCharLocationParam { $type = 'char_location'; $citedText; $documentIndex; /* 3 more */ }
class CitationContentBlockLocation { $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 CitationContentBlockLocationParam { $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 CitationPageLocation { $type = 'page_location'; $citedText; $documentIndex; /* 4 more */ }
class CitationPageLocationParam { $type = 'page_location'; $citedText; $documentIndex; /* 3 more */ }
class CitationSearchResultLocationParam { $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 CitationWebSearchResultLocationParam { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
class CitationsConfig { $enabled; }
class CitationsConfigParam { $enabled; }
class CitationsDelta { $type = 'citations_delta'; $citation; }
class CitationsSearchResultLocation { $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 CitationsWebSearchResultLocation { $type = 'web_search_result_location'; $citedText; $encryptedIndex; /* 2 more */ }
class CodeExecutionOutputBlock { $type = 'code_execution_output'; $fileID; }
class CodeExecutionOutputBlockParam { $type = 'code_execution_output'; $fileID; }
class CodeExecutionResultBlock { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
class CodeExecutionResultBlockParam { $type = 'code_execution_result'; $content; $returnCode; /* 2 more */ }
class CodeExecutionTool20250522 { $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 CodeExecutionTool20250825 { $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 CodeExecutionTool20260120 { $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 CodeExecutionTool20260521 { $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 CodeExecutionToolResultBlock { $type = 'code_execution_tool_result'; $content; $toolUseID; }
class CodeExecutionToolResultBlockParam { $type = 'code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class CodeExecutionToolResultError { $type = 'code_execution_tool_result_error'; $errorCode; }
class CodeExecutionToolResultErrorParam { $type = 'code_execution_tool_result_error'; $errorCode; }
class ComputerCursorPositionConfig { $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 ComputerDoubleClickConfig { $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 ComputerHoldKeyConfig { $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 ComputerKeyConfig { $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 ComputerLeftClickConfig { $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 ComputerLeftClickDragConfig { $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 ComputerLeftMouseDownConfig { $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 ComputerLeftMouseUpConfig { $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 ComputerMiddleClickConfig { $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 ComputerMouseMoveConfig { $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 ComputerRightClickConfig { $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 ComputerScreenshotConfig { $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 ComputerScrollConfig { $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 ComputerToolset20260801 { $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 ComputerToolsetConfigs { $type; $cursorPosition; $doubleClick; /* 14 more */ }
class ComputerTripleClickConfig { $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 ComputerTypeConfig { $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 ComputerWaitConfig { $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 ComputerZoomConfig { $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 Container { $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 ContainerParams { $id; $skills; }
Container id
List of skills to load in the container
class ContainerSkill { $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 ContainerUploadBlock { $type = 'container_upload'; $fileID; }
class ContainerUploadBlockParam { $type = 'container_upload'; $fileID; $cacheControl; }
Create a cache control breakpoint at this content block.
class ContentBlock
class ContentBlockParam
class ContentBlockSource { $type = 'content'; $content; }
class DirectCaller { $type = 'direct'; }
class DocumentBlock { $type = 'document'; $citations; $source; $title; }
Citation configuration for the document
The title of the document
class DocumentBlockParam { $type = 'document'; $source; $cacheControl; /* 3 more */ }
Create a cache control breakpoint at this content block.
class EncryptedCodeExecutionResultBlock { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
class EncryptedCodeExecutionResultBlockParam { $type = 'encrypted_code_execution_result'; $content; $encryptedStdout; /* 2 more */ }
class FileDocumentSource { $type = 'file'; $fileID; }
class FileImageSource { $type = 'file'; $fileID; }
class ImageBlockParam { $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 ImageTransformationsParam { $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 InputJSONDelta { $type = 'input_json_delta'; $partialJSON; }
class JSONOutputFormat { $type = 'json_schema'; $schema; }
The JSON schema of the format
class MemoryTool20250818 { $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 Message { $type = 'message'; $id; $container; /* 7 more */ }
class MessageCountTokensTool
class ContainerParams { $id; $skills; }
Container id
List of skills to load in the container
class MessageDeltaUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $inputTokens; /* 3 more */ }
The cumulative number of input tokens used to create the cache entry.
The cumulative number of input tokens read from the cache.
The cumulative number of input tokens which were used.
The cumulative number of output tokens which were used.
?OutputTokensDetails 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 MessageParam { $content; $role; }
class MessageTokensCount { $inputTokens; }
The total number of tokens across the provided list of messages, system prompt, and tools.
class Metadata { $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.
enum Model
Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows
Our most capable model for cybersecurity and biology research, available through trusted access programs
High-performance model for coding and agents
Next generation of intelligence for the hardest knowledge work and coding problems
Most capable model for cybersecurity and biology research
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
New class of intelligence, strongest in coding and cybersecurity
Powerful intelligence for long-running agents and coding
Best combination of speed and intelligence
Fastest model with near-frontier intelligence
Fastest model with near-frontier intelligence
Powerful intelligence for long-running agents and coding
Powerful intelligence for long-running agents and coding
High-performance model for agents and coding
High-performance model for agents and coding
class OutputConfig { $effort; $format; }
All possible effort levels.
A schema to specify Claude's output format in responses. See structured outputs
class OutputTokensDetails { $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 PlainTextSource { $type = 'text'; $data; $mediaType; }
class RawContentBlockDelta
class RawContentBlockDeltaEvent { $type = 'content_block_delta'; $delta; $index; }
class RawContentBlockStartEvent { $type = 'content_block_start'; $contentBlock; $index; }
class RawContentBlockStopEvent { $type = 'content_block_stop'; $index; }
class RawMessageDeltaEvent { $type = 'message_delta'; $delta; $usage; }
MessageDeltaUsage 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.
class RawMessageStartEvent { $type = 'message_start'; $message; }
class RawMessageStopEvent { $type = 'message_stop'; }
class RawMessageStreamEvent
class RedactedThinkingBlock { $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 RedactedThinkingBlockParam { $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 RefusalStopDetails { $type = 'refusal'; $category; $explanation; }
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.
class SearchResultBlockParam { $type = 'search_result'; $content; $source; /* 3 more */ }
Create a cache control breakpoint at this content block.
class ServerToolCaller { $type = 'code_execution_20250825'; $toolID; }
class ServerToolCaller20260120 { $type = 'code_execution_20260120'; $toolID; }
class ServerToolUsage { $webFetchRequests; $webSearchRequests; }
The number of web fetch tool requests.
The number of web search tool requests.
class ServerToolUseBlock { $type = 'server_tool_use'; $id; $caller; /* 2 more */ }
class ServerToolUseBlockParam { $type = 'server_tool_use'; $id; $input; /* 3 more */ }
Create a cache control breakpoint at this content block.
class SignatureDelta { $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 SkillParams { $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 StopReason
class TextBlock { $type = 'text'; $citations; $text; }
?list<TextCitation> 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 TextBlockParam { $type = 'text'; $text; $cacheControl; $citations; }
Create a cache control breakpoint at this content block.
class TextCitation
class TextCitationParam
class TextDelta { $type = 'text_delta'; $text; }
class TextEditorCodeExecutionCreateResultBlock { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
class TextEditorCodeExecutionCreateResultBlockParam { $type = 'text_editor_code_execution_create_result'; $isFileUpdate; }
class TextEditorCodeExecutionStrReplaceResultBlock { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
class TextEditorCodeExecutionStrReplaceResultBlockParam { $type = 'text_editor_code_execution_str_replace_result'; $lines; $newLines; /* 3 more */ }
class TextEditorCodeExecutionToolResultBlock { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; }
class TextEditorCodeExecutionToolResultBlockParam { $type = 'text_editor_code_execution_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class TextEditorCodeExecutionToolResultError { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
class TextEditorCodeExecutionToolResultErrorParam { $type = 'text_editor_code_execution_tool_result_error'; $errorCode; $errorMessage; }
class TextEditorCodeExecutionViewResultBlock { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
class TextEditorCodeExecutionViewResultBlockParam { $type = 'text_editor_code_execution_view_result'; $content; $fileType; /* 3 more */ }
class ThinkingBlock { $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 ThinkingBlockParam { $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 ThinkingConfigAdaptive { $type = 'adaptive'; $display; }
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 ThinkingConfigDisabled { $type = 'disabled'; }
class ThinkingConfigEnabled { $type = 'enabled'; $budgetTokens; $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 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 ThinkingConfigParam
class ThinkingConfigEnabled { $type = 'enabled'; $budgetTokens; $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 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 ThinkingConfigDisabled { $type = 'disabled'; }
class ThinkingConfigAdaptive { $type = 'adaptive'; $display; }
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 ThinkingDelta { $type = 'thinking_delta'; $thinking; }
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 Tool { $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 ToolBash20250124 { $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 ToolChoice
class ToolChoiceAny { $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 ToolChoiceAuto { $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 ToolChoiceNone { $type = 'none'; }
class ToolChoiceTool { $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 ToolReferenceBlock { $type = 'tool_reference'; $toolName; }
class ToolReferenceBlockParam { $type = 'tool_reference'; $toolName; $cacheControl; }
Create a cache control breakpoint at this content block.
class ToolResultBlockParam { $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 ToolSearchToolBm25_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 ToolSearchToolRegex20251119 { $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 ToolSearchToolResultBlock { $type = 'tool_search_tool_result'; $content; $toolUseID; }
class ToolSearchToolResultBlockParam { $type = 'tool_search_tool_result'; $content; $toolUseID; $cacheControl; }
Create a cache control breakpoint at this content block.
class ToolSearchToolResultError { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
class ToolSearchToolResultErrorParam { $type = 'tool_search_tool_result_error'; $errorCode; $errorMessage; }
class ToolSearchToolSearchResultBlock { $type = 'tool_search_tool_search_result'; $toolReferences; }
class ToolSearchToolSearchResultBlockParam { $type = 'tool_search_tool_search_result'; $toolReferences; }
class ToolTextEditor20250124 { $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 ToolTextEditor20250429 { $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 ToolTextEditor20250728 { $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 ToolUnion
class ToolUseBlock { $type = 'tool_use'; $id; $caller; /* 3 more */ }
For a toolset member tool_use, the toolset family.
class ToolUseBlockParam { $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 URLImageSource { $type = 'url'; $url; }
class URLPDFSource { $type = 'url'; $url; }
class Usage { $cacheCreation; $cacheCreationInputTokens; $cacheReadInputTokens; /* 6 more */ }
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 geographic region where inference was performed for this request.
The number of input tokens which were used.
The number of output tokens which were used.
?OutputTokensDetails 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.
If the request used the priority, standard, or batch tier.
class UserLocation { $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 WebFetchBlock { $type = 'web_fetch_result'; $content; $retrievedAt; $url; }
ISO 8601 timestamp when the content was retrieved
Fetched content URL
class WebFetchBlockParam { $type = 'web_fetch_result'; $content; $url; $retrievedAt; }
Fetched content URL
ISO 8601 timestamp when the content was retrieved
class WebFetchTool20250910 { $type = 'web_fetch_20250910'; $name; $allowedCallers; /* 9 more */ }
class WebFetchTool20260209 { $type = 'web_fetch_20260209'; $name; $allowedCallers; /* 9 more */ }
class WebFetchTool20260309 { $type = 'web_fetch_20260309'; $name; $allowedCallers; /* 10 more */ }
class WebFetchTool20260318 { $type = 'web_fetch_20260318'; $name; $allowedCallers; /* 11 more */ }
class WebFetchToolResultBlock { $type = 'web_fetch_tool_result'; $caller; $content; $toolUseID; }
class WebFetchToolResultBlockParam { $type = 'web_fetch_tool_result'; $content; $toolUseID; /* 2 more */ }
Create a cache control breakpoint at this content block.
class WebFetchToolResultErrorBlock { $type = 'web_fetch_tool_result_error'; $errorCode; }
class WebFetchToolResultErrorBlockParam { $type = 'web_fetch_tool_result_error'; $errorCode; }
class WebFetchURLSourceAll { $type = 'all'; }
class WebFetchURLSourceExcept { $type = 'except'; $tools; }
class WebFetchURLSourceNone { $type = 'none'; }
class WebFetchURLSourceOnly { $type = 'only'; $tools; }
class WebFetchURLSourceToolReference { $type = 'tool_reference'; $name; }
class WebFetchURLSources { $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 WebSearchResultBlock { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
class WebSearchResultBlockParam { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
class WebSearchTool20250305 { $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 WebSearchTool20260209 { $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 WebSearchTool20260318 { $type = 'web_search_20260318'; $name; $allowedCallers; /* 8 more */ }
class WebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
class WebSearchToolResultBlock { $type = 'web_search_tool_result'; $caller; $content; $toolUseID; }
class WebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
class list<WebSearchResultBlock> { $type = 'web_search_result'; $encryptedContent; $pageAge; /* 2 more */ }
class WebSearchToolResultBlockParam { $type = 'web_search_tool_result'; $content; $toolUseID; /* 2 more */ }
Create a cache control breakpoint at this content block.
class list<WebSearchResultBlockParam> { $type = 'web_search_result'; $encryptedContent; $title; /* 2 more */ }
class WebSearchToolRequestError { $type = 'web_search_tool_result_error'; $errorCode; }
class WebSearchToolResultError { $type = 'web_search_tool_result_error'; $errorCode; }
MessagesBatches
Create a Message Batch
$client->messages->batches->create(list<Request> requests, ?string userProfileID, ?string workspaceID): MessageBatchSend a batch of Message creation requests.
Retrieve a Message Batch
$client->messages->batches->retrieve(string messageBatchID, ?string workspaceID): MessageBatchThis endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the results_url field in the response.
List Message Batches
$client->messages->batches->list(?string afterID, ?string beforeID, ?int limit, ?string workspaceID): Page<MessageBatch>List all Message Batches within a Workspace. Most recently created batches are returned first.
Cancel a Message Batch
$client->messages->batches->cancel(string messageBatchID, ?string workspaceID): MessageBatchBatches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a canceling state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.
Delete a Message Batch
$client->messages->batches->delete(string messageBatchID, ?string workspaceID): DeletedMessageBatchRetrieve Message Batch results
$client->messages->batches->results(string messageBatchID, ?string workspaceID): MessageBatchIndividualResponseStreams the results of a Message Batch as a .jsonl file.