---
title: Count tokens in a Message
url: https://platform.claude.com/docs/en/api/go/beta/messages/count_tokens
---

# Count tokens in a Message

`client.Beta.Messages.CountTokens(ctx, params) (*BetaMessageTokensCount, error)`

**POST** `/v1/messages/count_tokens`

Count the number of tokens in a Message.

The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.

Learn more about token counting in our [user guide](https://platform.claude.com/docs/en/build-with-claude/token-counting?sdk_languages=go)

## Parameters

- `params BetaMessageCountTokensParams`

  - `Messages []BetaMessageParam`

    Input messages.

    Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn.

    Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages.

    If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response. This is called prefill. On models that don't support prefill, creating a message that ends with a partial `assistant` response returns a 400 error. See [Prefill not supported](https://platform.claude.com/docs/en/api/errors?sdk_languages=go#prefill-not-supported).

    Example with a single `user` message:

    ```json
    [{"role": "user", "content": "Hello, Claude"}]
    ```

    Example with multiple conversational turns:

    ```json
    [
      {"role": "user", "content": "Hello there."},
      {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
      {"role": "user", "content": "Can you explain LLMs in plain English?"},
    ]
    ```

    Example with a partially-filled response from Claude, for models that support prefill:

    ```json
    [
      {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
      {"role": "assistant", "content": "The best answer is ("},
    ]
    ```

    Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent:

    ```json
    {"role": "user", "content": "Hello, Claude"}
    ```

    ```json
    {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
    ```

    See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages?sdk_languages=go).

    Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=go#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API.

    There is a limit of 100,000 messages in a single request.

    - `Content []BetaContentBlockParamUnion`

      - `[]BetaContentBlockParamUnion`

        - `type BetaTextBlockParam`

          - `Type Text`

          - `Text string`

            minLength: 1

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

            - `Type Ephemeral`

            - `TTL BetaCacheControlEphemeralTTL Optional`

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

              This may be one the following values:

              - `5m`: 5 minutes
              - `1h`: 1 hour

              Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=go) for details.

              - `const BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"`

              - `const BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"`

          - `Citations []BetaTextCitationParamUnion Optional`

            - `type BetaCitationCharLocationParam`

              - `Type CharLocation`

              - `CitedText string`

              - `DocumentIndex int64`

                minimum: 0

              - `DocumentTitle string`

                minLength: 1, maxLength: 500

              - `EndCharIndex int64`

              - `StartCharIndex int64`

                minimum: 0

            - `type BetaCitationPageLocationParam`

              - `Type PageLocation`

              - `CitedText string`

              - `DocumentIndex int64`

                minimum: 0

              - `DocumentTitle string`

                minLength: 1, maxLength: 500

              - `EndPageNumber int64`

              - `StartPageNumber int64`

                minimum: 1

            - `type BetaCitationContentBlockLocationParam`

              - `Type ContentBlockLocation`

              - `CitedText string`

                The full text of the cited block range, concatenated.

                Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.

              - `DocumentIndex int64`

                minimum: 0

              - `DocumentTitle string`

                minLength: 1, maxLength: 500

              - `EndBlockIndex int64`

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

              - `StartBlockIndex int64`

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

                minimum: 0

            - `type BetaCitationWebSearchResultLocationParam`

              - `Type WebSearchResultLocation`

              - `CitedText string`

              - `EncryptedIndex string`

              - `Title string`

                minLength: 1, maxLength: 512

              - `URL string`

                minLength: 1

            - `type BetaCitationSearchResultLocationParam`

              - `Type SearchResultLocation`

              - `CitedText string`

                The full text of the cited block range, concatenated.

                Always equals the contents of `content[start_block_index:end_block_index]` joined together. The text block is the minimal citable unit; this field is never a substring of a single block. Not counted toward output tokens, and not counted toward input tokens when sent back in subsequent turns.

              - `EndBlockIndex int64`

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

              - `SearchResultIndex int64`

                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.

                minimum: 0

              - `Source string`

              - `StartBlockIndex int64`

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

                minimum: 0

              - `Title string`

        - `type BetaImageBlockParam`

          - `Type Image`

          - `Source BetaImageBlockParamSourceUnion`

            - `type BetaBase64ImageSourceParam`

              - `Type Base64`

              - `Data string`

                format: byte

              - `MediaType BetaBase64ImageSourceMediaType`

                - `const BetaBase64ImageSourceMediaTypeImageJPEG BetaBase64ImageSourceMediaType = "image/jpeg"`

                - `const BetaBase64ImageSourceMediaTypeImagePNG BetaBase64ImageSourceMediaType = "image/png"`

                - `const BetaBase64ImageSourceMediaTypeImageGIF BetaBase64ImageSourceMediaType = "image/gif"`

                - `const BetaBase64ImageSourceMediaTypeImageWebP BetaBase64ImageSourceMediaType = "image/webp"`

            - `type BetaURLImageSourceParam`

              - `Type URL`

              - `URL string`

            - `type BetaFileImageSourceParam`

              - `Type File`

              - `FileID string`

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Transformations BetaImageTransformationsParam Optional`

            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.

            - `OversizedImage BetaImageTransformationsParamOversizedImage Optional`

              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.

              - `const BetaImageTransformationsParamOversizedImageDownsize BetaImageTransformationsParamOversizedImage = "downsize"`

              - `const BetaImageTransformationsParamOversizedImageError BetaImageTransformationsParamOversizedImage = "error"`

        - `type BetaRequestDocumentBlockParam`

          - `Type Document`

          - `Source BetaRequestDocumentBlockSourceUnionParam`

            - `type BetaBase64PDFSource`

              - `Type Base64`

              - `Data string`

                format: byte

              - `MediaType ApplicationPDF`

            - `type BetaPlainTextSource`

              - `Type Text`

              - `Data string`

              - `MediaType TextPlain`

            - `type BetaContentBlockSourceParam`

              - `Type Content`

              - `Content BetaContentBlockSourceContentUnionParam`

                - `string`

                - `[]BetaContentBlockSourceContentUnionParam`

                  - `type BetaTextBlockParam`

                  - `type BetaImageBlockParam`

            - `type BetaURLPDFSourceParam`

              - `Type URL`

              - `URL string`

            - `type BetaFileDocumentSourceParam`

              - `Type File`

              - `FileID string`

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Citations BetaCitationsConfigParam Optional`

            - `Enabled bool Optional`

          - `Context string Optional`

            minLength: 1

          - `Title string Optional`

            minLength: 1, maxLength: 500

        - `type BetaSearchResultBlockParam`

          - `Type SearchResult`

          - `Content []BetaTextBlockParam`

            - `Type Text`

            - `Text string`

              minLength: 1

            - `CacheControl BetaCacheControlEphemeralParam Optional`

              Create a cache control breakpoint at this content block.

            - `Citations []BetaTextCitationParamUnion Optional`

          - `Source string`

          - `Title string`

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Citations BetaCitationsConfigParam Optional`

        - `type BetaThinkingBlockParam`

          - `Type Thinking`

          - `Signature string`

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

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

          - `Thinking string`

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

        - `type BetaRedactedThinkingBlockParam`

          - `Type RedactedThinking`

          - `Data string`

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

        - `type BetaToolUseBlockParam`

          - `Type ToolUse`

          - `ID string`

            pattern: ^[a-zA-Z0-9_-]+$

          - `Input map[string, any]`

          - `Name string`

            minLength: 1, maxLength: 200

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Caller BetaToolUseBlockParamCallerUnion Optional`

            - `type BetaDirectCaller`

              Tool invocation directly from the model.

              - `Type Direct`

            - `type BetaServerToolCaller`

              Tool invocation generated by a server-side tool.

              - `Type CodeExecution20250825`

              - `ToolID string`

                pattern: ^srvtoolu_[a-zA-Z0-9_]+$

            - `type BetaServerToolCaller20260120`

              - `Type CodeExecution20260120`

              - `ToolID string`

                pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `ToolsetName string Optional`

            For a toolset member tool_use, the toolset family this member belongs to.

            minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$

        - `type BetaToolResultBlockParam`

          - `Type ToolResult`

          - `ToolUseID string`

            pattern: ^[a-zA-Z0-9_-]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Content []BetaToolResultBlockParamContentUnion Optional`

            - `[]BetaToolResultBlockParamContentUnion`

              - `type BetaTextBlockParam`

              - `type BetaImageBlockParam`

              - `type BetaSearchResultBlockParam`

              - `type BetaRequestDocumentBlockParam`

              - `type BetaToolReferenceBlockParam`

                Tool reference block that can be included in tool_result content.

                - `Type ToolReference`

                - `ToolName string`

                  minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$

                - `CacheControl BetaCacheControlEphemeralParam Optional`

                  Create a cache control breakpoint at this content block.

              - `type BetaBrowserStateBlockParam`

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

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

                - `Type BrowserState`

                - `Tabs []BetaBrowserStateTabEntryParam`

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

                  maxItems: 100

                  - `TabID string`

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

                    minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                  - `Title string`

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

                    maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                  - `URL string`

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

                    maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                  - `Active bool Optional`

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

                - `CacheControl BetaCacheControlEphemeralParam Optional`

                  Create a cache control breakpoint at this content block.

                - `StateChanges []BetaBrowserStateChangeUnionParam Optional`

                  Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.

                  minItems: 1, maxItems: 200

                  - `type BetaBrowserStateChangeTabOpenedParam`

                    A tab this call's execution opened that remains open at its end —
                    the creation delta of the `tabs` inventory, not an event log.

                    Carries only the `tab_id`; the tab's `title` and `url` live on its
                    `tabs` entry, which must include the same `tab_id`. A tab opened
                    during a failed call gets no deferred `tab_opened`; it simply appears
                    in the next result's `tabs` inventory.

                    - `Type TabOpened`

                    - `TabID string`

                      The `tab_id` of the opened tab, present in `tabs`.

                      minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                  - `type BetaBrowserStateChangeDownloadStartedParam`

                    A file download that started during this call.

                    - `Type DownloadStarted`

                    - `DownloadID string`

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

                      minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                    - `URL string`

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

                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                  - `type BetaBrowserStateChangeDownloadCompletedParam`

                    A file download that finished during this call, reported with the
                    same `download_id` as its `download_started` — or without a prior
                    `download_started`, when the download finished during the call that
                    started it (at most one state change per `download_id` per result).

                    - `Type DownloadCompleted`

                    - `DownloadID string`

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

                      minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                    - `URL string`

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

                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                    - `Path string Optional`

                      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.

                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                    - `SizeBytes int64 Optional`

                      The completed download's size.

                      minimum: 0

                  - `type BetaBrowserStateChangeDownloadFailedParam`

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

                    - `Type DownloadFailed`

                    - `DownloadID string`

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

                      minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                    - `URL string`

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

                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

                    - `Error string Optional`

                      The failure or cancellation detail, when known.

                      maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$

          - `IsError bool Optional`

          - `ToolsetName string Optional`

            For a toolset member tool_result, the toolset family of the paired tool_use.

            minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$

        - `type BetaServerToolUseBlockParam`

          - `Type ServerToolUse`

          - `ID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `Input map[string, any]`

          - `Name BetaServerToolUseBlockParamName`

            - `const BetaServerToolUseBlockParamNameAdvisor BetaServerToolUseBlockParamName = "advisor"`

            - `const BetaServerToolUseBlockParamNameWebSearch BetaServerToolUseBlockParamName = "web_search"`

            - `const BetaServerToolUseBlockParamNameWebFetch BetaServerToolUseBlockParamName = "web_fetch"`

            - `const BetaServerToolUseBlockParamNameCodeExecution BetaServerToolUseBlockParamName = "code_execution"`

            - `const BetaServerToolUseBlockParamNameBashCodeExecution BetaServerToolUseBlockParamName = "bash_code_execution"`

            - `const BetaServerToolUseBlockParamNameTextEditorCodeExecution BetaServerToolUseBlockParamName = "text_editor_code_execution"`

            - `const BetaServerToolUseBlockParamNameToolSearchToolRegex BetaServerToolUseBlockParamName = "tool_search_tool_regex"`

            - `const BetaServerToolUseBlockParamNameToolSearchToolBm25 BetaServerToolUseBlockParamName = "tool_search_tool_bm25"`

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Caller BetaServerToolUseBlockParamCallerUnion Optional`

            - `type BetaDirectCaller`

              Tool invocation directly from the model.

            - `type BetaServerToolCaller`

              Tool invocation generated by a server-side tool.

            - `type BetaServerToolCaller20260120`

        - `type BetaWebSearchToolResultBlockParam`

          - `Type WebSearchToolResult`

          - `Content BetaWebSearchToolResultBlockParamContentUnion`

            - `[]BetaWebSearchResultBlockParam`

              - `Type WebSearchResult`

              - `EncryptedContent string`

              - `Title string`

              - `URL string`

              - `PageAge string Optional`

            - `type BetaWebSearchToolRequestErrorParam`

              - `Type WebSearchToolResultError`

              - `ErrorCode BetaWebSearchToolResultErrorCode`

                - `const BetaWebSearchToolResultErrorCodeInvalidToolInput BetaWebSearchToolResultErrorCode = "invalid_tool_input"`

                - `const BetaWebSearchToolResultErrorCodeUnavailable BetaWebSearchToolResultErrorCode = "unavailable"`

                - `const BetaWebSearchToolResultErrorCodeMaxUsesExceeded BetaWebSearchToolResultErrorCode = "max_uses_exceeded"`

                - `const BetaWebSearchToolResultErrorCodeTooManyRequests BetaWebSearchToolResultErrorCode = "too_many_requests"`

                - `const BetaWebSearchToolResultErrorCodeQueryTooLong BetaWebSearchToolResultErrorCode = "query_too_long"`

                - `const BetaWebSearchToolResultErrorCodeRequestTooLarge BetaWebSearchToolResultErrorCode = "request_too_large"`

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Caller BetaWebSearchToolResultBlockParamCallerUnion Optional`

            - `type BetaDirectCaller`

              Tool invocation directly from the model.

            - `type BetaServerToolCaller`

              Tool invocation generated by a server-side tool.

            - `type BetaServerToolCaller20260120`

        - `type BetaWebFetchToolResultBlockParam`

          - `Type WebFetchToolResult`

          - `Content BetaWebFetchToolResultBlockParamContentUnion`

            - `type BetaWebFetchToolResultErrorBlockParam`

              - `Type WebFetchToolResultError`

              - `ErrorCode BetaWebFetchToolResultErrorCode`

                - `const BetaWebFetchToolResultErrorCodeInvalidToolInput BetaWebFetchToolResultErrorCode = "invalid_tool_input"`

                - `const BetaWebFetchToolResultErrorCodeURLTooLong BetaWebFetchToolResultErrorCode = "url_too_long"`

                - `const BetaWebFetchToolResultErrorCodeURLNotAllowed BetaWebFetchToolResultErrorCode = "url_not_allowed"`

                - `const BetaWebFetchToolResultErrorCodeURLNotInPriorContext BetaWebFetchToolResultErrorCode = "url_not_in_prior_context"`

                - `const BetaWebFetchToolResultErrorCodeURLNotAccessible BetaWebFetchToolResultErrorCode = "url_not_accessible"`

                - `const BetaWebFetchToolResultErrorCodeUnsupportedContentType BetaWebFetchToolResultErrorCode = "unsupported_content_type"`

                - `const BetaWebFetchToolResultErrorCodeTooManyRequests BetaWebFetchToolResultErrorCode = "too_many_requests"`

                - `const BetaWebFetchToolResultErrorCodeMaxUsesExceeded BetaWebFetchToolResultErrorCode = "max_uses_exceeded"`

                - `const BetaWebFetchToolResultErrorCodeUnavailable BetaWebFetchToolResultErrorCode = "unavailable"`

                - `const BetaWebFetchToolResultErrorCodeContentTooLarge BetaWebFetchToolResultErrorCode = "content_too_large"`

            - `type BetaWebFetchBlockParam`

              - `Type WebFetchResult`

              - `Content BetaRequestDocumentBlockParam`

              - `URL string`

                Fetched content URL

              - `RetrievedAt string Optional`

                ISO 8601 timestamp when the content was retrieved

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Caller BetaWebFetchToolResultBlockParamCallerUnion Optional`

            - `type BetaDirectCaller`

              Tool invocation directly from the model.

            - `type BetaServerToolCaller`

              Tool invocation generated by a server-side tool.

            - `type BetaServerToolCaller20260120`

        - `type BetaAdvisorToolResultBlockParam`

          - `Type AdvisorToolResult`

          - `Content BetaAdvisorToolResultBlockParamContentUnion`

            - `type BetaAdvisorToolResultErrorParam`

              - `Type AdvisorToolResultError`

              - `ErrorCode BetaAdvisorToolResultErrorParamErrorCode`

                - `const BetaAdvisorToolResultErrorParamErrorCodeMaxUsesExceeded BetaAdvisorToolResultErrorParamErrorCode = "max_uses_exceeded"`

                - `const BetaAdvisorToolResultErrorParamErrorCodePromptTooLong BetaAdvisorToolResultErrorParamErrorCode = "prompt_too_long"`

                - `const BetaAdvisorToolResultErrorParamErrorCodeTooManyRequests BetaAdvisorToolResultErrorParamErrorCode = "too_many_requests"`

                - `const BetaAdvisorToolResultErrorParamErrorCodeOverloaded BetaAdvisorToolResultErrorParamErrorCode = "overloaded"`

                - `const BetaAdvisorToolResultErrorParamErrorCodeUnavailable BetaAdvisorToolResultErrorParamErrorCode = "unavailable"`

                - `const BetaAdvisorToolResultErrorParamErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorParamErrorCode = "execution_time_exceeded"`

                - `const BetaAdvisorToolResultErrorParamErrorCodeModelNotFound BetaAdvisorToolResultErrorParamErrorCode = "model_not_found"`

            - `type BetaAdvisorResultBlockParam`

              - `Type AdvisorResult`

              - `Text string`

              - `StopReason string Optional`

            - `type BetaAdvisorRedactedResultBlockParam`

              - `Type AdvisorRedactedResult`

              - `EncryptedContent string`

                Opaque blob produced by a prior response; must be round-tripped verbatim.

              - `StopReason string Optional`

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaCodeExecutionToolResultBlockParam`

          - `Type CodeExecutionToolResult`

          - `Content BetaCodeExecutionToolResultBlockParamContentUnion`

            - `type BetaCodeExecutionToolResultErrorParam`

              - `Type CodeExecutionToolResultError`

              - `ErrorCode BetaCodeExecutionToolResultErrorCode`

                - `const BetaCodeExecutionToolResultErrorCodeInvalidToolInput BetaCodeExecutionToolResultErrorCode = "invalid_tool_input"`

                - `const BetaCodeExecutionToolResultErrorCodeUnavailable BetaCodeExecutionToolResultErrorCode = "unavailable"`

                - `const BetaCodeExecutionToolResultErrorCodeTooManyRequests BetaCodeExecutionToolResultErrorCode = "too_many_requests"`

                - `const BetaCodeExecutionToolResultErrorCodeExecutionTimeExceeded BetaCodeExecutionToolResultErrorCode = "execution_time_exceeded"`

            - `type BetaCodeExecutionResultBlockParam`

              - `Type CodeExecutionResult`

              - `Content []BetaCodeExecutionOutputBlockParam`

                - `Type CodeExecutionOutput`

                - `FileID string`

              - `ReturnCode int64`

              - `Stderr string`

              - `Stdout string`

            - `type BetaEncryptedCodeExecutionResultBlockParam`

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

              - `Type EncryptedCodeExecutionResult`

              - `Content []BetaCodeExecutionOutputBlockParam`

                - `Type CodeExecutionOutput`

                - `FileID string`

              - `EncryptedStdout string`

              - `ReturnCode int64`

              - `Stderr string`

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaBashCodeExecutionToolResultBlockParam`

          - `Type BashCodeExecutionToolResult`

          - `Content BetaBashCodeExecutionToolResultBlockParamContentUnion`

            - `type BetaBashCodeExecutionToolResultErrorParam`

              - `Type BashCodeExecutionToolResultError`

              - `ErrorCode BetaBashCodeExecutionToolResultErrorParamErrorCode`

                - `const BetaBashCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput BetaBashCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input"`

                - `const BetaBashCodeExecutionToolResultErrorParamErrorCodeUnavailable BetaBashCodeExecutionToolResultErrorParamErrorCode = "unavailable"`

                - `const BetaBashCodeExecutionToolResultErrorParamErrorCodeTooManyRequests BetaBashCodeExecutionToolResultErrorParamErrorCode = "too_many_requests"`

                - `const BetaBashCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded"`

                - `const BetaBashCodeExecutionToolResultErrorParamErrorCodeOutputFileTooLarge BetaBashCodeExecutionToolResultErrorParamErrorCode = "output_file_too_large"`

            - `type BetaBashCodeExecutionResultBlockParam`

              - `Type BashCodeExecutionResult`

              - `Content []BetaBashCodeExecutionOutputBlockParam`

                - `Type BashCodeExecutionOutput`

                - `FileID string`

              - `ReturnCode int64`

              - `Stderr string`

              - `Stdout string`

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaTextEditorCodeExecutionToolResultBlockParam`

          - `Type TextEditorCodeExecutionToolResult`

          - `Content BetaTextEditorCodeExecutionToolResultBlockParamContentUnion`

            - `type BetaTextEditorCodeExecutionToolResultErrorParam`

              - `Type TextEditorCodeExecutionToolResultError`

              - `ErrorCode BetaTextEditorCodeExecutionToolResultErrorParamErrorCode`

                - `const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input"`

                - `const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeUnavailable BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "unavailable"`

                - `const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeTooManyRequests BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "too_many_requests"`

                - `const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded"`

                - `const BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeFileNotFound BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "file_not_found"`

              - `ErrorMessage string Optional`

            - `type BetaTextEditorCodeExecutionViewResultBlockParam`

              - `Type TextEditorCodeExecutionViewResult`

              - `Content string`

              - `FileType BetaTextEditorCodeExecutionViewResultBlockParamFileType`

                - `const BetaTextEditorCodeExecutionViewResultBlockParamFileTypeText BetaTextEditorCodeExecutionViewResultBlockParamFileType = "text"`

                - `const BetaTextEditorCodeExecutionViewResultBlockParamFileTypeImage BetaTextEditorCodeExecutionViewResultBlockParamFileType = "image"`

                - `const BetaTextEditorCodeExecutionViewResultBlockParamFileTypePDF BetaTextEditorCodeExecutionViewResultBlockParamFileType = "pdf"`

              - `NumLines int64 Optional`

              - `StartLine int64 Optional`

              - `TotalLines int64 Optional`

            - `type BetaTextEditorCodeExecutionCreateResultBlockParam`

              - `Type TextEditorCodeExecutionCreateResult`

              - `IsFileUpdate bool`

            - `type BetaTextEditorCodeExecutionStrReplaceResultBlockParam`

              - `Type TextEditorCodeExecutionStrReplaceResult`

              - `Lines []string Optional`

              - `NewLines int64 Optional`

              - `NewStart int64 Optional`

              - `OldLines int64 Optional`

              - `OldStart int64 Optional`

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaToolSearchToolResultBlockParam`

          - `Type ToolSearchToolResult`

          - `Content BetaToolSearchToolResultBlockParamContentUnion`

            - `type BetaToolSearchToolResultErrorParam`

              - `Type ToolSearchToolResultError`

              - `ErrorCode BetaToolSearchToolResultErrorParamErrorCode`

                - `const BetaToolSearchToolResultErrorParamErrorCodeInvalidToolInput BetaToolSearchToolResultErrorParamErrorCode = "invalid_tool_input"`

                - `const BetaToolSearchToolResultErrorParamErrorCodeUnavailable BetaToolSearchToolResultErrorParamErrorCode = "unavailable"`

                - `const BetaToolSearchToolResultErrorParamErrorCodeTooManyRequests BetaToolSearchToolResultErrorParamErrorCode = "too_many_requests"`

                - `const BetaToolSearchToolResultErrorParamErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorParamErrorCode = "execution_time_exceeded"`

              - `ErrorMessage string Optional`

            - `type BetaToolSearchToolSearchResultBlockParam`

              - `Type ToolSearchToolSearchResult`

              - `ToolReferences []BetaToolReferenceBlockParam`

                - `Type ToolReference`

                - `ToolName string`

                  minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$

                - `CacheControl BetaCacheControlEphemeralParam Optional`

                  Create a cache control breakpoint at this content block.

          - `ToolUseID string`

            pattern: ^srvtoolu_[a-zA-Z0-9_]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaMCPToolUseBlockParam`

          - `Type MCPToolUse`

          - `ID string`

            pattern: ^[a-zA-Z0-9_-]+$

          - `Input map[string, any]`

          - `Name string`

          - `ServerName string`

            The name of the MCP server

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaRequestMCPToolResultBlockParam`

          - `Type MCPToolResult`

          - `ToolUseID string`

            pattern: ^[a-zA-Z0-9_-]+$

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Content BetaRequestMCPToolResultBlockParamContentUnion Optional`

            - `string`

            - `[]BetaTextBlockParam`

              - `Type Text`

              - `Text string`

                minLength: 1

              - `CacheControl BetaCacheControlEphemeralParam Optional`

                Create a cache control breakpoint at this content block.

              - `Citations []BetaTextCitationParamUnion Optional`

          - `IsError bool Optional`

        - `type BetaContainerUploadBlockParam`

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

          - `Type ContainerUpload`

          - `FileID string`

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

        - `type BetaCompactionBlockParam`

          A compaction block containing summary of previous context.

          Users should round-trip these blocks from responses to subsequent requests
          to maintain context across compaction boundaries.

          When content is None, the block represents a failed compaction. The server
          treats these as no-ops. Empty string content is not allowed.

          - `Type Compaction`

          - `CacheControl BetaCacheControlEphemeralParam Optional`

            Create a cache control breakpoint at this content block.

          - `Content string Optional`

            Summary of previously compacted content, or null if compaction failed

          - `EncryptedContent string Optional`

            Opaque metadata from prior compaction, to be round-tripped verbatim

          - `Signature string Optional`

            The block's signature as returned, to be sent back verbatim

          - `ToolChanges []BetaCompactionBlockParamToolChangeUnion Optional`

            The tool changes of the compacted range, as the server returned them on this block: the `tool_addition` and `tool_removal` entries that take the request's `tools` to the tool set in effect at the end of the range. Send them back unchanged with the block.

            - `type BetaRequestToolAdditionBlockParam`

              Mid-conversation directive to make a tool available.

              `tool` is a reference to a tool (or MCP toolset) declared in the
              request's `tools`. Under the `inline-tools-2026-09-15` beta it may
              instead be a reference to a tool defined earlier in `messages`, or a
              `tool_definition` object that carries an inline tool definition in
              `definition` (the same object a `tools` entry holds). An `mcp_toolset`
              definition also requires the `mcp-client-2026-09-15` beta. The tool is
              offered to the model from this point in the conversation onward.

              - `Type ToolAddition`

              - `Tool BetaRequestToolAdditionBlockToolUnionParam`

                - `type BetaToolChangeToolReferenceParam`

                  Reference to a single tool, by the name the model uses to call it: a
                  tool declared in `tools` or defined by an earlier `tool_addition`
                  block. Does not accept the composed `{server}_{name}` form the server
                  assigns to MCP-resolved tools; use `mcp_tool_reference` or
                  `mcp_toolset_reference` for those.

                  - `Type ToolReference`

                  - `Name string`

                    pattern: ^[a-zA-Z0-9_-]{1,128}$

                - `type BetaToolChangeMCPToolReferenceParam`

                  Reference to a single MCP tool by its server and remote name; the
                  same `server_name`/`name` pair `mcp_tool_use` carries.

                  - `Type MCPToolReference`

                  - `Name string`

                  - `ServerName string`

                - `type BetaToolChangeMCPToolsetReferenceParam`

                  Reference to every tool in the named MCP server's toolset.

                  - `Type MCPToolsetReference`

                  - `ServerName string`

                - `type BetaToolChangeToolDefinitionParam`

                  A tool defined by value: `definition` is a `tools` entry (any kind
                  `tools` accepts, an MCP toolset included). An `mcp_toolset` given here
                  also requires the `mcp-client-2026-09-15` beta.

                  - `Type ToolDefinition`

                  - `Definition BetaToolUnionParam`

                    - `type BetaToolParam`

                      - `Type BetaToolType Optional`

                      - `InputSchema BetaToolInputSchemaParam`

                        [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.

                        This defines the shape of the `input` that your tool accepts and that the model will produce.

                        - `Type Object`

                        - `Properties map[string, any] Optional`

                        - `Required []string Optional`

                      - `Name string`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                        minLength: 1, maxLength: 128, pattern: ^[a-zA-Z0-9_-]{1,128}$

                      - `AllowedCallers []string Optional`

                        - `const BetaToolAllowedCallerDirect BetaToolAllowedCaller = "direct"`

                        - `const BetaToolAllowedCallerCodeExecution20250825 BetaToolAllowedCaller = "code_execution_20250825"`

                        - `const BetaToolAllowedCallerCodeExecution20260120 BetaToolAllowedCaller = "code_execution_20260120"`

                        - `const BetaToolAllowedCallerCodeExecution20260521 BetaToolAllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeralParam Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Description string Optional`

                        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.

                      - `EagerInputStreaming bool Optional`

                        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.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolBash20241022`

                      - `Type Bash20241022`

                      - `Name Bash`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolBash20241022AllowedCallerDirect BetaToolBash20241022AllowedCaller = "direct"`

                        - `const BetaToolBash20241022AllowedCallerCodeExecution20250825 BetaToolBash20241022AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolBash20241022AllowedCallerCodeExecution20260120 BetaToolBash20241022AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolBash20241022AllowedCallerCodeExecution20260521 BetaToolBash20241022AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolBash20250124`

                      - `Type Bash20250124`

                      - `Name Bash`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolBash20250124AllowedCallerDirect BetaToolBash20250124AllowedCaller = "direct"`

                        - `const BetaToolBash20250124AllowedCallerCodeExecution20250825 BetaToolBash20250124AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolBash20250124AllowedCallerCodeExecution20260120 BetaToolBash20250124AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolBash20250124AllowedCallerCodeExecution20260521 BetaToolBash20250124AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaCodeExecutionTool20250522`

                      - `Type CodeExecution20250522`

                      - `Name CodeExecution`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaCodeExecutionTool20250522AllowedCallerDirect BetaCodeExecutionTool20250522AllowedCaller = "direct"`

                        - `const BetaCodeExecutionTool20250522AllowedCallerCodeExecution20250825 BetaCodeExecutionTool20250522AllowedCaller = "code_execution_20250825"`

                        - `const BetaCodeExecutionTool20250522AllowedCallerCodeExecution20260120 BetaCodeExecutionTool20250522AllowedCaller = "code_execution_20260120"`

                        - `const BetaCodeExecutionTool20250522AllowedCallerCodeExecution20260521 BetaCodeExecutionTool20250522AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaCodeExecutionTool20250825`

                      - `Type CodeExecution20250825`

                      - `Name CodeExecution`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaCodeExecutionTool20250825AllowedCallerDirect BetaCodeExecutionTool20250825AllowedCaller = "direct"`

                        - `const BetaCodeExecutionTool20250825AllowedCallerCodeExecution20250825 BetaCodeExecutionTool20250825AllowedCaller = "code_execution_20250825"`

                        - `const BetaCodeExecutionTool20250825AllowedCallerCodeExecution20260120 BetaCodeExecutionTool20250825AllowedCaller = "code_execution_20260120"`

                        - `const BetaCodeExecutionTool20250825AllowedCallerCodeExecution20260521 BetaCodeExecutionTool20250825AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaCodeExecutionTool20260120`

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

                      - `Type CodeExecution20260120`

                      - `Name CodeExecution`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaCodeExecutionTool20260120AllowedCallerDirect BetaCodeExecutionTool20260120AllowedCaller = "direct"`

                        - `const BetaCodeExecutionTool20260120AllowedCallerCodeExecution20250825 BetaCodeExecutionTool20260120AllowedCaller = "code_execution_20250825"`

                        - `const BetaCodeExecutionTool20260120AllowedCallerCodeExecution20260120 BetaCodeExecutionTool20260120AllowedCaller = "code_execution_20260120"`

                        - `const BetaCodeExecutionTool20260120AllowedCallerCodeExecution20260521 BetaCodeExecutionTool20260120AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaCodeExecutionTool20260521`

                      Code execution tool with REPL state persistence.

                      - `Type CodeExecution20260521`

                      - `Name CodeExecution`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaCodeExecutionTool20260521AllowedCallerDirect BetaCodeExecutionTool20260521AllowedCaller = "direct"`

                        - `const BetaCodeExecutionTool20260521AllowedCallerCodeExecution20250825 BetaCodeExecutionTool20260521AllowedCaller = "code_execution_20250825"`

                        - `const BetaCodeExecutionTool20260521AllowedCallerCodeExecution20260120 BetaCodeExecutionTool20260521AllowedCaller = "code_execution_20260120"`

                        - `const BetaCodeExecutionTool20260521AllowedCallerCodeExecution20260521 BetaCodeExecutionTool20260521AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaBrowserToolset20260801`

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

                      - `Type BrowserToolset20260801`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Configs BetaBrowserToolsetConfigs Optional`

                        Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.

                        - `Type BetaBrowserTypeConfig Optional`

                          `type`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `CloseTab BetaBrowserCloseTabConfig Optional`

                          `close_tab`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `DoubleClick BetaBrowserDoubleClickConfig Optional`

                          `double_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `FileUpload BetaBrowserFileUploadConfig Optional`

                          `file_upload`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Find BetaBrowserFindConfig Optional`

                          `find`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `FormInput BetaBrowserFormInputConfig Optional`

                          `form_input`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `GetPageText BetaBrowserGetPageTextConfig Optional`

                          `get_page_text`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `HoldKey BetaBrowserHoldKeyConfig Optional`

                          `hold_key`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Hover BetaBrowserHoverConfig Optional`

                          `hover`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `JavascriptExec BetaBrowserJavascriptExecConfig Optional`

                          `javascript_exec`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Key BetaBrowserKeyConfig Optional`

                          `key`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftClick BetaBrowserLeftClickConfig Optional`

                          `left_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftClickDrag BetaBrowserLeftClickDragConfig Optional`

                          `left_click_drag`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftMouseDown BetaBrowserLeftMouseDownConfig Optional`

                          `left_mouse_down`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftMouseUp BetaBrowserLeftMouseUpConfig Optional`

                          `left_mouse_up`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `ListTabs BetaBrowserListTabsConfig Optional`

                          `list_tabs`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `MiddleClick BetaBrowserMiddleClickConfig Optional`

                          `middle_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `MouseMove BetaBrowserMouseMoveConfig Optional`

                          `mouse_move`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Navigate BetaBrowserNavigateConfig Optional`

                          `navigate`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `NewTab BetaBrowserNewTabConfig Optional`

                          `new_tab`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `ReadConsole BetaBrowserReadConsoleConfig Optional`

                          `read_console`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `ReadNetwork BetaBrowserReadNetworkConfig Optional`

                          `read_network`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `ReadPage BetaBrowserReadPageConfig Optional`

                          `read_page`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `RightClick BetaBrowserRightClickConfig Optional`

                          `right_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Screenshot BetaBrowserScreenshotConfig Optional`

                          `screenshot`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Scroll BetaBrowserScrollConfig Optional`

                          `scroll`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `ScrollTo BetaBrowserScrollToConfig Optional`

                          `scroll_to`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `SwitchTab BetaBrowserSwitchTabConfig Optional`

                          `switch_tab`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `TripleClick BetaBrowserTripleClickConfig Optional`

                          `triple_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Wait BetaBrowserWaitConfig Optional`

                          `wait`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Zoom BetaBrowserZoomConfig Optional`

                          `zoom`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                    - `type BetaToolComputerUse20241022`

                      - `Type Computer20241022`

                      - `DisplayHeightPx int64`

                        The height of the display in pixels.

                        minimum: 1

                      - `DisplayWidthPx int64`

                        The width of the display in pixels.

                        minimum: 1

                      - `Name Computer`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolComputerUse20241022AllowedCallerDirect BetaToolComputerUse20241022AllowedCaller = "direct"`

                        - `const BetaToolComputerUse20241022AllowedCallerCodeExecution20250825 BetaToolComputerUse20241022AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolComputerUse20241022AllowedCallerCodeExecution20260120 BetaToolComputerUse20241022AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolComputerUse20241022AllowedCallerCodeExecution20260521 BetaToolComputerUse20241022AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `DisplayNumber int64 Optional`

                        The X11 display number (e.g. 0, 1) for the display.

                        minimum: 0

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaMemoryTool20250818`

                      - `Type Memory20250818`

                      - `Name Memory`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaMemoryTool20250818AllowedCallerDirect BetaMemoryTool20250818AllowedCaller = "direct"`

                        - `const BetaMemoryTool20250818AllowedCallerCodeExecution20250825 BetaMemoryTool20250818AllowedCaller = "code_execution_20250825"`

                        - `const BetaMemoryTool20250818AllowedCallerCodeExecution20260120 BetaMemoryTool20250818AllowedCaller = "code_execution_20260120"`

                        - `const BetaMemoryTool20250818AllowedCallerCodeExecution20260521 BetaMemoryTool20250818AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolComputerUse20250124`

                      - `Type Computer20250124`

                      - `DisplayHeightPx int64`

                        The height of the display in pixels.

                        minimum: 1

                      - `DisplayWidthPx int64`

                        The width of the display in pixels.

                        minimum: 1

                      - `Name Computer`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolComputerUse20250124AllowedCallerDirect BetaToolComputerUse20250124AllowedCaller = "direct"`

                        - `const BetaToolComputerUse20250124AllowedCallerCodeExecution20250825 BetaToolComputerUse20250124AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolComputerUse20250124AllowedCallerCodeExecution20260120 BetaToolComputerUse20250124AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolComputerUse20250124AllowedCallerCodeExecution20260521 BetaToolComputerUse20250124AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `DisplayNumber int64 Optional`

                        The X11 display number (e.g. 0, 1) for the display.

                        minimum: 0

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolTextEditor20241022`

                      - `Type TextEditor20241022`

                      - `Name StrReplaceEditor`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolTextEditor20241022AllowedCallerDirect BetaToolTextEditor20241022AllowedCaller = "direct"`

                        - `const BetaToolTextEditor20241022AllowedCallerCodeExecution20250825 BetaToolTextEditor20241022AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolTextEditor20241022AllowedCallerCodeExecution20260120 BetaToolTextEditor20241022AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolTextEditor20241022AllowedCallerCodeExecution20260521 BetaToolTextEditor20241022AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolComputerUse20251124`

                      - `Type Computer20251124`

                      - `DisplayHeightPx int64`

                        The height of the display in pixels.

                        minimum: 1

                      - `DisplayWidthPx int64`

                        The width of the display in pixels.

                        minimum: 1

                      - `Name Computer`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolComputerUse20251124AllowedCallerDirect BetaToolComputerUse20251124AllowedCaller = "direct"`

                        - `const BetaToolComputerUse20251124AllowedCallerCodeExecution20250825 BetaToolComputerUse20251124AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolComputerUse20251124AllowedCallerCodeExecution20260120 BetaToolComputerUse20251124AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolComputerUse20251124AllowedCallerCodeExecution20260521 BetaToolComputerUse20251124AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `DisplayNumber int64 Optional`

                        The X11 display number (e.g. 0, 1) for the display.

                        minimum: 0

                      - `EnableZoom bool Optional`

                        Whether to enable an action to take a zoomed-in screenshot of the screen.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaComputerToolset20260801`

                      The computer toolset: a single `tools[]` entry (carrying no
                      `name`) that declares the computer tool family. The model is
                      served the family's tool with any members disabled via `configs`
                      removed from its schema. Every member is enabled by default, zoom
                      included. The single-tool options `display_number` and
                      `enable_zoom` are not fields of a toolset entry — it carries only
                      `type`, `configs`, and `cache_control`; zoom is controlled
                      via `configs.zoom.enabled`.

                      - `Type ComputerToolset20260801`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Configs BetaComputerToolsetConfigs Optional`

                        Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.

                        - `Type BetaComputerTypeConfig Optional`

                          `type`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `CursorPosition BetaComputerCursorPositionConfig Optional`

                          `cursor_position`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `DoubleClick BetaComputerDoubleClickConfig Optional`

                          `double_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `HoldKey BetaComputerHoldKeyConfig Optional`

                          `hold_key`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Key BetaComputerKeyConfig Optional`

                          `key`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftClick BetaComputerLeftClickConfig Optional`

                          `left_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftClickDrag BetaComputerLeftClickDragConfig Optional`

                          `left_click_drag`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftMouseDown BetaComputerLeftMouseDownConfig Optional`

                          `left_mouse_down`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `LeftMouseUp BetaComputerLeftMouseUpConfig Optional`

                          `left_mouse_up`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `MiddleClick BetaComputerMiddleClickConfig Optional`

                          `middle_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `MouseMove BetaComputerMouseMoveConfig Optional`

                          `mouse_move`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `RightClick BetaComputerRightClickConfig Optional`

                          `right_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Screenshot BetaComputerScreenshotConfig Optional`

                          `screenshot`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Scroll BetaComputerScrollConfig Optional`

                          `scroll`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `TripleClick BetaComputerTripleClickConfig Optional`

                          `triple_click`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Wait BetaComputerWaitConfig Optional`

                          `wait`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                        - `Zoom BetaComputerZoomConfig Optional`

                          `zoom`'s config overrides.

                          - `DeferLoading bool Optional`

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

                          - `Enabled bool Optional`

                            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.

                    - `type BetaToolTextEditor20250124`

                      - `Type TextEditor20250124`

                      - `Name StrReplaceEditor`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolTextEditor20250124AllowedCallerDirect BetaToolTextEditor20250124AllowedCaller = "direct"`

                        - `const BetaToolTextEditor20250124AllowedCallerCodeExecution20250825 BetaToolTextEditor20250124AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolTextEditor20250124AllowedCallerCodeExecution20260120 BetaToolTextEditor20250124AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolTextEditor20250124AllowedCallerCodeExecution20260521 BetaToolTextEditor20250124AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolTextEditor20250429`

                      - `Type TextEditor20250429`

                      - `Name StrReplaceBasedEditTool`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolTextEditor20250429AllowedCallerDirect BetaToolTextEditor20250429AllowedCaller = "direct"`

                        - `const BetaToolTextEditor20250429AllowedCallerCodeExecution20250825 BetaToolTextEditor20250429AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolTextEditor20250429AllowedCallerCodeExecution20260120 BetaToolTextEditor20250429AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolTextEditor20250429AllowedCallerCodeExecution20260521 BetaToolTextEditor20250429AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolTextEditor20250728`

                      - `Type TextEditor20250728`

                      - `Name StrReplaceBasedEditTool`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolTextEditor20250728AllowedCallerDirect BetaToolTextEditor20250728AllowedCaller = "direct"`

                        - `const BetaToolTextEditor20250728AllowedCallerCodeExecution20250825 BetaToolTextEditor20250728AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolTextEditor20250728AllowedCallerCodeExecution20260120 BetaToolTextEditor20250728AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolTextEditor20250728AllowedCallerCodeExecution20260521 BetaToolTextEditor20250728AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `InputExamples []map[string, any] Optional`

                      - `MaxCharacters int64 Optional`

                        Maximum number of characters to display when viewing a file. If not specified, defaults to displaying the full file.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaWebSearchTool20250305`

                      - `Type WebSearch20250305`

                      - `Name WebSearch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebSearchTool20250305AllowedCallerDirect BetaWebSearchTool20250305AllowedCaller = "direct"`

                        - `const BetaWebSearchTool20250305AllowedCallerCodeExecution20250825 BetaWebSearchTool20250305AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebSearchTool20250305AllowedCallerCodeExecution20260120 BetaWebSearchTool20250305AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebSearchTool20250305AllowedCallerCodeExecution20260521 BetaWebSearchTool20250305AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.

                      - `BlockedDomains []string Optional`

                        If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `UserLocation BetaUserLocation Optional`

                        Parameters for the user's location. Used to provide more relevant search results.

                        - `Type Approximate`

                        - `City string Optional`

                          The city of the user.

                          minLength: 1, maxLength: 255

                        - `Country string Optional`

                          The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.

                          minLength: 2, maxLength: 2

                        - `Region string Optional`

                          The region of the user.

                          minLength: 1, maxLength: 255

                        - `Timezone string Optional`

                          The [IANA timezone](https://nodatime.org/TimeZones) of the user.

                          minLength: 1, maxLength: 255

                    - `type BetaWebFetchTool20250910`

                      - `Type WebFetch20250910`

                      - `Name WebFetch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebFetchTool20250910AllowedCallerDirect BetaWebFetchTool20250910AllowedCaller = "direct"`

                        - `const BetaWebFetchTool20250910AllowedCallerCodeExecution20250825 BetaWebFetchTool20250910AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebFetchTool20250910AllowedCallerCodeExecution20260120 BetaWebFetchTool20250910AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebFetchTool20250910AllowedCallerCodeExecution20260521 BetaWebFetchTool20250910AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        List of domains to allow fetching from

                      - `BlockedDomains []string Optional`

                        List of domains to block fetching from

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Citations BetaCitationsConfigParamResp Optional`

                        Citations configuration for fetched documents. Citations are disabled by default.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxContentTokens int64 Optional`

                        Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.

                        minimum: 1

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `URLSources BetaWebFetchURLSources Optional`

                        Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.

                        - `ClientToolResults BetaWebFetchURLSourcesClientToolResultsUnion Optional`

                          Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].

                          - `type BetaWebFetchURLSourceAll`

                            The `url_sources` variant under which a source contributes in
                            full: every result of the tool filter's source, or all user input.

                            - `Type All`

                          - `type BetaWebFetchURLSourceNone`

                            The `url_sources` variant under which a source contributes nothing:
                            no result of the tool filter's source, or no user input.

                            - `Type None`

                          - `type BetaWebFetchURLSourceOnly`

                            The tool filter variant under which only the named tools' results
                            contribute.

                            - `Type Only`

                            - `Tools []BetaWebFetchURLSourceToolReference`

                              - `Type ToolReference`

                              - `Name string`

                          - `type BetaWebFetchURLSourceExcept`

                            The tool filter variant under which every result but the named
                            tools' contributes.

                            - `Type Except`

                            - `Tools []BetaWebFetchURLSourceToolReference`

                              - `Type ToolReference`

                              - `Name string`

                        - `ServerToolResults BetaWebFetchURLSourcesServerToolResultsUnion Optional`

                          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.

                          - `type BetaWebFetchURLSourceAll`

                            The `url_sources` variant under which a source contributes in
                            full: every result of the tool filter's source, or all user input.

                          - `type BetaWebFetchURLSourceNone`

                            The `url_sources` variant under which a source contributes nothing:
                            no result of the tool filter's source, or no user input.

                          - `type BetaWebFetchURLSourceOnly`

                            The tool filter variant under which only the named tools' results
                            contribute.

                          - `type BetaWebFetchURLSourceExcept`

                            The tool filter variant under which every result but the named
                            tools' contributes.

                        - `UserInput BetaWebFetchURLSourcesUserInputUnion Optional`

                          Whether URLs in user messages are fetchable: "all" or "none".

                          - `type BetaWebFetchURLSourceAll`

                            The `url_sources` variant under which a source contributes in
                            full: every result of the tool filter's source, or all user input.

                          - `type BetaWebFetchURLSourceNone`

                            The `url_sources` variant under which a source contributes nothing:
                            no result of the tool filter's source, or no user input.

                    - `type BetaWebSearchTool20260209`

                      - `Type WebSearch20260209`

                      - `Name WebSearch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebSearchTool20260209AllowedCallerDirect BetaWebSearchTool20260209AllowedCaller = "direct"`

                        - `const BetaWebSearchTool20260209AllowedCallerCodeExecution20250825 BetaWebSearchTool20260209AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebSearchTool20260209AllowedCallerCodeExecution20260120 BetaWebSearchTool20260209AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebSearchTool20260209AllowedCallerCodeExecution20260521 BetaWebSearchTool20260209AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.

                      - `BlockedDomains []string Optional`

                        If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `UserLocation BetaUserLocation Optional`

                        Parameters for the user's location. Used to provide more relevant search results.

                    - `type BetaWebFetchTool20260209`

                      - `Type WebFetch20260209`

                      - `Name WebFetch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebFetchTool20260209AllowedCallerDirect BetaWebFetchTool20260209AllowedCaller = "direct"`

                        - `const BetaWebFetchTool20260209AllowedCallerCodeExecution20250825 BetaWebFetchTool20260209AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebFetchTool20260209AllowedCallerCodeExecution20260120 BetaWebFetchTool20260209AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebFetchTool20260209AllowedCallerCodeExecution20260521 BetaWebFetchTool20260209AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        List of domains to allow fetching from

                      - `BlockedDomains []string Optional`

                        List of domains to block fetching from

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Citations BetaCitationsConfigParamResp Optional`

                        Citations configuration for fetched documents. Citations are disabled by default.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxContentTokens int64 Optional`

                        Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.

                        minimum: 1

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `URLSources BetaWebFetchURLSources Optional`

                        Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.

                    - `type BetaWebFetchTool20260309`

                      Web fetch tool with use_cache parameter for bypassing cached content.

                      - `Type WebFetch20260309`

                      - `Name WebFetch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebFetchTool20260309AllowedCallerDirect BetaWebFetchTool20260309AllowedCaller = "direct"`

                        - `const BetaWebFetchTool20260309AllowedCallerCodeExecution20250825 BetaWebFetchTool20260309AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebFetchTool20260309AllowedCallerCodeExecution20260120 BetaWebFetchTool20260309AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebFetchTool20260309AllowedCallerCodeExecution20260521 BetaWebFetchTool20260309AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        List of domains to allow fetching from

                      - `BlockedDomains []string Optional`

                        List of domains to block fetching from

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Citations BetaCitationsConfigParamResp Optional`

                        Citations configuration for fetched documents. Citations are disabled by default.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxContentTokens int64 Optional`

                        Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.

                        minimum: 1

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `URLSources BetaWebFetchURLSources Optional`

                        Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.

                      - `UseCache bool Optional`

                        Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.

                    - `type BetaWebSearchTool20260318`

                      - `Type WebSearch20260318`

                      - `Name WebSearch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebSearchTool20260318AllowedCallerDirect BetaWebSearchTool20260318AllowedCaller = "direct"`

                        - `const BetaWebSearchTool20260318AllowedCallerCodeExecution20250825 BetaWebSearchTool20260318AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebSearchTool20260318AllowedCallerCodeExecution20260120 BetaWebSearchTool20260318AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebSearchTool20260318AllowedCallerCodeExecution20260521 BetaWebSearchTool20260318AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        If provided, only these domains will be included in results. Cannot be used alongside `blocked_domains`.

                      - `BlockedDomains []string Optional`

                        If provided, these domains will never appear in results. Cannot be used alongside `allowed_domains`.

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `ResponseInclusion BetaWebSearchTool20260318ResponseInclusion Optional`

                        How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.

                        - `const BetaWebSearchTool20260318ResponseInclusionFull BetaWebSearchTool20260318ResponseInclusion = "full"`

                        - `const BetaWebSearchTool20260318ResponseInclusionExcluded BetaWebSearchTool20260318ResponseInclusion = "excluded"`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `UserLocation BetaUserLocation Optional`

                        Parameters for the user's location. Used to provide more relevant search results.

                    - `type BetaWebFetchTool20260318`

                      - `Type WebFetch20260318`

                      - `Name WebFetch`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaWebFetchTool20260318AllowedCallerDirect BetaWebFetchTool20260318AllowedCaller = "direct"`

                        - `const BetaWebFetchTool20260318AllowedCallerCodeExecution20250825 BetaWebFetchTool20260318AllowedCaller = "code_execution_20250825"`

                        - `const BetaWebFetchTool20260318AllowedCallerCodeExecution20260120 BetaWebFetchTool20260318AllowedCaller = "code_execution_20260120"`

                        - `const BetaWebFetchTool20260318AllowedCallerCodeExecution20260521 BetaWebFetchTool20260318AllowedCaller = "code_execution_20260521"`

                      - `AllowedDomains []string Optional`

                        List of domains to allow fetching from

                      - `BlockedDomains []string Optional`

                        List of domains to block fetching from

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Citations BetaCitationsConfigParamResp Optional`

                        Citations configuration for fetched documents. Citations are disabled by default.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxContentTokens int64 Optional`

                        Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.

                        minimum: 1

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `ResponseInclusion BetaWebFetchTool20260318ResponseInclusion Optional`

                        How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.

                        - `const BetaWebFetchTool20260318ResponseInclusionFull BetaWebFetchTool20260318ResponseInclusion = "full"`

                        - `const BetaWebFetchTool20260318ResponseInclusionExcluded BetaWebFetchTool20260318ResponseInclusion = "excluded"`

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                      - `URLSources BetaWebFetchURLSources Optional`

                        Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.

                      - `UseCache bool Optional`

                        Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.

                    - `type BetaAdvisorTool20260301`

                      - `Type Advisor20260301`

                      - `Model Model`

                        The model that will complete your prompt.

                        See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.

                        - `const ModelClaudeHaiku5_5 Model = "claude-haiku-5-5"`

                          Fastest model for high-volume, real-time tasks

                        - `const ModelClaudeSonnet5_5 Model = "claude-sonnet-5-5"`

                          Efficient model for coding and agents

                        - `const ModelClaudeFable5_1 Model = "claude-fable-5-1"`

                          Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows

                        - `const ModelClaudeOpus5_5 Model = "claude-opus-5-5"`

                          Powerful intelligence for coding, knowledge work, and long-running agents

                        - `const ModelClaudeMythos5_1 Model = "claude-mythos-5-1"`

                          Our most capable model for cybersecurity and biology research, available through trusted access programs

                        - `const ModelClaudeSonnet5 Model = "claude-sonnet-5"`

                          Efficient model for coding and agents

                        - `const ModelClaudeFable5 Model = "claude-fable-5"`

                          Next generation of intelligence for the hardest knowledge work and coding problems

                        - `const ModelClaudeMythos5 Model = "claude-mythos-5"`

                          Most capable model for cybersecurity and biology research

                        - `const ModelClaudeOpus5 Model = "claude-opus-5"`

                          Powerful intelligence for long-running agents and coding

                        - `const ModelClaudeOpus4_8 Model = "claude-opus-4-8"`

                          Powerful intelligence for long-running agents and coding

                        - `const ModelClaudeOpus4_7 Model = "claude-opus-4-7"`

                          Powerful intelligence for long-running agents and coding

                        - `const ModelClaudeOpus4_6 Model = "claude-opus-4-6"`

                          Powerful intelligence for long-running agents and coding

                        - `const ModelClaudeSonnet4_6 Model = "claude-sonnet-4-6"`

                          Best combination of speed and intelligence

                        - `const ModelClaudeHaiku4_5 Model = "claude-haiku-4-5"`

                        - `const ModelClaudeHaiku4_5_20251001 Model = "claude-haiku-4-5-20251001"`

                        - `const ModelClaudeOpus4_5 Model = "claude-opus-4-5"`

                          Powerful intelligence for long-running agents and coding

                        - `const ModelClaudeOpus4_5_20251101 Model = "claude-opus-4-5-20251101"`

                          Powerful intelligence for long-running agents and coding

                        - `const ModelClaudeMythosPreview Model = "claude-mythos-preview"`

                          **Deprecated**: Will reach end-of-life on June 30, 2026. Please migrate to claude-mythos-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.

                          New class of intelligence, strongest in coding and cybersecurity

                        - `const ModelClaudeSonnet4_5 Model = "claude-sonnet-4-5"`

                          **Deprecated**: Will reach end-of-life on November 30, 2026. Please migrate to claude-sonnet-5-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.

                          High-performance model for agents and coding

                        - `const ModelClaudeSonnet4_5_20250929 Model = "claude-sonnet-4-5-20250929"`

                          **Deprecated**: Will reach end-of-life on November 30, 2026. Please migrate to claude-sonnet-5-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.

                          High-performance model for agents and coding

                      - `Name Advisor`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaAdvisorTool20260301AllowedCallerDirect BetaAdvisorTool20260301AllowedCaller = "direct"`

                        - `const BetaAdvisorTool20260301AllowedCallerCodeExecution20250825 BetaAdvisorTool20260301AllowedCaller = "code_execution_20250825"`

                        - `const BetaAdvisorTool20260301AllowedCallerCodeExecution20260120 BetaAdvisorTool20260301AllowedCaller = "code_execution_20260120"`

                        - `const BetaAdvisorTool20260301AllowedCallerCodeExecution20260521 BetaAdvisorTool20260301AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Caching BetaCacheControlEphemeral Optional`

                        Caching for the advisor's own prompt. When set, each advisor call writes a cache entry at the given TTL so subsequent calls in the same conversation read the stable prefix. When omitted, the advisor prompt is not cached.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `MaxTokens int64 Optional`

                        Bounds the advisor's total output (thinking + text) per call. When the advisor hits this cap, the returned advisor_result or advisor_redacted_result block carries stop_reason='max_tokens', and a truncation note is appended to the advice text the worker model sees (inside the encrypted blob in redacted mode). When set, the server also emits a remaining-tokens budget block in the advisor's prompt so the advisor self-shapes toward the cap. When omitted, the advisor model's default output cap applies and no budget block is emitted.

                        minimum: 1024

                      - `MaxUses int64 Optional`

                        Maximum number of times the tool can be used in the API request.

                        minimum: 1

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolSearchToolBm25_20251119`

                      - `Type BetaToolSearchToolBm25_20251119Type`

                        - `const BetaToolSearchToolBm25_20251119TypeToolSearchToolBm25_20251119 BetaToolSearchToolBm25_20251119Type = "tool_search_tool_bm25_20251119"`

                        - `const BetaToolSearchToolBm25_20251119TypeToolSearchToolBm25 BetaToolSearchToolBm25_20251119Type = "tool_search_tool_bm25"`

                      - `Name ToolSearchToolBm25`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolSearchToolBm25_20251119AllowedCallerDirect BetaToolSearchToolBm25_20251119AllowedCaller = "direct"`

                        - `const BetaToolSearchToolBm25_20251119AllowedCallerCodeExecution20250825 BetaToolSearchToolBm25_20251119AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolSearchToolBm25_20251119AllowedCallerCodeExecution20260120 BetaToolSearchToolBm25_20251119AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolSearchToolBm25_20251119AllowedCallerCodeExecution20260521 BetaToolSearchToolBm25_20251119AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaToolSearchToolRegex20251119`

                      - `Type BetaToolSearchToolRegex20251119Type`

                        - `const BetaToolSearchToolRegex20251119TypeToolSearchToolRegex20251119 BetaToolSearchToolRegex20251119Type = "tool_search_tool_regex_20251119"`

                        - `const BetaToolSearchToolRegex20251119TypeToolSearchToolRegex BetaToolSearchToolRegex20251119Type = "tool_search_tool_regex"`

                      - `Name ToolSearchToolRegex`

                        Name of the tool.

                        This is how the tool will be called by the model and in `tool_use` blocks.

                      - `AllowedCallers []string Optional`

                        - `const BetaToolSearchToolRegex20251119AllowedCallerDirect BetaToolSearchToolRegex20251119AllowedCaller = "direct"`

                        - `const BetaToolSearchToolRegex20251119AllowedCallerCodeExecution20250825 BetaToolSearchToolRegex20251119AllowedCaller = "code_execution_20250825"`

                        - `const BetaToolSearchToolRegex20251119AllowedCallerCodeExecution20260120 BetaToolSearchToolRegex20251119AllowedCaller = "code_execution_20260120"`

                        - `const BetaToolSearchToolRegex20251119AllowedCallerCodeExecution20260521 BetaToolSearchToolRegex20251119AllowedCaller = "code_execution_20260521"`

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `DeferLoading bool Optional`

                        If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

                      - `Strict bool Optional`

                        When true, guarantees schema validation on tool names and inputs

                    - `type BetaMCPToolset`

                      Configuration for a group of tools from an MCP server.

                      Allows configuring enabled status and defer_loading for all tools
                      from an MCP server, with optional per-tool overrides.

                      - `Type MCPToolset`

                      - `MCPServerName string`

                        Name of the MCP server to configure tools for

                        minLength: 1, maxLength: 255

                      - `CacheControl BetaCacheControlEphemeral Optional`

                        Create a cache control breakpoint at this content block.

                      - `Configs map[string, BetaMCPToolConfig] Optional`

                        Configuration overrides for specific tools, keyed by tool name

                        - `DeferLoading bool Optional`

                        - `Enabled bool Optional`

                      - `DefaultConfig BetaMCPToolDefaultConfig Optional`

                        Default configuration applied to all tools from this server

                        - `DeferLoading bool Optional`

                        - `Enabled bool Optional`

                      - `Tools []BetaMCPToolParamResp Optional`

                        The server's tool listing, pinned: when present, the server is not asked for its tools before sampling and exactly these entries, with `default_config` and `configs` applied, are the toolset's tools. Copy it from the `mcp_tool_listing` block of an earlier response.

                        - `InputSchema map[string, any]`

                          The tool's input schema as the MCP server lists it, verbatim.

                        - `Name string`

                          The tool's name as the MCP server lists it (not prefixed with the server name).

                          minLength: 1

                        - `Description string Optional`

                          The tool's description as the MCP server lists it.

              - `CacheControl BetaCacheControlEphemeralParam Optional`

                Create a cache control breakpoint at this content block.

            - `type BetaRequestToolRemovalBlockParam`

              Mid-conversation directive to withdraw a tool.

              `tool` references a tool (or MCP toolset) by name: one declared in the
              request's `tools` or defined earlier in `messages`. It is no longer
              offered to the model from this point in the conversation onward.

              - `Type ToolRemoval`

              - `Tool BetaRequestToolRemovalBlockToolUnionParam`

                - `type BetaToolChangeToolReferenceParam`

                  Reference to a single tool, by the name the model uses to call it: a
                  tool declared in `tools` or defined by an earlier `tool_addition`
                  block. Does not accept the composed `{server}_{name}` form the server
                  assigns to MCP-resolved tools; use `mcp_tool_reference` or
                  `mcp_toolset_reference` for those.

                - `type BetaToolChangeMCPToolReferenceParam`

                  Reference to a single MCP tool by its server and remote name; the
                  same `server_name`/`name` pair `mcp_tool_use` carries.

                - `type BetaToolChangeMCPToolsetReferenceParam`

                  Reference to every tool in the named MCP server's toolset.

              - `CacheControl BetaCacheControlEphemeralParam Optional`

                Create a cache control breakpoint at this content block.

        - `type BetaRequestToolAdditionBlockParam`

          Mid-conversation directive to make a tool available.

          `tool` is a reference to a tool (or MCP toolset) declared in the
          request's `tools`. Under the `inline-tools-2026-09-15` beta it may
          instead be a reference to a tool defined earlier in `messages`, or a
          `tool_definition` object that carries an inline tool definition in
          `definition` (the same object a `tools` entry holds). An `mcp_toolset`
          definition also requires the `mcp-client-2026-09-15` beta. The tool is
          offered to the model from this point in the conversation onward.

        - `type BetaRequestToolRemovalBlockParam`

          Mid-conversation directive to withdraw a tool.

          `tool` references a tool (or MCP toolset) by name: one declared in the
          request's `tools` or defined earlier in `messages`. It is no longer
          offered to the model from this point in the conversation onward.

        - `type BetaMCPToolListingBlockParam`

          The tool listing an MCP server returned while an earlier response was
          produced, as that response carried it. Send the assistant message back
          unchanged, this block included, and the server uses this listing for the
          matching `mcp_toolset` instead of asking the MCP server again.

          - `Type MCPToolListing`

          - `MCPServerName string`

            The name of the MCP server this listing came from, as `mcp_servers` declares it.

            minLength: 1, maxLength: 255

          - `Tools []BetaMCPToolParam`

            The server's tools, exactly as the response listed them.

            - `InputSchema map[string, any]`

              The tool's input schema as the MCP server lists it, verbatim.

            - `Name string`

              The tool's name as the MCP server lists it (not prefixed with the server name).

              minLength: 1

            - `Description string Optional`

              The tool's description as the MCP server lists it.

        - `type BetaFallbackBlockParam`

          A `fallback` block echoed back from a prior response.

          Accepted in `messages[].content` and not rendered into the prompt; not
          validated against the request's `fallbacks` chain or top-level `model`.

          Echo the assistant turn back verbatim, including this block in its
          original position. The block marks the boundary between content produced
          before and after a fallback hop, and the server relies on that boundary
          to validate the turn: when thinking runs flank the boundary, omitting
          the block merges them into one span the server cannot validate (the
          request is rejected), and moving it into the middle of a single run is
          likewise rejected; between non-thinking blocks the block's placement has
          no validation effect.

          - `Type Fallback`

          - `From BetaFallbackInfoParam`

            Identifies one hop of a fallback transition.

            - `Model Model`

              The model that will complete your prompt.

              See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.

          - `To BetaFallbackInfoParam`

            Identifies one hop of a fallback transition.

          - `Trigger any Optional`

            The response block's `trigger`, echoed verbatim. Accepted and ignored by the server; any object or `null` is allowed.

    - `Role BetaMessageParamRole`

      - `const BetaMessageParamRoleUser BetaMessageParamRole = "user"`

      - `const BetaMessageParamRoleAssistant BetaMessageParamRole = "assistant"`

      - `const BetaMessageParamRoleSystem BetaMessageParamRole = "system"`

    - `ClearAt BetaMessageParamClearAt Optional`

      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.

      - `const BetaMessageParamClearAtNextUserMessage BetaMessageParamClearAt = "next_user_message"`

      - `const BetaMessageParamClearAtNever BetaMessageParamClearAt = "never"`

    - `OutputConfig BetaSystemMessageOutputConfigParam Optional`

      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.

      - `Effort BetaSystemMessageOutputConfigEffort Optional`

        How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.

        Valid values are `low`, `medium`, `high`, `xhigh`, or `max`.

        - `const BetaSystemMessageOutputConfigEffortLow BetaSystemMessageOutputConfigEffort = "low"`

        - `const BetaSystemMessageOutputConfigEffortMedium BetaSystemMessageOutputConfigEffort = "medium"`

        - `const BetaSystemMessageOutputConfigEffortHigh BetaSystemMessageOutputConfigEffort = "high"`

        - `const BetaSystemMessageOutputConfigEffortXhigh BetaSystemMessageOutputConfigEffort = "xhigh"`

        - `const BetaSystemMessageOutputConfigEffortMax BetaSystemMessageOutputConfigEffort = "max"`

  - `Model Model`

    The model that will complete your prompt.

    See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.

  - `CacheControl BetaCacheControlEphemeralParam Optional`

    Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.

  - `Compaction BetaCompactionConfigParam Optional`

    Compaction configuration.

    When set on `POST /v1/messages`, the request is a compaction request: the conversation in `messages` is summarized and the response holds only the resulting `compaction` block (`stop_reason` `"compaction"`), which later requests send first in `messages` in place of the messages it summarizes. `POST /v1/messages/count_tokens` accepts this parameter and ignores it: the count it returns is for the conversation in `messages` as sent. Cannot be combined with `context_management`.

  - `ContextManagement BetaContextManagementConfigParam Optional`

    Context management configuration.

    This allows you to control how Claude manages context across multiple requests, such as whether to clear function results or not.

  - `MCPServers []BetaRequestMCPServerURLDefinitionParam Optional`

    MCP servers to be utilized in this request

    maxItems: 20

    - `Type URL`

    - `Name string`

    - `URL string`

    - `AuthorizationToken string Optional`

    - `ToolConfiguration BetaRequestMCPServerToolConfigurationParam Optional`

      - `AllowedTools []string Optional`

      - `Enabled bool Optional`

  - `OutputConfig BetaOutputConfigParam Optional`

    Configuration options for the model's output, such as the output format.

  - `Speed BetaMessageCountTokensParamsSpeed Optional`

    The inference speed mode for this request. `"fast"` enables high output-tokens-per-second inference.

    Some models require the `fast-mode-2026-02-01` beta header for any `speed` value. See [fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode?sdk_languages=go) for which models.

    - `const BetaMessageCountTokensParamsSpeedStandard BetaMessageCountTokensParamsSpeed = "standard"`

    - `const BetaMessageCountTokensParamsSpeedFast BetaMessageCountTokensParamsSpeed = "fast"`

  - `System BetaMessageCountTokensParamsSystemUnion Optional`

    System prompt.

    A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?sdk_languages=go#give-claude-a-role).

    - `string`

    - `[]BetaTextBlockParam`

      - `Type Text`

      - `Text string`

        minLength: 1

      - `CacheControl BetaCacheControlEphemeralParam Optional`

        Create a cache control breakpoint at this content block.

      - `Citations []BetaTextCitationParamUnion Optional`

  - `Thinking BetaThinkingConfigParamUnion Optional`

    Configuration for Claude's thinking.

    With `{"type": "adaptive"}`, Claude decides when and how much to think. With `{"type": "enabled"}` (manual extended thinking), you set a `budget_tokens` of at least 1,024. Thinking tokens count toward your `max_tokens` limit.

    Which `type` values are accepted, and what happens when you omit `thinking`, depend on the model. See [thinking](https://platform.claude.com/docs/en/build-with-claude/thinking?sdk_languages=go#configuring-thinking) for each model's behavior.

  - `ToolChoice BetaToolChoiceUnionParam Optional`

    How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.

  - `Tools []BetaMessageCountTokensParamsToolUnion Optional`

    Definitions of tools that the model may use.

    If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.

    There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools?sdk_languages=go), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool?sdk_languages=go)).

    Each tool definition includes:

    * `name`: Name of the tool.
    * `description`: Optional, but strongly-recommended description of the tool.
    * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.

    For example, if you defined `tools` as:

    ```json
    [
      {
        "name": "get_stock_price",
        "description": "Get the current stock price for a given ticker symbol.",
        "input_schema": {
          "type": "object",
          "properties": {
            "ticker": {
              "type": "string",
              "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
            }
          },
          "required": ["ticker"]
        }
      }
    ]
    ```

    And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this:

    ```json
    [
      {
        "type": "tool_use",
        "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
        "name": "get_stock_price",
        "input": { "ticker": "^GSPC" }
      }
    ]
    ```

    You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message:

    ```json
    [
      {
        "type": "tool_result",
        "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
        "content": "259.75 USD"
      }
    ]
    ```

    Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.

    See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview?sdk_languages=go) for more details.

    - `type BetaToolParam`

    - `type BetaToolBash20241022`

    - `type BetaToolBash20250124`

    - `type BetaCodeExecutionTool20250522`

    - `type BetaCodeExecutionTool20250825`

    - `type BetaCodeExecutionTool20260120`

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

    - `type BetaCodeExecutionTool20260521`

      Code execution tool with REPL state persistence.

    - `type BetaBrowserToolset20260801`

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

    - `type BetaToolComputerUse20241022`

    - `type BetaMemoryTool20250818`

    - `type BetaToolComputerUse20250124`

    - `type BetaToolTextEditor20241022`

    - `type BetaToolComputerUse20251124`

    - `type BetaComputerToolset20260801`

      The computer toolset: a single `tools[]` entry (carrying no
      `name`) that declares the computer tool family. The model is
      served the family's tool with any members disabled via `configs`
      removed from its schema. Every member is enabled by default, zoom
      included. The single-tool options `display_number` and
      `enable_zoom` are not fields of a toolset entry — it carries only
      `type`, `configs`, and `cache_control`; zoom is controlled
      via `configs.zoom.enabled`.

    - `type BetaToolTextEditor20250124`

    - `type BetaToolTextEditor20250429`

    - `type BetaToolTextEditor20250728`

    - `type BetaWebSearchTool20250305`

    - `type BetaWebFetchTool20250910`

    - `type BetaWebSearchTool20260209`

    - `type BetaWebFetchTool20260209`

    - `type BetaWebFetchTool20260309`

      Web fetch tool with use_cache parameter for bypassing cached content.

    - `type BetaWebSearchTool20260318`

    - `type BetaWebFetchTool20260318`

    - `type BetaAdvisorTool20260301`

    - `type BetaToolSearchToolBm25_20251119`

    - `type BetaToolSearchToolRegex20251119`

    - `type BetaMCPToolset`

      Configuration for a group of tools from an MCP server.

      Allows configuring enabled status and defer_loading for all tools
      from an MCP server, with optional per-tool overrides.

  - `Betas []AnthropicBeta Optional` (header parameter)

    Optional header to specify the beta version(s) you want to use.

    - `const AnthropicBetaMessageBatches2024_09_24 AnthropicBeta = "message-batches-2024-09-24"`

    - `const AnthropicBetaPromptCaching2024_07_31 AnthropicBeta = "prompt-caching-2024-07-31"`

    - `const AnthropicBetaComputerUse2024_10_22 AnthropicBeta = "computer-use-2024-10-22"`

    - `const AnthropicBetaComputerUse2025_01_24 AnthropicBeta = "computer-use-2025-01-24"`

    - `const AnthropicBetaPDFs2024_09_25 AnthropicBeta = "pdfs-2024-09-25"`

    - `const AnthropicBetaTokenCounting2024_11_01 AnthropicBeta = "token-counting-2024-11-01"`

    - `const AnthropicBetaTokenEfficientTools2025_02_19 AnthropicBeta = "token-efficient-tools-2025-02-19"`

    - `const AnthropicBetaOutput128k2025_02_19 AnthropicBeta = "output-128k-2025-02-19"`

    - `const AnthropicBetaFilesAPI2025_04_14 AnthropicBeta = "files-api-2025-04-14"`

    - `const AnthropicBetaMCPClient2025_04_04 AnthropicBeta = "mcp-client-2025-04-04"`

    - `const AnthropicBetaMCPClient2025_11_20 AnthropicBeta = "mcp-client-2025-11-20"`

    - `const AnthropicBetaDevFullThinking2025_05_14 AnthropicBeta = "dev-full-thinking-2025-05-14"`

    - `const AnthropicBetaInterleavedThinking2025_05_14 AnthropicBeta = "interleaved-thinking-2025-05-14"`

    - `const AnthropicBetaCodeExecution2025_05_22 AnthropicBeta = "code-execution-2025-05-22"`

    - `const AnthropicBetaExtendedCacheTTL2025_04_11 AnthropicBeta = "extended-cache-ttl-2025-04-11"`

    - `const AnthropicBetaContext1m2025_08_07 AnthropicBeta = "context-1m-2025-08-07"`

    - `const AnthropicBetaContextManagement2025_06_27 AnthropicBeta = "context-management-2025-06-27"`

    - `const AnthropicBetaModelContextWindowExceeded2025_08_26 AnthropicBeta = "model-context-window-exceeded-2025-08-26"`

    - `const AnthropicBetaSkills2025_10_02 AnthropicBeta = "skills-2025-10-02"`

    - `const AnthropicBetaFastMode2026_02_01 AnthropicBeta = "fast-mode-2026-02-01"`

    - `const AnthropicBetaOutput300k2026_03_24 AnthropicBeta = "output-300k-2026-03-24"`

    - `const AnthropicBetaUserProfiles2026_03_24 AnthropicBeta = "user-profiles-2026-03-24"`

    - `const AnthropicBetaUserProfiles2026_08_18 AnthropicBeta = "user-profiles-2026-08-18"`

    - `const AnthropicBetaUserProfiles2026_09_04 AnthropicBeta = "user-profiles-2026-09-04"`

    - `const AnthropicBetaAdvisorTool2026_03_01 AnthropicBeta = "advisor-tool-2026-03-01"`

    - `const AnthropicBetaManagedAgents2026_04_01 AnthropicBeta = "managed-agents-2026-04-01"`

    - `const AnthropicBetaCacheDiagnosis2026_04_07 AnthropicBeta = "cache-diagnosis-2026-04-07"`

    - `const AnthropicBetaDreaming2026_04_21 AnthropicBeta = "dreaming-2026-04-21"`

    - `const AnthropicBetaThinkingTokenCount2026_05_13 AnthropicBeta = "thinking-token-count-2026-05-13"`

    - `const AnthropicBetaServerSideFallback2026_06_01 AnthropicBeta = "server-side-fallback-2026-06-01"`

    - `const AnthropicBetaServerSideFallback2026_07_01 AnthropicBeta = "server-side-fallback-2026-07-01"`

    - `const AnthropicBetaFallbackCredit2026_06_01 AnthropicBeta = "fallback-credit-2026-06-01"`

    - `const AnthropicBetaFallbackCredit2026_07_01 AnthropicBeta = "fallback-credit-2026-07-01"`

    - `const AnthropicBetaAgentMemory2026_07_22 AnthropicBeta = "agent-memory-2026-07-22"`

    - `const AnthropicBetaMidConversationToolChanges2026_07_01 AnthropicBeta = "mid-conversation-tool-changes-2026-07-01"`

    - `const AnthropicBetaCompact2026_01_12 AnthropicBeta = "compact-2026-01-12"`

    - `const AnthropicBetaComputerUse2025_11_24 AnthropicBeta = "computer-use-2025-11-24"`

    - `const AnthropicBetaMCPTunnels2026_06_22 AnthropicBeta = "mcp-tunnels-2026-06-22"`

    - `const AnthropicBetaStructuredOutputs2025_11_13 AnthropicBeta = "structured-outputs-2025-11-13"`

    - `const AnthropicBetaTaskBudgets2026_03_13 AnthropicBeta = "task-budgets-2026-03-13"`

    - `const AnthropicBetaThinkingDisplayUpdates2026_08_18 AnthropicBeta = "thinking-display-updates-2026-08-18"`

    - `const AnthropicBetaCEUserManagement2026_07_13 AnthropicBeta = "ce-user-management-2026-07-13"`

    - `const AnthropicBetaMidConversationOutputConfig2026_07_01 AnthropicBeta = "mid-conversation-output-config-2026-07-01"`

    - `const AnthropicBetaThinkingBindingControls2026_08_01 AnthropicBeta = "thinking-binding-controls-2026-08-01"`

    - `const AnthropicBetaMidConversationSystemClearAt2026_08_21 AnthropicBeta = "mid-conversation-system-clear-at-2026-08-21"`

    - `const AnthropicBetaCompact2026_09_04 AnthropicBeta = "compact-2026-09-04"`

    - `const AnthropicBetaInlineTools2026_09_15 AnthropicBeta = "inline-tools-2026-09-15"`

    - `const AnthropicBetaMCPClient2026_09_15 AnthropicBeta = "mcp-client-2026-09-15"`

    - `const AnthropicBetaCEPlugins2026_09_01 AnthropicBeta = "ce-plugins-2026-09-01"`

    - `const AnthropicBetaSpendLimitReads2026_09_26 AnthropicBeta = "spend-limit-reads-2026-09-26"`

    - `const AnthropicBetaTelemetryDestinations2026_08_11 AnthropicBeta = "telemetry-destinations-2026-08-11"`

  - `UserProfileID param.Opt[string] Optional` (header parameter)

    The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.

  - `WorkspaceID param.Opt[string] Optional` (header parameter)

    Optional header to select the Workspace for this request. The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).

    Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

  - `OutputFormat BetaJSONOutputFormatParam Optional`

    **Deprecated**

    Deprecated: Use `output_config.format` instead. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs?sdk_languages=go)

    A schema to specify Claude's output format in responses. This parameter will be removed in a future release.

## Returns

- `type BetaMessageTokensCount`

  - `ContextManagement BetaCountTokensContextManagementResponse`

    Information about context management applied to the message.

    - `OriginalInputTokens int64`

      The original token count before context management was applied

  - `InputTokens int64`

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

## Example

```go
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaMessageTokensCount, err := client.Beta.Messages.CountTokens(context.TODO(), anthropic.BetaMessageCountTokensParams{
		Messages: []anthropic.BetaMessageParam{anthropic.BetaMessageParam{
			Content: []anthropic.BetaContentBlockParamUnion{anthropic.BetaContentBlockParamUnion{
				OfText: &anthropic.BetaTextBlockParam{
					Text: "x",
				},
			}},
			Role: anthropic.BetaMessageParamRoleUser,
		}},
		Model: anthropic.ModelClaudeOpus5_5,
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaMessageTokensCount.ContextManagement)
}
```

### Response (200)

```json
{
  "context_management": {
    "original_input_tokens": 0
  },
  "input_tokens": 2095
}
```
