---
title: Beta
url: https://platform.claude.com/docs/en/api/go/beta
---

# Beta

## Domain types

### Anthropic Beta

- `type AnthropicBeta string`

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

### Beta API Error

- `type BetaAPIError`

  - `Type APIError`

    default: api_error

  - `Message string`

    default: Internal server error

### Beta Authentication Error

- `type BetaAuthenticationError`

  - `Type AuthenticationError`

    default: authentication_error

  - `Message string`

    default: Authentication error

### Beta Billing Error

- `type BetaBillingError`

  - `Type BillingError`

    default: billing_error

  - `Message string`

    default: Billing error

### Beta Currency

- `type BetaCurrency string`

### Beta Error

- `type BetaErrorUnion interface{…}`

  - `type BetaInvalidRequestError`

    - `Type InvalidRequestError`

      default: invalid_request_error

    - `Message string`

      default: Invalid request

  - `type BetaAuthenticationError`

    - `Type AuthenticationError`

      default: authentication_error

    - `Message string`

      default: Authentication error

  - `type BetaBillingError`

    - `Type BillingError`

      default: billing_error

    - `Message string`

      default: Billing error

  - `type BetaPermissionError`

    - `Type PermissionError`

      default: permission_error

    - `Message string`

      default: Permission denied

  - `type BetaNotFoundError`

    - `Type NotFoundError`

      default: not_found_error

    - `Message string`

      default: Not found

  - `type BetaRateLimitError`

    - `Type RateLimitError`

      default: rate_limit_error

    - `Message string`

      default: Rate limited

  - `type BetaGatewayTimeoutError`

    - `Type TimeoutError`

      default: timeout_error

    - `Message string`

      default: Request timeout

  - `type BetaAPIError`

    - `Type APIError`

      default: api_error

    - `Message string`

      default: Internal server error

  - `type BetaOverloadedError`

    - `Type OverloadedError`

      default: overloaded_error

    - `Message string`

      default: Overloaded

### Beta Error Response

- `type BetaErrorResponse`

  - `Type Error`

    default: error

  - `Error BetaErrorUnion`

    - `type BetaInvalidRequestError`

      - `Type InvalidRequestError`

        default: invalid_request_error

      - `Message string`

        default: Invalid request

    - `type BetaAuthenticationError`

      - `Type AuthenticationError`

        default: authentication_error

      - `Message string`

        default: Authentication error

    - `type BetaBillingError`

      - `Type BillingError`

        default: billing_error

      - `Message string`

        default: Billing error

    - `type BetaPermissionError`

      - `Type PermissionError`

        default: permission_error

      - `Message string`

        default: Permission denied

    - `type BetaNotFoundError`

      - `Type NotFoundError`

        default: not_found_error

      - `Message string`

        default: Not found

    - `type BetaRateLimitError`

      - `Type RateLimitError`

        default: rate_limit_error

      - `Message string`

        default: Rate limited

    - `type BetaGatewayTimeoutError`

      - `Type TimeoutError`

        default: timeout_error

      - `Message string`

        default: Request timeout

    - `type BetaAPIError`

      - `Type APIError`

        default: api_error

      - `Message string`

        default: Internal server error

    - `type BetaOverloadedError`

      - `Type OverloadedError`

        default: overloaded_error

      - `Message string`

        default: Overloaded

  - `RequestID string`

### Beta Gateway Timeout Error

- `type BetaGatewayTimeoutError`

  - `Type TimeoutError`

    default: timeout_error

  - `Message string`

    default: Request timeout

### Beta Invalid Request Error

- `type BetaInvalidRequestError`

  - `Type InvalidRequestError`

    default: invalid_request_error

  - `Message string`

    default: Invalid request

### Beta Monetary Amount

- `type BetaMonetaryAmount`

  A monetary amount in a specific currency.

  - `Amount string`

    Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

  - `Currency BetaCurrency`

    Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

### Beta Not Found Error

- `type BetaNotFoundError`

  - `Type NotFoundError`

    default: not_found_error

  - `Message string`

    default: Not found

### Beta Overloaded Error

- `type BetaOverloadedError`

  - `Type OverloadedError`

    default: overloaded_error

  - `Message string`

    default: Overloaded

### Beta Permission Error

- `type BetaPermissionError`

  - `Type PermissionError`

    default: permission_error

  - `Message string`

    default: Permission denied

### Beta Rate Limit Error

- `type BetaRateLimitError`

  - `Type RateLimitError`

    default: rate_limit_error

  - `Message string`

    default: Rate limited

## Beta › Models

### List Models

`client.Beta.Models.List(ctx, params) (*Page[BetaModelInfo], error)`

**GET** `/v1/models`

List available models.

The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.

#### Parameters

- `params BetaModelListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `Lifecycle []string Optional` (query parameter)

    Filter the list to models in any of the given lifecycle stages (`active`, `deprecated`, or `retired`). Up to 3 values. When omitted, the list contains the `active` and `deprecated` models; `retired` models appear only when `retired` is requested explicitly.

    maxItems: 3

    - `const BetaModelListParamsLifecycleActive BetaModelListParamsLifecycle = "active"`

    - `const BetaModelListParamsLifecycleDeprecated BetaModelListParamsLifecycle = "deprecated"`

    - `const BetaModelListParamsLifecycleRetired BetaModelListParamsLifecycle = "retired"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

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

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

#### Returns

- `type BetaModelInfo`

  - `Type Model`

    Object type.

    For Models, this is always `"model"`.

    default: model

  - `ID string`

    Unique model identifier.

  - `AllowedFallbackModels []string`

    Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An empty list means the `fallbacks` parameter is not supported for this model as primary.

  - `Capabilities BetaModelCapabilities`

    Object mapping capability names to their support details. Keys are always present for all known capabilities.

    - `Batch BetaCapabilitySupport`

      Whether the model supports the Batch API.

      - `Supported bool`

        Whether this capability is supported by the model.

    - `Citations BetaCapabilitySupport`

      Whether the model supports citation generation.

    - `CodeExecution BetaCapabilitySupport`

      Whether code that the model runs in the code execution tool can call the request's other tools, as in programmatic tool calling and dynamic filtering for web search and web fetch. Support for the code execution tool itself is in `server_tools.code_execution`.

    - `Compaction BetaCompactionCapability`

      Server-side compaction support (the top-level `compaction` parameter) and the accepted `compaction.type` values.

      - `Summarize BetaCapabilitySupport`

        Whether the summarize compaction type is supported.

      - `Supported bool`

        Whether this capability is supported by the model.

    - `ContextManagement BetaContextManagementCapability`

      Context management support and available strategies.

      - `ClearThinking20251015 BetaCapabilitySupport`

        Whether the clear_thinking_20251015 strategy is supported.

      - `ClearToolUses20250919 BetaCapabilitySupport`

        Whether the clear_tool_uses_20250919 strategy is supported.

      - `Compact20260112 BetaCapabilitySupport`

        Whether the compact_20260112 strategy is supported.

      - `Supported bool`

        Whether this capability is supported by the model.

    - `Effort BetaEffortCapability`

      Effort (reasoning_effort) support and available levels.

      - `High BetaCapabilitySupport`

        Whether the model supports high effort level.

      - `Low BetaCapabilitySupport`

        Whether the model supports low effort level.

      - `Max BetaCapabilitySupport`

        Whether the model supports max effort level.

      - `Medium BetaCapabilitySupport`

        Whether the model supports medium effort level.

      - `Supported bool`

        Whether this capability is supported by the model.

      - `Xhigh BetaCapabilitySupport`

        Whether the model supports xhigh effort level.

    - `ImageInput BetaCapabilitySupport`

      Whether the model accepts image content blocks.

    - `PDFInput BetaCapabilitySupport`

      Whether the model accepts PDF content blocks.

    - `ServerTools BetaServerToolsCapability`

      Whether this model supports the web search and code execution server tools. `supported` is true when the model supports at least one of the tools. A supported tool can still be rejected for your organization, for example when an admin has turned web search off.

      - `CodeExecution BetaCapabilitySupport`

        Whether the model supports the code execution tool: true when the model supports at least one version of the tool, not necessarily every version.

      - `Supported bool`

        Whether this capability is supported by the model.

      - `WebSearch BetaCapabilitySupport`

        Whether the model supports the web search tool: true when the model supports at least one version of the tool, not necessarily every version.

    - `StructuredOutputs BetaCapabilitySupport`

      Whether the model supports structured output / JSON mode / strict tool schemas.

    - `Thinking BetaThinkingCapability`

      Thinking capability and supported type configurations.

      - `Supported bool`

        Whether this capability is supported by the model.

      - `Types BetaThinkingTypes`

        Supported thinking type configurations.

        - `Adaptive BetaCapabilitySupport`

          Whether the model accepts thinking with type 'adaptive' (the model decides whether and how much to think).

        - `Disabled BetaCapabilitySupport`

          Whether the model accepts thinking with type 'disabled' (thinking turned off). False exactly when a request that sends it gets a 400 from this model. True on a model that does not support thinking.

        - `Enabled BetaCapabilitySupport`

          Whether the model accepts thinking with type 'enabled' (extended thinking with a caller-set `budget_tokens`).

  - `CreatedAt Time`

    RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.

    format: date-time

  - `DeprecatedAt Time`

    RFC 3339 datetime string representing the time of the model's most recent deprecation. Populated for `deprecated` and `retired` models; `null` while the model is `active`.

    format: date-time

  - `DisplayName string`

    A human-readable name for the model.

  - `Lifecycle BetaModelInfoLifecycle`

    The model's current lifecycle stage.

    - `active`: The model is available for use, open to new adopters, and not scheduled for retirement.
    - `deprecated`: The model remains callable for organizations with existing access, but is headed for retirement and closed to new adopters.
    - `retired`: The model is no longer available for use; inference requests naming it fail. It remains in the catalogue as the historical record of its retirement.

    default: active

    - `const BetaModelInfoLifecycleActive BetaModelInfoLifecycle = "active"`

    - `const BetaModelInfoLifecycleDeprecated BetaModelInfoLifecycle = "deprecated"`

    - `const BetaModelInfoLifecycleRetired BetaModelInfoLifecycle = "retired"`

  - `Line BetaModelLine`

    The model line this model belongs to, such as `opus` for both Claude Opus 4.5 and Claude Opus 4.6. More lines may be added. `null` when the model belongs to no line; do not infer a line from the `id`.

    - `const BetaModelLineHaiku BetaModelLine = "haiku"`

    - `const BetaModelLineSonnet BetaModelLine = "sonnet"`

    - `const BetaModelLineOpus BetaModelLine = "opus"`

    - `const BetaModelLineFable BetaModelLine = "fable"`

    - `const BetaModelLineMythos BetaModelLine = "mythos"`

  - `MaxInputTokens int64`

    Maximum input context window size in tokens for this model.

  - `MaxTokens int64`

    Maximum value for the `max_tokens` parameter when using this model.

  - `RetiresAt Time`

    RFC 3339 datetime string representing the model's currently scheduled retirement date. The schedule can be revised until retirement occurs; `null` while the model is `active` or while no retirement is scheduled. A past date on a `deprecated` model means retirement is overdue, not that it has occurred: `lifecycle` is the retirement signal.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Models.List(context.TODO(), anthropic.BetaModelListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "claude-opus-5-5",
      "allowed_fallback_models": [
        "string"
      ],
      "capabilities": {
        "batch": {
          "supported": true
        },
        "citations": {
          "supported": true
        },
        "code_execution": {
          "supported": true
        },
        "compaction": {
          "summarize": {
            "supported": true
          },
          "supported": true
        },
        "context_management": {
          "clear_thinking_20251015": {
            "supported": true
          },
          "clear_tool_uses_20250919": {
            "supported": true
          },
          "compact_20260112": {
            "supported": true
          },
          "supported": true
        },
        "effort": {
          "high": {
            "supported": true
          },
          "low": {
            "supported": true
          },
          "max": {
            "supported": true
          },
          "medium": {
            "supported": true
          },
          "supported": true,
          "xhigh": {
            "supported": true
          }
        },
        "image_input": {
          "supported": true
        },
        "pdf_input": {
          "supported": true
        },
        "server_tools": {
          "code_execution": {
            "supported": true
          },
          "supported": true,
          "web_search": {
            "supported": true
          }
        },
        "structured_outputs": {
          "supported": true
        },
        "thinking": {
          "supported": true,
          "types": {
            "adaptive": {
              "supported": true
            },
            "disabled": {
              "supported": true
            },
            "enabled": {
              "supported": true
            }
          }
        }
      },
      "created_at": "2026-09-21T00:00:00Z",
      "deprecated_at": "2019-12-27T18:11:19.117Z",
      "display_name": "Claude Opus 5.5",
      "lifecycle": "active",
      "line": "haiku",
      "max_input_tokens": 0,
      "max_tokens": 0,
      "retires_at": "2019-12-27T18:11:19.117Z",
      "type": "model"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Get a Model

`client.Beta.Models.Get(ctx, modelID, query) (*BetaModelInfo, error)`

**GET** `/v1/models/{model_id}`

Get a specific model.

The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.

#### Parameters

- `modelID string` (path parameter)

  Model identifier or alias.

- `query BetaModelGetParams`

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

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

#### Returns

- `type BetaModelInfo`

  - `Type Model`

    Object type.

    For Models, this is always `"model"`.

    default: model

  - `ID string`

    Unique model identifier.

  - `AllowedFallbackModels []string`

    Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An empty list means the `fallbacks` parameter is not supported for this model as primary.

  - `Capabilities BetaModelCapabilities`

    Object mapping capability names to their support details. Keys are always present for all known capabilities.

    - `Batch BetaCapabilitySupport`

      Whether the model supports the Batch API.

      - `Supported bool`

        Whether this capability is supported by the model.

    - `Citations BetaCapabilitySupport`

      Whether the model supports citation generation.

    - `CodeExecution BetaCapabilitySupport`

      Whether code that the model runs in the code execution tool can call the request's other tools, as in programmatic tool calling and dynamic filtering for web search and web fetch. Support for the code execution tool itself is in `server_tools.code_execution`.

    - `Compaction BetaCompactionCapability`

      Server-side compaction support (the top-level `compaction` parameter) and the accepted `compaction.type` values.

      - `Summarize BetaCapabilitySupport`

        Whether the summarize compaction type is supported.

      - `Supported bool`

        Whether this capability is supported by the model.

    - `ContextManagement BetaContextManagementCapability`

      Context management support and available strategies.

      - `ClearThinking20251015 BetaCapabilitySupport`

        Whether the clear_thinking_20251015 strategy is supported.

      - `ClearToolUses20250919 BetaCapabilitySupport`

        Whether the clear_tool_uses_20250919 strategy is supported.

      - `Compact20260112 BetaCapabilitySupport`

        Whether the compact_20260112 strategy is supported.

      - `Supported bool`

        Whether this capability is supported by the model.

    - `Effort BetaEffortCapability`

      Effort (reasoning_effort) support and available levels.

      - `High BetaCapabilitySupport`

        Whether the model supports high effort level.

      - `Low BetaCapabilitySupport`

        Whether the model supports low effort level.

      - `Max BetaCapabilitySupport`

        Whether the model supports max effort level.

      - `Medium BetaCapabilitySupport`

        Whether the model supports medium effort level.

      - `Supported bool`

        Whether this capability is supported by the model.

      - `Xhigh BetaCapabilitySupport`

        Whether the model supports xhigh effort level.

    - `ImageInput BetaCapabilitySupport`

      Whether the model accepts image content blocks.

    - `PDFInput BetaCapabilitySupport`

      Whether the model accepts PDF content blocks.

    - `ServerTools BetaServerToolsCapability`

      Whether this model supports the web search and code execution server tools. `supported` is true when the model supports at least one of the tools. A supported tool can still be rejected for your organization, for example when an admin has turned web search off.

      - `CodeExecution BetaCapabilitySupport`

        Whether the model supports the code execution tool: true when the model supports at least one version of the tool, not necessarily every version.

      - `Supported bool`

        Whether this capability is supported by the model.

      - `WebSearch BetaCapabilitySupport`

        Whether the model supports the web search tool: true when the model supports at least one version of the tool, not necessarily every version.

    - `StructuredOutputs BetaCapabilitySupport`

      Whether the model supports structured output / JSON mode / strict tool schemas.

    - `Thinking BetaThinkingCapability`

      Thinking capability and supported type configurations.

      - `Supported bool`

        Whether this capability is supported by the model.

      - `Types BetaThinkingTypes`

        Supported thinking type configurations.

        - `Adaptive BetaCapabilitySupport`

          Whether the model accepts thinking with type 'adaptive' (the model decides whether and how much to think).

        - `Disabled BetaCapabilitySupport`

          Whether the model accepts thinking with type 'disabled' (thinking turned off). False exactly when a request that sends it gets a 400 from this model. True on a model that does not support thinking.

        - `Enabled BetaCapabilitySupport`

          Whether the model accepts thinking with type 'enabled' (extended thinking with a caller-set `budget_tokens`).

  - `CreatedAt Time`

    RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown.

    format: date-time

  - `DeprecatedAt Time`

    RFC 3339 datetime string representing the time of the model's most recent deprecation. Populated for `deprecated` and `retired` models; `null` while the model is `active`.

    format: date-time

  - `DisplayName string`

    A human-readable name for the model.

  - `Lifecycle BetaModelInfoLifecycle`

    The model's current lifecycle stage.

    - `active`: The model is available for use, open to new adopters, and not scheduled for retirement.
    - `deprecated`: The model remains callable for organizations with existing access, but is headed for retirement and closed to new adopters.
    - `retired`: The model is no longer available for use; inference requests naming it fail. It remains in the catalogue as the historical record of its retirement.

    default: active

    - `const BetaModelInfoLifecycleActive BetaModelInfoLifecycle = "active"`

    - `const BetaModelInfoLifecycleDeprecated BetaModelInfoLifecycle = "deprecated"`

    - `const BetaModelInfoLifecycleRetired BetaModelInfoLifecycle = "retired"`

  - `Line BetaModelLine`

    The model line this model belongs to, such as `opus` for both Claude Opus 4.5 and Claude Opus 4.6. More lines may be added. `null` when the model belongs to no line; do not infer a line from the `id`.

    - `const BetaModelLineHaiku BetaModelLine = "haiku"`

    - `const BetaModelLineSonnet BetaModelLine = "sonnet"`

    - `const BetaModelLineOpus BetaModelLine = "opus"`

    - `const BetaModelLineFable BetaModelLine = "fable"`

    - `const BetaModelLineMythos BetaModelLine = "mythos"`

  - `MaxInputTokens int64`

    Maximum input context window size in tokens for this model.

  - `MaxTokens int64`

    Maximum value for the `max_tokens` parameter when using this model.

  - `RetiresAt Time`

    RFC 3339 datetime string representing the model's currently scheduled retirement date. The schedule can be revised until retirement occurs; `null` while the model is `active` or while no retirement is scheduled. A past date on a `deprecated` model means retirement is overdue, not that it has occurred: `lifecycle` is the retirement signal.

    format: date-time

#### 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"),
	)
	betaModelInfo, err := client.Beta.Models.Get(
		context.TODO(),
		"model_id",
		anthropic.BetaModelGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaModelInfo.ID)
}
```

##### Response (200)

```json
{
  "id": "claude-opus-5-5",
  "allowed_fallback_models": [
    "string"
  ],
  "capabilities": {
    "batch": {
      "supported": true
    },
    "citations": {
      "supported": true
    },
    "code_execution": {
      "supported": true
    },
    "compaction": {
      "summarize": {
        "supported": true
      },
      "supported": true
    },
    "context_management": {
      "clear_thinking_20251015": {
        "supported": true
      },
      "clear_tool_uses_20250919": {
        "supported": true
      },
      "compact_20260112": {
        "supported": true
      },
      "supported": true
    },
    "effort": {
      "high": {
        "supported": true
      },
      "low": {
        "supported": true
      },
      "max": {
        "supported": true
      },
      "medium": {
        "supported": true
      },
      "supported": true,
      "xhigh": {
        "supported": true
      }
    },
    "image_input": {
      "supported": true
    },
    "pdf_input": {
      "supported": true
    },
    "server_tools": {
      "code_execution": {
        "supported": true
      },
      "supported": true,
      "web_search": {
        "supported": true
      }
    },
    "structured_outputs": {
      "supported": true
    },
    "thinking": {
      "supported": true,
      "types": {
        "adaptive": {
          "supported": true
        },
        "disabled": {
          "supported": true
        },
        "enabled": {
          "supported": true
        }
      }
    }
  },
  "created_at": "2026-09-21T00:00:00Z",
  "deprecated_at": "2019-12-27T18:11:19.117Z",
  "display_name": "Claude Opus 5.5",
  "lifecycle": "active",
  "line": "haiku",
  "max_input_tokens": 0,
  "max_tokens": 0,
  "retires_at": "2019-12-27T18:11:19.117Z",
  "type": "model"
}
```

## Beta › Messages

### Create a Message

`client.Beta.Messages.New(ctx, params) (*BetaMessage, error)`

**POST** `/v1/messages`

Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.

The Messages API can be used for either single queries or stateless multi-turn conversations.

Learn more about the Messages API in our [user guide](https://platform.claude.com/docs/en/get-started?sdk_languages=go)

#### Parameters

- `params BetaMessageNewParams`

  - `MaxTokens int64`

    The maximum number of tokens to generate before stopping.

    Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.

    Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=go#pre-warming-the-cache) without generating a response.

    Different models have different maximum values for this parameter.  See [models](https://platform.claude.com/docs/en/about-claude/models/overview?sdk_languages=go) for details.

    minimum: 0

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

  - `Container BetaMessageNewParamsContainerUnion Optional`

    Container identifier for reuse across requests.

    - `type BetaContainerParams`

      Container parameters with skills to be loaded.

      - `ID string Optional`

        Container id

      - `Skills []BetaSkillParams Optional`

        List of skills to load in the container

        maxItems: 20

        - `Type BetaSkillParamsType`

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

          - `const BetaSkillParamsTypeAnthropic BetaSkillParamsType = "anthropic"`

          - `const BetaSkillParamsTypeCustom BetaSkillParamsType = "custom"`

        - `SkillID string`

          Skill ID

          minLength: 1, maxLength: 64

        - `Version string Optional`

          Skill version or 'latest' for most recent version

          minLength: 1, maxLength: 64

    - `string`

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

  - `Diagnostics BetaDiagnosticsParam Optional`

    Request-level diagnostics. Supply `previous_message_id` to have the response include `diagnostics.cache_miss_reason` explaining any prompt-cache divergence from that prior request.

  - `FallbackCreditToken BetaMessageNewParamsFallbackCreditTokenUnion Optional`

    The `fallback_credit_token` from a prior refusal's `stop_details`.

    When a preceding request was refused and returned a `fallback_credit_token`,
    pass that code here on the retry to have the retry's cache-creation tokens
    for the prefix that was warm on the refused model billed at the cache-read
    rate. Must be redeemed by the same organization and workspace, with the same
    request body (optionally extended by one appended `assistant` message whose
    content is the partial text — with any trailing whitespace stripped from
    the final text block — and paired server-tool blocks streamed before the
    refusal; the appended-assistant form is not available for requests with
    `output_format` set or forced `tool_choice`), on an eligible fallback
    model, on the same platform,
    and within 5 minutes of the refusal; a mismatch is a 400. A token minted
    mid-server-tool-loop whose partial content was continuable may only be
    redeemed with the appended-assistant form — if an exact-body retry is
    rejected with a 400 saying the token must be redeemed by continuing the
    partial response, retry with the appended-assistant form instead.

    When the appended-assistant form is used on a model that otherwise disallows
    assistant-turn prefill, this token also authorizes that one prefill.

    - `string`

    - `type BetaFallbackCreditTokenParam`

      Object form of `fallback_credit_token`: the token plus a redemption
      mode.

      Requires `anthropic-beta: fallback-credit-2026-07-01`; without that
      header the field accepts the bare string only. The bare string and the
      mode-less object are equivalent (both select `strict`), so wrapping
      an existing token changes nothing by itself.

      - `Token string`

        The opaque `fallback_credit_token` from a prior refusal's `stop_details` — the same string the bare-string form carries.

        minLength: 1, maxLength: 2048

      - `Mode BetaFallbackCreditTokenParamMode Optional`

        How a failing token affects the retry. `strict` (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. `best_effort`: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's `usage.fallback_credit`. Two failures stay hard in both modes: a malformed token, and combining `fallback_credit_token` with `fallbacks`.

        - `const BetaFallbackCreditTokenParamModeStrict BetaFallbackCreditTokenParamMode = "strict"`

        - `const BetaFallbackCreditTokenParamModeBestEffort BetaFallbackCreditTokenParamMode = "best_effort"`

  - `Fallbacks BetaFallbacksParamUnion Optional`

    Opt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. Some models don't support fallbacks; on those models, a list of fallback models returns a 400 error. See [Server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback?sdk_languages=go#server-side-fallback). The string "default" requests the requested model's server-defined default fallback configuration. On a model that doesn't support fallbacks, the request runs on the requested model alone, so a declined request stays declined.

  - `InferenceGeo param.Opt[string] Optional`

    Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.

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

  - `Metadata BetaMetadataParam Optional`

    An object describing metadata about the request.

  - `OutputConfig BetaOutputConfigParam Optional`

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

  - `ServiceTier BetaMessageNewParamsServiceTier Optional`

    Determines whether to use priority capacity (if available) or standard capacity for this request.

    Anthropic offers different levels of service for your API requests. See [service-tiers](https://platform.claude.com/docs/en/api/service-tiers?sdk_languages=go) for details.

    - `const BetaMessageNewParamsServiceTierAuto BetaMessageNewParamsServiceTier = "auto"`

    - `const BetaMessageNewParamsServiceTierStandardOnly BetaMessageNewParamsServiceTier = "standard_only"`

  - `Speed BetaMessageNewParamsSpeed 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 BetaMessageNewParamsSpeedStandard BetaMessageNewParamsSpeed = "standard"`

    - `const BetaMessageNewParamsSpeedFast BetaMessageNewParamsSpeed = "fast"`

  - `StopSequences []string Optional`

    Custom text sequences that will cause the model to stop generating.

    Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.

    If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.

  - `System []BetaTextBlockParam 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).

    - `[]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 []BetaToolUnionParam 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.

  - `Temperature param.Opt[float64] Optional`

    **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.

    Amount of randomness injected into the response.

    Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.

    Note that even with `temperature` of `0.0`, the results will not be fully deterministic.

    minimum: 0, maximum: 1

  - `TopK param.Opt[int64] Optional`

    **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.

    Only sample from the top K options for each subsequent token.

    Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).

    Recommended for advanced use cases only.

    minimum: 0

  - `TopP param.Opt[float64] Optional`

    **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.

    Use nucleus sampling.

    In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.

    Recommended for advanced use cases only.

    minimum: 0, maximum: 1

#### Returns

- `type BetaMessage`

  - `Type Message`

    Object type.

    For Messages, this is always `"message"`.

    default: message

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `Container BetaContainer`

    Information about the container used in this request.

    This will be non-null if a container tool (e.g. code execution) was used.

    - `ID string`

      Identifier for the container used in this request

    - `ExpiresAt Time`

      The time at which the container will expire.

      format: date-time

    - `Skills []BetaContainerSkill`

      Skills loaded in the container

      - `Type BetaContainerSkillType`

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

        - `const BetaContainerSkillTypeAnthropic BetaContainerSkillType = "anthropic"`

        - `const BetaContainerSkillTypeCustom BetaContainerSkillType = "custom"`

      - `SkillID string`

        Skill ID

        minLength: 1, maxLength: 64

      - `Version string`

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

        minLength: 1, maxLength: 64

  - `Content []BetaContentBlockUnion`

    Content generated by the model.

    This is an array of content blocks, each of which has a `type` that determines its shape.

    Example:

    ```json
    [{"type": "text", "text": "Hi, I'm Claude."}]
    ```

    If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.

    For example, if the input `messages` were:

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

    Then the response `content` might be:

    ```json
    [{"type": "text", "text": "B)"}]
    ```

    - `type BetaTextBlock`

      - `Type Text`

        default: text

      - `Citations []BetaTextCitationUnion`

        Citations supporting the text block.

        The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.

        - `type BetaCitationCharLocation`

          - `Type CharLocation`

            default: char_location

          - `CitedText string`

          - `DocumentIndex int64`

            minimum: 0

          - `DocumentTitle string`

          - `EndCharIndex int64`

          - `FileID string`

          - `StartCharIndex int64`

            minimum: 0

        - `type BetaCitationPageLocation`

          - `Type PageLocation`

            default: page_location

          - `CitedText string`

          - `DocumentIndex int64`

            minimum: 0

          - `DocumentTitle string`

          - `EndPageNumber int64`

          - `FileID string`

          - `StartPageNumber int64`

            minimum: 1

        - `type BetaCitationContentBlockLocation`

          - `Type ContentBlockLocation`

            default: content_block_location

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

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

          - `FileID string`

          - `StartBlockIndex int64`

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

            minimum: 0

        - `type BetaCitationsWebSearchResultLocation`

          - `Type WebSearchResultLocation`

            default: web_search_result_location

          - `CitedText string`

          - `EncryptedIndex string`

          - `Title string`

            maxLength: 512

          - `URL string`

        - `type BetaCitationSearchResultLocation`

          - `Type SearchResultLocation`

            default: search_result_location

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

      - `Text string`

    - `type BetaThinkingBlock`

      - `Type Thinking`

        default: thinking

      - `Signature string`

        A value used to verify that this thinking block was generated by Claude when it is passed back to the API.

        This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.

        See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking?sdk_languages=go) for details.

      - `Thinking string`

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

    - `type BetaRedactedThinkingBlock`

      - `Type RedactedThinking`

        default: redacted_thinking

      - `Data string`

        The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.

        Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.

        See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking?sdk_languages=go#redacted-thinking-blocks) for details.

    - `type BetaToolUseBlock`

      - `Type ToolUse`

        default: tool_use

      - `ID string`

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

      - `Input map[string, any]`

      - `Name string`

        minLength: 1

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

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

    - `type BetaServerToolUseBlock`

      - `Type ServerToolUse`

        default: server_tool_use

      - `ID string`

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

      - `Input map[string, any]`

      - `Name BetaServerToolUseBlockName`

        - `const BetaServerToolUseBlockNameAdvisor BetaServerToolUseBlockName = "advisor"`

        - `const BetaServerToolUseBlockNameWebSearch BetaServerToolUseBlockName = "web_search"`

        - `const BetaServerToolUseBlockNameWebFetch BetaServerToolUseBlockName = "web_fetch"`

        - `const BetaServerToolUseBlockNameCodeExecution BetaServerToolUseBlockName = "code_execution"`

        - `const BetaServerToolUseBlockNameBashCodeExecution BetaServerToolUseBlockName = "bash_code_execution"`

        - `const BetaServerToolUseBlockNameTextEditorCodeExecution BetaServerToolUseBlockName = "text_editor_code_execution"`

        - `const BetaServerToolUseBlockNameToolSearchToolRegex BetaServerToolUseBlockName = "tool_search_tool_regex"`

        - `const BetaServerToolUseBlockNameToolSearchToolBm25 BetaServerToolUseBlockName = "tool_search_tool_bm25"`

      - `Caller BetaServerToolUseBlockCallerUnion Optional`

        - `type BetaDirectCaller`

          Tool invocation directly from the model.

        - `type BetaServerToolCaller`

          Tool invocation generated by a server-side tool.

        - `type BetaServerToolCaller20260120`

    - `type BetaWebSearchToolResultBlock`

      - `Type WebSearchToolResult`

        default: web_search_tool_result

      - `Content BetaWebSearchToolResultBlockContentUnion`

        - `type BetaWebSearchToolResultError`

          - `Type WebSearchToolResultError`

            default: web_search_tool_result_error

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

        - `[]BetaWebSearchResultBlock`

          - `Type WebSearchResult`

            default: web_search_result

          - `EncryptedContent string`

          - `PageAge string`

          - `Title string`

          - `URL string`

      - `ToolUseID string`

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

      - `Caller BetaWebSearchToolResultBlockCallerUnion Optional`

        - `type BetaDirectCaller`

          Tool invocation directly from the model.

        - `type BetaServerToolCaller`

          Tool invocation generated by a server-side tool.

        - `type BetaServerToolCaller20260120`

    - `type BetaWebFetchToolResultBlock`

      - `Type WebFetchToolResult`

        default: web_fetch_tool_result

      - `Content BetaWebFetchToolResultBlockContentUnion`

        - `type BetaWebFetchToolResultErrorBlock`

          - `Type WebFetchToolResultError`

            default: web_fetch_tool_result_error

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

          - `Type WebFetchResult`

            default: web_fetch_result

          - `Content BetaDocumentBlock`

            - `Type Document`

              default: document

            - `Citations BetaCitationConfig`

              Citation configuration for the document

              - `Enabled bool`

                default: false

            - `Source BetaDocumentBlockSourceUnion`

              - `type BetaBase64PDFSource`

                - `Type Base64`

                - `Data string`

                  format: byte

                - `MediaType ApplicationPDF`

              - `type BetaPlainTextSource`

                - `Type Text`

                - `Data string`

                - `MediaType TextPlain`

            - `Title string`

              The title of the document

          - `RetrievedAt string`

            ISO 8601 timestamp when the content was retrieved

          - `URL string`

            Fetched content URL

      - `ToolUseID string`

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

      - `Caller BetaWebFetchToolResultBlockCallerUnion Optional`

        - `type BetaDirectCaller`

          Tool invocation directly from the model.

        - `type BetaServerToolCaller`

          Tool invocation generated by a server-side tool.

        - `type BetaServerToolCaller20260120`

    - `type BetaAdvisorToolResultBlock`

      - `Type AdvisorToolResult`

        default: advisor_tool_result

      - `Content BetaAdvisorToolResultBlockContentUnion`

        - `type BetaAdvisorToolResultError`

          - `Type AdvisorToolResultError`

            default: advisor_tool_result_error

          - `ErrorCode BetaAdvisorToolResultErrorErrorCode`

            - `const BetaAdvisorToolResultErrorErrorCodeMaxUsesExceeded BetaAdvisorToolResultErrorErrorCode = "max_uses_exceeded"`

            - `const BetaAdvisorToolResultErrorErrorCodePromptTooLong BetaAdvisorToolResultErrorErrorCode = "prompt_too_long"`

            - `const BetaAdvisorToolResultErrorErrorCodeTooManyRequests BetaAdvisorToolResultErrorErrorCode = "too_many_requests"`

            - `const BetaAdvisorToolResultErrorErrorCodeOverloaded BetaAdvisorToolResultErrorErrorCode = "overloaded"`

            - `const BetaAdvisorToolResultErrorErrorCodeUnavailable BetaAdvisorToolResultErrorErrorCode = "unavailable"`

            - `const BetaAdvisorToolResultErrorErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorErrorCode = "execution_time_exceeded"`

            - `const BetaAdvisorToolResultErrorErrorCodeModelNotFound BetaAdvisorToolResultErrorErrorCode = "model_not_found"`

        - `type BetaAdvisorResultBlock`

          - `Type AdvisorResult`

            default: advisor_result

          - `StopReason string`

            The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`). `max_tokens` indicates the advisor's output was truncated at the tool's `max_tokens` value or the advisor model's policy cap.

          - `Text string`

        - `type BetaAdvisorRedactedResultBlock`

          - `Type AdvisorRedactedResult`

            default: advisor_redacted_result

          - `EncryptedContent string`

            Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.

          - `StopReason string`

            The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).

      - `ToolUseID string`

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

    - `type BetaCodeExecutionToolResultBlock`

      - `Type CodeExecutionToolResult`

        default: code_execution_tool_result

      - `Content BetaCodeExecutionToolResultBlockContentUnion`

        - `type BetaCodeExecutionToolResultError`

          - `Type CodeExecutionToolResultError`

            default: code_execution_tool_result_error

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

          - `Type CodeExecutionResult`

            default: code_execution_result

          - `Content []BetaCodeExecutionOutputBlock`

            - `Type CodeExecutionOutput`

              default: code_execution_output

            - `FileID string`

          - `ReturnCode int64`

          - `Stderr string`

          - `Stdout string`

        - `type BetaEncryptedCodeExecutionResultBlock`

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

          - `Type EncryptedCodeExecutionResult`

            default: encrypted_code_execution_result

          - `Content []BetaCodeExecutionOutputBlock`

            - `Type CodeExecutionOutput`

              default: code_execution_output

            - `FileID string`

          - `EncryptedStdout string`

          - `ReturnCode int64`

          - `Stderr string`

      - `ToolUseID string`

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

    - `type BetaBashCodeExecutionToolResultBlock`

      - `Type BashCodeExecutionToolResult`

        default: bash_code_execution_tool_result

      - `Content BetaBashCodeExecutionToolResultBlockContentUnion`

        - `type BetaBashCodeExecutionToolResultError`

          - `Type BashCodeExecutionToolResultError`

            default: bash_code_execution_tool_result_error

          - `ErrorCode BetaBashCodeExecutionToolResultErrorErrorCode`

            - `const BetaBashCodeExecutionToolResultErrorErrorCodeInvalidToolInput BetaBashCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"`

            - `const BetaBashCodeExecutionToolResultErrorErrorCodeUnavailable BetaBashCodeExecutionToolResultErrorErrorCode = "unavailable"`

            - `const BetaBashCodeExecutionToolResultErrorErrorCodeTooManyRequests BetaBashCodeExecutionToolResultErrorErrorCode = "too_many_requests"`

            - `const BetaBashCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"`

            - `const BetaBashCodeExecutionToolResultErrorErrorCodeOutputFileTooLarge BetaBashCodeExecutionToolResultErrorErrorCode = "output_file_too_large"`

        - `type BetaBashCodeExecutionResultBlock`

          - `Type BashCodeExecutionResult`

            default: bash_code_execution_result

          - `Content []BetaBashCodeExecutionOutputBlock`

            - `Type BashCodeExecutionOutput`

              default: bash_code_execution_output

            - `FileID string`

          - `ReturnCode int64`

          - `Stderr string`

          - `Stdout string`

      - `ToolUseID string`

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

    - `type BetaTextEditorCodeExecutionToolResultBlock`

      - `Type TextEditorCodeExecutionToolResult`

        default: text_editor_code_execution_tool_result

      - `Content BetaTextEditorCodeExecutionToolResultBlockContentUnion`

        - `type BetaTextEditorCodeExecutionToolResultError`

          - `Type TextEditorCodeExecutionToolResultError`

            default: text_editor_code_execution_tool_result_error

          - `ErrorCode BetaTextEditorCodeExecutionToolResultErrorErrorCode`

            - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeInvalidToolInput BetaTextEditorCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"`

            - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeUnavailable BetaTextEditorCodeExecutionToolResultErrorErrorCode = "unavailable"`

            - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeTooManyRequests BetaTextEditorCodeExecutionToolResultErrorErrorCode = "too_many_requests"`

            - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"`

            - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeFileNotFound BetaTextEditorCodeExecutionToolResultErrorErrorCode = "file_not_found"`

          - `ErrorMessage string`

        - `type BetaTextEditorCodeExecutionViewResultBlock`

          - `Type TextEditorCodeExecutionViewResult`

            default: text_editor_code_execution_view_result

          - `Content string`

          - `FileType BetaTextEditorCodeExecutionViewResultBlockFileType`

            - `const BetaTextEditorCodeExecutionViewResultBlockFileTypeText BetaTextEditorCodeExecutionViewResultBlockFileType = "text"`

            - `const BetaTextEditorCodeExecutionViewResultBlockFileTypeImage BetaTextEditorCodeExecutionViewResultBlockFileType = "image"`

            - `const BetaTextEditorCodeExecutionViewResultBlockFileTypePDF BetaTextEditorCodeExecutionViewResultBlockFileType = "pdf"`

          - `NumLines int64`

          - `StartLine int64`

          - `TotalLines int64`

        - `type BetaTextEditorCodeExecutionCreateResultBlock`

          - `Type TextEditorCodeExecutionCreateResult`

            default: text_editor_code_execution_create_result

          - `IsFileUpdate bool`

        - `type BetaTextEditorCodeExecutionStrReplaceResultBlock`

          - `Type TextEditorCodeExecutionStrReplaceResult`

            default: text_editor_code_execution_str_replace_result

          - `Lines []string`

          - `NewLines int64`

          - `NewStart int64`

          - `OldLines int64`

          - `OldStart int64`

      - `ToolUseID string`

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

    - `type BetaToolSearchToolResultBlock`

      - `Type ToolSearchToolResult`

        default: tool_search_tool_result

      - `Content BetaToolSearchToolResultBlockContentUnion`

        - `type BetaToolSearchToolResultError`

          - `Type ToolSearchToolResultError`

            default: tool_search_tool_result_error

          - `ErrorCode BetaToolSearchToolResultErrorErrorCode`

            - `const BetaToolSearchToolResultErrorErrorCodeInvalidToolInput BetaToolSearchToolResultErrorErrorCode = "invalid_tool_input"`

            - `const BetaToolSearchToolResultErrorErrorCodeUnavailable BetaToolSearchToolResultErrorErrorCode = "unavailable"`

            - `const BetaToolSearchToolResultErrorErrorCodeTooManyRequests BetaToolSearchToolResultErrorErrorCode = "too_many_requests"`

            - `const BetaToolSearchToolResultErrorErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorErrorCode = "execution_time_exceeded"`

          - `ErrorMessage string`

        - `type BetaToolSearchToolSearchResultBlock`

          - `Type ToolSearchToolSearchResult`

            default: tool_search_tool_search_result

          - `ToolReferences []BetaToolReferenceBlock`

            - `Type ToolReference`

              default: tool_reference

            - `ToolName string`

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

      - `ToolUseID string`

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

    - `type BetaMCPToolUseBlock`

      - `Type MCPToolUse`

        default: mcp_tool_use

      - `ID string`

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

      - `Input map[string, any]`

      - `Name string`

        The name of the MCP tool

      - `ServerName string`

        The name of the MCP server

    - `type BetaMCPToolResultBlock`

      - `Type MCPToolResult`

        default: mcp_tool_result

      - `Content BetaMCPToolResultBlockContentUnion`

        - `string`

        - `[]BetaTextBlock`

          - `Type Text`

            default: text

          - `Citations []BetaTextCitationUnion`

            Citations supporting the text block.

            The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.

          - `Text string`

      - `IsError bool`

        default: false

      - `ToolUseID string`

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

    - `type BetaContainerUploadBlock`

      Response model for a file uploaded to the container.

      - `Type ContainerUpload`

        default: container_upload

      - `FileID string`

    - `type BetaCompactionBlock`

      A compaction block returned when autocompact is triggered.

      When content is None, it indicates the compaction failed to produce a valid
      summary (e.g., malformed output from the model). Clients may round-trip
      compaction blocks with null content; the server treats them as no-ops.

      - `Type Compaction`

        default: compaction

      - `Content string`

        Summary of compacted content, or null if compaction failed

      - `EncryptedContent string`

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

      - `Signature string Optional`

        Signature over the summary, to be sent back with the block verbatim

      - `ToolChanges []BetaCompactionBlockToolChangeUnion Optional`

        The tool changes of the compacted range: the `tool_addition` and `tool_removal` blocks that take the request's `tools` to the tool set in effect at the end of the range, or `[]` when the range changed no tool. Absent when the server did not compute them. Send the block back unchanged.

        - `type BetaResponseToolAdditionBlock`

          An entry of a `compaction` block's `tool_changes`: a tool the
          compacted range made available, as a reference to a `tools` entry or
          MCP toolset, or as the tool definition in effect at the end of the
          range, by value. Send it back unchanged.

          - `Type ToolAddition`

            default: tool_addition

          - `Tool BetaResponseToolAdditionBlockToolUnion`

            The tool made available: a reference to a `tools` entry or MCP toolset, or a `tool_definition` carrying the definition by value.

            - `type BetaResponseToolChangeToolReference`

              Reference to a single tool, by the name the model uses to call it, as
              a `compaction` block's `tool_changes` entry reports it: a tool
              declared in `tools` or defined by an earlier `tool_addition` block.
              Send it back unchanged with the block.

              - `Type ToolReference`

                default: tool_reference

              - `Name string`

            - `type BetaResponseToolChangeMCPToolReference`

              Reference to a single MCP tool, by its server and its name on that
              server, as a `compaction` block's `tool_changes` entry reports it.
              Send it back unchanged with the block.

              - `Type MCPToolReference`

                default: mcp_tool_reference

              - `Name string`

              - `ServerName string`

            - `type BetaResponseToolChangeMCPToolsetReference`

              Reference to every tool in the named MCP server's toolset, as a
              `compaction` block's `tool_changes` entry reports it. Send it back
              unchanged with the block.

              - `Type MCPToolsetReference`

                default: mcp_toolset_reference

              - `ServerName string`

            - `type BetaToolChangeToolDefinition`

              A tool defined by value, as a `compaction` block's `tool_changes` entry
              reports it: `definition` is the tool's definition as it was sent, in the
              form of a `tools` entry, without `cache_control`. Send it back unchanged
              with the block.

              - `Type ToolDefinition`

                default: tool_definition

              - `Definition BetaResponseToolUnion`

                - `type BetaResponseTool`

                  A custom tool definition, as sent.

                  - `Type BetaResponseToolType Optional`

                  - `InputSchema BetaResponseToolInputSchema`

                    [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 BetaResponseToolAllowedCallerDirect BetaResponseToolAllowedCaller = "direct"`

                    - `const BetaResponseToolAllowedCallerCodeExecution20250825 BetaResponseToolAllowedCaller = "code_execution_20250825"`

                    - `const BetaResponseToolAllowedCallerCodeExecution20260120 BetaResponseToolAllowedCaller = "code_execution_20260120"`

                    - `const BetaResponseToolAllowedCallerCodeExecution20260521 BetaResponseToolAllowedCaller = "code_execution_20260521"`

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

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

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

                    - `Enabled bool Optional`

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

        - `type BetaResponseToolRemovalBlock`

          An entry of a `compaction` block's `tool_changes`: a tool of the
          request's `tools` (or an MCP tool or toolset) that the compacted range
          withdrew. Send it back unchanged.

          - `Type ToolRemoval`

            default: tool_removal

          - `Tool BetaResponseToolRemovalBlockToolUnion`

            A reference to the withdrawn `tools` entry, MCP tool or MCP toolset.

            - `type BetaResponseToolChangeToolReference`

              Reference to a single tool, by the name the model uses to call it, as
              a `compaction` block's `tool_changes` entry reports it: a tool
              declared in `tools` or defined by an earlier `tool_addition` block.
              Send it back unchanged with the block.

            - `type BetaResponseToolChangeMCPToolReference`

              Reference to a single MCP tool, by its server and its name on that
              server, as a `compaction` block's `tool_changes` entry reports it.
              Send it back unchanged with the block.

            - `type BetaResponseToolChangeMCPToolsetReference`

              Reference to every tool in the named MCP server's toolset, as a
              `compaction` block's `tool_changes` entry reports it. Send it back
              unchanged with the block.

    - `type BetaFallbackBlock`

      Marks the point in `content` where one model's output gives way to the next.

      One block appears per hop where a preceding model actually ran this turn and
      declined. A turn where no preceding model ran and declined has no such
      boundary and carries no block — the signal for whether a fallback model
      served the response is the presence of a `fallback_message` entry in
      `usage.iterations`, not this block.

      The block is treated like a server-tool content block for streaming: it
      arrives via the standard `content_block_start` / `content_block_stop`
      pair and carries no deltas.

      - `Type Fallback`

        default: fallback

      - `From BetaFallbackInfo`

        The model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its `model` echoes the top-level `model` string the caller sent (alias or canonical); when the declining hop is a fallback model, its `model` is that model's canonical id.

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

        The fallback model producing the content that follows this block. Its `model` is always the canonical id.

      - `Trigger BetaFallbackRefusalTrigger`

        What caused the `from` model to hand over at this hop.

        - `Type Refusal`

          default: refusal

        - `Category BetaFallbackRefusalTriggerCategory`

          The policy category that triggered the `from` model's refusal at this hop. `null` when the refusal doesn't map to a named category. Same vocabulary as `stop_details.category`.

          - `const BetaFallbackRefusalTriggerCategoryCyber BetaFallbackRefusalTriggerCategory = "cyber"`

            The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.

          - `const BetaFallbackRefusalTriggerCategoryBio BetaFallbackRefusalTriggerCategory = "bio"`

            The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.

          - `const BetaFallbackRefusalTriggerCategoryFrontierLLM BetaFallbackRefusalTriggerCategory = "frontier_llm"`

            The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.

          - `const BetaFallbackRefusalTriggerCategoryReasoningExtraction BetaFallbackRefusalTriggerCategory = "reasoning_extraction"`

            The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking?sdk_languages=go).

          - `const BetaFallbackRefusalTriggerCategoryGeneralHarms BetaFallbackRefusalTriggerCategory = "general_harms"`

            The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.

    - `type BetaMCPToolListingBlock`

      The tool listing the server fetched from an MCP server while producing
      this response. Send the assistant message back unchanged, this block
      included, so later requests use this listing instead of asking the MCP
      server again.

      - `Type MCPToolListing`

        default: mcp_tool_listing

      - `MCPServerName string`

      - `Tools []BetaMCPTool`

        - `InputSchema map[string, any]`

        - `Name string`

        - `Description string Optional`

  - `ContextManagement BetaContextManagementResponse`

    Context management response.

    Information about context management strategies applied during the request.

    - `AppliedEdits []BetaContextManagementResponseAppliedEditUnion`

      List of context management edits that were applied.

      - `type BetaClearToolUses20250919EditResponse`

        - `Type ClearToolUses20250919`

          The type of context management edit applied.

          default: clear_tool_uses_20250919

        - `ClearedInputTokens int64`

          Number of input tokens cleared by this edit.

          minimum: 0

        - `ClearedToolUses int64`

          Number of tool uses that were cleared.

          minimum: 0

      - `type BetaClearThinking20251015EditResponse`

        - `Type ClearThinking20251015`

          The type of context management edit applied.

          default: clear_thinking_20251015

        - `ClearedInputTokens int64`

          Number of input tokens cleared by this edit.

          minimum: 0

        - `ClearedThinkingTurns int64`

          Number of thinking turns that were cleared.

          minimum: 0

  - `Diagnostics BetaDiagnostics`

    Request-level diagnostics. `null` when the request did not supply `diagnostics`, or when it did and no prompt-cache divergence was detected.

    - `CacheMissReason BetaCacheMissReasonUnion`

      Explains why the prompt cache could not fully reuse the prefix from the request identified by `diagnostics.previous_message_id`. `null` means diagnosis is still pending — the response was serialized before the background comparison completed.

      - `type BetaCacheMissModelChanged`

        - `Type ModelChanged`

          default: model_changed

        - `CacheMissedInputTokens int64`

          Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

      - `type BetaCacheMissSystemChanged`

        - `Type SystemChanged`

          default: system_changed

        - `CacheMissedInputTokens int64`

          Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

      - `type BetaCacheMissToolsChanged`

        - `Type ToolsChanged`

          default: tools_changed

        - `CacheMissedInputTokens int64`

          Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

      - `type BetaCacheMissMessagesChanged`

        - `Type MessagesChanged`

          default: messages_changed

        - `CacheMissedInputTokens int64`

          Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

      - `type BetaCacheMissPreviousMessageNotFound`

        - `Type PreviousMessageNotFound`

          default: previous_message_not_found

      - `type BetaCacheMissUnavailable`

        - `Type Unavailable`

          default: unavailable

  - `Model Model`

    The model that will complete your prompt.

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

  - `Role Assistant`

    Conversational role of the generated message.

    This will always be `"assistant"`.

    default: assistant

  - `StopDetails BetaRefusalStopDetails`

    Structured information about why model output stopped.

    This is `null` when the `stop_reason` has no additional detail to report.

    - `Type Refusal`

      default: refusal

    - `Category BetaRefusalStopDetailsCategory`

      The policy category that triggered the refusal.

      `null` when the refusal doesn't map to a named category.

      - `const BetaRefusalStopDetailsCategoryCyber BetaRefusalStopDetailsCategory = "cyber"`

        The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.

      - `const BetaRefusalStopDetailsCategoryBio BetaRefusalStopDetailsCategory = "bio"`

        The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.

      - `const BetaRefusalStopDetailsCategoryFrontierLLM BetaRefusalStopDetailsCategory = "frontier_llm"`

        The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.

      - `const BetaRefusalStopDetailsCategoryReasoningExtraction BetaRefusalStopDetailsCategory = "reasoning_extraction"`

        The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking?sdk_languages=go).

      - `const BetaRefusalStopDetailsCategoryGeneralHarms BetaRefusalStopDetailsCategory = "general_harms"`

        The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.

    - `Explanation string`

      Human-readable explanation of the refusal.

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

    - `FallbackCreditToken string`

      Opaque code that refunds the cache-miss cost when retrying this refused
      request on the fallback model. Pass it as `fallback_credit_token` on the
      retry request. Expires 5 minutes after the refusal.

      The retry is sent either with the same request body (`system`, `messages`,
      `tools`, and other render-shaping fields), or with the same body plus one
      appended `assistant` message whose content is the partial text (with any
      trailing whitespace stripped from the final text block) and paired
      server-tool blocks from this refusal — which also authorizes that
      appended turn as an assistant-prefill continuation on models that otherwise
      disallow prefill. A token minted mid-server-tool-loop whose partial content
      was continuable may only be redeemed the second way — if a same-body retry
      is rejected with a 400 saying the token must be redeemed by continuing the
      partial response, retry the second way instead. Either way: same workspace,
      same platform; a mismatch is a 400. Resending a token for an already-warm
      prefix is permitted but yields no additional credit.

      `null` when the refused model isn't eligible for a fallback credit.

    - `FallbackHasPrefillClaim bool`

      Whether the accompanying `fallback_credit_token` may be redeemed with the
      appended-assistant retry form. Only set when `fallback_credit_token` is
      present.

      `true`: retry by resending the same request body plus one appended
      `assistant` message whose content is this response's `content` with any
      trailing whitespace stripped from the final text block and unpaired
      `tool_use` blocks omitted (the same appended-turn shape described on
      `fallback_credit_token`), with the token attached. `false`: retry by
      resending the original request body unchanged, with the token attached —
      the appended-assistant form is not available for this refusal (no
      continuable partial content, or the request uses `output_format` or a
      `tool_choice` that forces tool use). One exception: when the request used
      `output_format` or a forced `tool_choice` and the refusal arrived after
      server tools (including MCP connector tools) had already executed, the
      token may not be redeemable by either retry form; if the exact-body retry
      is then rejected with a 400 saying the token must be redeemed by
      continuing the partial response, discard the token and retry without it.

      Advisory: if an appended-assistant retry is rejected with a 400 despite
      `true`, fall back to resending the original request body with the token.

    - `RecommendedModel string`

      The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.

  - `StopReason BetaStopReason`

    The reason that we stopped.

    This may be one the following values:

    * `"end_turn"`: the model reached a natural stopping point
    * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
    * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
    * `"tool_use"`: the model invoked one or more tools
    * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
    * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
    * `"model_context_window_exceeded"`: we exceeded the model's context window

    In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.

    - `const BetaStopReasonEndTurn BetaStopReason = "end_turn"`

    - `const BetaStopReasonMaxTokens BetaStopReason = "max_tokens"`

    - `const BetaStopReasonStopSequence BetaStopReason = "stop_sequence"`

    - `const BetaStopReasonToolUse BetaStopReason = "tool_use"`

    - `const BetaStopReasonPauseTurn BetaStopReason = "pause_turn"`

    - `const BetaStopReasonCompaction BetaStopReason = "compaction"`

    - `const BetaStopReasonRefusal BetaStopReason = "refusal"`

    - `const BetaStopReasonModelContextWindowExceeded BetaStopReason = "model_context_window_exceeded"`

  - `StopSequence string`

    Which custom stop sequence was generated, if any.

    This value will be a non-null string if one of your custom stop sequences was generated.

  - `Usage BetaUsage`

    Billing and rate-limit usage.

    Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.

    Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.

    For example, `output_tokens` will be non-zero, even for an empty string response from Claude.

    Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.

    - `CacheCreation BetaCacheCreation`

      Breakdown of cached tokens by TTL

      - `Ephemeral1hInputTokens int64`

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

        default: 0, minimum: 0

      - `Ephemeral5mInputTokens int64`

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

        default: 0, minimum: 0

    - `CacheCreationInputTokens int64`

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

      minimum: 0

    - `CacheReadInputTokens int64`

      The number of input tokens read from the cache.

      minimum: 0

    - `FallbackCredit BetaFallbackCreditUsage`

      Outcome of the `fallback_credit_token` presented on this request.

      Present on every response to a non-batch request that carried a
      `fallback_credit_token`, in either redemption mode; absent otherwise (batch
      items accept and ignore the token and carry no outcome object).

      - `Status BetaFallbackCreditUsageStatusUnion`

        Whether the fallback-credit reprice was applied to this response's billing.

        A union discriminated on `type`. `redeemed`: the retry is billed as if
        the conversation had been on the retry model all along — including when the
        resulting shift is zero because there was nothing to move. `not_applied`:
        no reprice was applied; the arm's `reason` says why.

        - `type BetaFallbackCreditRedeemed`

          The reprice was applied: the retry is billed as if the conversation
          had been on the retry model all along.

          - `Type Redeemed`

            default: redeemed

        - `type BetaFallbackCreditNotApplied`

          No reprice was applied; `reason` says why.

          - `Type NotApplied`

            default: not_applied

          - `Reason BetaFallbackCreditNotAppliedReason`

            Why the reprice was not applied.

            A closed enum; additions to the redemption-check vocabulary arrive as
            deliberate schema updates.

            - `const BetaFallbackCreditNotAppliedReasonBodyMismatch BetaFallbackCreditNotAppliedReason = "body_mismatch"`

            - `const BetaFallbackCreditNotAppliedReasonContinuationExcluded BetaFallbackCreditNotAppliedReason = "continuation_excluded"`

            - `const BetaFallbackCreditNotAppliedReasonContinuationOnly BetaFallbackCreditNotAppliedReason = "continuation_only"`

            - `const BetaFallbackCreditNotAppliedReasonExpired BetaFallbackCreditNotAppliedReason = "expired"`

            - `const BetaFallbackCreditNotAppliedReasonInvalidTargetModel BetaFallbackCreditNotAppliedReason = "invalid_target_model"`

            - `const BetaFallbackCreditNotAppliedReasonNotEnabled BetaFallbackCreditNotAppliedReason = "not_enabled"`

            - `const BetaFallbackCreditNotAppliedReasonRepriceUnavailable BetaFallbackCreditNotAppliedReason = "reprice_unavailable"`

            - `const BetaFallbackCreditNotAppliedReasonTemporarilyUnavailable BetaFallbackCreditNotAppliedReason = "temporarily_unavailable"`

            - `const BetaFallbackCreditNotAppliedReasonVariantFieldsPresent BetaFallbackCreditNotAppliedReason = "variant_fields_present"`

            - `const BetaFallbackCreditNotAppliedReasonWrongOrganization BetaFallbackCreditNotAppliedReason = "wrong_organization"`

            - `const BetaFallbackCreditNotAppliedReasonWrongPlatform BetaFallbackCreditNotAppliedReason = "wrong_platform"`

            - `const BetaFallbackCreditNotAppliedReasonWrongWorkspace BetaFallbackCreditNotAppliedReason = "wrong_workspace"`

          - `RemoveToRedeem []string Optional`

            Request fields to remove before retrying, so the retry can redeem this
            token.

            Present exactly when `reason` is `variant_fields_present` — never null,
            never an empty array; absent otherwise. Fields are named only from your own request, and only after
            the sealed variant hash matched. A served best-effort retry has already
            been billed at normal price; nothing redeems retroactively, but a corrected
            re-send inside the token's five-minute window can still redeem.

    - `InferenceGeo string`

      The geographic region where inference was performed for this request.

    - `InputTokens int64`

      The number of input tokens which were used.

      minimum: 0

    - `Iterations BetaIterationsUsage`

      Per-iteration token usage breakdown.

      Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by `type`. For `message` entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to:

      - Calculate the context window size from the last `message` entry
      - Understand token accumulation across server-side tool use loops

      A `compaction` entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a `compaction` entry, even when it is the last entry. A `compaction` entry's tokens are not included in the top-level `usage` fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each `compaction` entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results.

      - `type BetaMessageIterationUsage`

        Token usage for a sampling iteration.

        - `Type Message`

          Usage for a sampling iteration

          default: message

        - `CacheCreation BetaCacheCreation`

          Breakdown of cached tokens by TTL

        - `CacheCreationInputTokens int64`

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

          default: 0, minimum: 0

        - `CacheReadInputTokens int64`

          The number of input tokens read from the cache.

          default: 0, minimum: 0

        - `InputTokens int64`

          The number of input tokens which were used.

          minimum: 0

        - `Model Model`

          The model that will complete your prompt.

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

        - `OutputTokens int64`

          The number of output tokens which were used.

          minimum: 0

      - `type BetaCompactionIterationUsage`

        Token usage for a compaction iteration.

        - `Type Compaction`

          Usage for a compaction iteration

          default: compaction

        - `CacheCreation BetaCacheCreation`

          Breakdown of cached tokens by TTL

        - `CacheCreationInputTokens int64`

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

          default: 0, minimum: 0

        - `CacheReadInputTokens int64`

          The number of input tokens read from the cache.

          default: 0, minimum: 0

        - `InputTokens int64`

          The number of input tokens which were used.

          minimum: 0

        - `OutputTokens int64`

          The number of output tokens which were used.

          minimum: 0

      - `type BetaAdvisorMessageIterationUsage`

        Token usage for an advisor sub-inference iteration.

        - `Type AdvisorMessage`

          Usage for an advisor sub-inference iteration

          default: advisor_message

        - `CacheCreation BetaCacheCreation`

          Breakdown of cached tokens by TTL

        - `CacheCreationInputTokens int64`

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

          default: 0, minimum: 0

        - `CacheReadInputTokens int64`

          The number of input tokens read from the cache.

          default: 0, minimum: 0

        - `InputTokens int64`

          The number of input tokens which were used.

          minimum: 0

        - `Model Model`

          The model that will complete your prompt.

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

        - `OutputTokens int64`

          The number of output tokens which were used.

          minimum: 0

      - `type BetaFallbackMessageIterationUsage`

        Token usage for the fallback-model attempt of a server-side fallback request.

        The terminal entry of a fallback-served turn: when a fallback hop's
        output is the returned message, the entry for the iteration that
        completed it carries this type in place of `message`. A declined hop
        and the serving hop's earlier tool-loop iterations produce `message`
        entries. Whether a fallback model served the response is signalled by
        the presence of this entry in `usage.iterations`.

        - `Type FallbackMessage`

          Usage for the fallback-model attempt that served the response

          default: fallback_message

        - `CacheCreation BetaCacheCreation`

          Breakdown of cached tokens by TTL

        - `CacheCreationInputTokens int64`

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

          default: 0, minimum: 0

        - `CacheReadInputTokens int64`

          The number of input tokens read from the cache.

          default: 0, minimum: 0

        - `InputTokens int64`

          The number of input tokens which were used.

          minimum: 0

        - `Model Model`

          The model that will complete your prompt.

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

        - `OutputTokens int64`

          The number of output tokens which were used.

          minimum: 0

    - `OutputTokens int64`

      The number of output tokens which were used.

      minimum: 0

    - `OutputTokensDetails BetaOutputTokensDetails`

      Breakdown of output tokens by category.

      `output_tokens` remains the inclusive, authoritative total used for billing.
      This object provides a read-only decomposition for observability — for example,
      how many of the billed output tokens were spent on internal reasoning that may
      have been summarized before being returned to you.

      - `ThinkingTokens int64`

        Number of output tokens the model generated as internal reasoning, including
        the thinking-block delimiter tokens.

        Reflects the raw reasoning the model produced, not the (possibly shorter)
        summarized thinking text returned in the response body. Computed by
        re-tokenizing the raw reasoning text, so it may differ from the model's exact
        generation count by a small number of tokens. Always ≤ `output_tokens`;
        `output_tokens - thinking_tokens` approximates the non-reasoning output.

        default: 0, minimum: 0

    - `ServerToolUse BetaServerToolUsage`

      The number of server tool requests.

      - `WebFetchRequests int64`

        The number of web fetch tool requests.

        default: 0, minimum: 0

      - `WebSearchRequests int64`

        The number of web search tool requests.

        default: 0, minimum: 0

    - `ServiceTier BetaUsageServiceTier`

      If the request used the priority, standard, or batch tier.

      - `const BetaUsageServiceTierStandard BetaUsageServiceTier = "standard"`

      - `const BetaUsageServiceTierPriority BetaUsageServiceTier = "priority"`

      - `const BetaUsageServiceTierBatch BetaUsageServiceTier = "batch"`

    - `Speed BetaUsageSpeed`

      The inference speed mode used for this request.

      - `const BetaUsageSpeedStandard BetaUsageSpeed = "standard"`

      - `const BetaUsageSpeedFast BetaUsageSpeed = "fast"`

  - `InputTransformations []BetaInputTransformationUnion Optional`

    Changes the API made to the request's input before showing it to the model,
    and blocks that failed a binding check but were left unchanged: one entry per
    block, in request order. Two entry types today. `thinking_dropped` — a
    `thinking`, `redacted_thinking` or `connector_text` block from the request's
    `messages` that was removed from the prompt instead of being shown to the
    model because it failed a binding check. `thinking_mismatch_allowed` — a
    `thinking` or `redacted_thinking` block that failed the conversation check
    (the conversation before it differs from the one it was created in, or it
    carries no record of one on a model that requires it) and was shown to the
    model all the same, because that check is not enforced for this request.
    More entry types may be added over time; ignore types you do not recognize.

    Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on
    every such response from a model that supports extended thinking, as `[]`
    when there is no entry to report; without the beta, blocks are removed or
    left in place all the same but nothing is reported. Removed blocks contribute
    nothing to `usage.input_tokens`; blocks left in place count as sent. When
    streaming, the array is final in `message_start`; the final `message_delta`
    event carries it only when a server-side model fallback happened mid-stream,
    in which case it holds the serving model's entries and replaces the one in
    `message_start`.

    - `type BetaThinkingDroppedInputTransformation`

      - `Type ThinkingDropped`

        Always `thinking_dropped` for this entry type.

        default: thinking_dropped

      - `Path string`

        Where the removed block was in your request, as `messages.{i}.content.{j}`:
        `i` indexes the `messages` array you sent and `j` that message's `content`
        array — the same form error messages use.

      - `Reason BetaThinkingDroppedInputTransformationReason`

        Which binding check removed the block: `model_binding_mismatch` — it was
        created by a model whose reasoning the requested model may not read;
        `prefix_binding_mismatch` — the conversation before it differs from the
        conversation it was created in (the rest of that turn's consecutive thinking
        blocks are removed with it, each with this reason);
        `organization_binding_mismatch` — it was created under a different
        organization (an Anthropic organization, AWS account or Google Cloud project)
        and this organization is not one of its additional organizations;
        `end_user_binding_mismatch` — it was created for a different end user, or
        was removed by the consumer-organization binding. A block that would fail
        several checks reports one reason, in this order of precedence:
        `organization_binding_mismatch`, `end_user_binding_mismatch`,
        `model_binding_mismatch`, `prefix_binding_mismatch`.

        - `const BetaThinkingDroppedInputTransformationReasonModelBindingMismatch BetaThinkingDroppedInputTransformationReason = "model_binding_mismatch"`

        - `const BetaThinkingDroppedInputTransformationReasonPrefixBindingMismatch BetaThinkingDroppedInputTransformationReason = "prefix_binding_mismatch"`

        - `const BetaThinkingDroppedInputTransformationReasonOrganizationBindingMismatch BetaThinkingDroppedInputTransformationReason = "organization_binding_mismatch"`

        - `const BetaThinkingDroppedInputTransformationReasonEndUserBindingMismatch BetaThinkingDroppedInputTransformationReason = "end_user_binding_mismatch"`

    - `type BetaThinkingMismatchAllowedInputTransformation`

      - `Type ThinkingMismatchAllowed`

        Always `thinking_mismatch_allowed` for this entry type.

        default: thinking_mismatch_allowed

      - `Path string`

        Where the block is in your request, as `messages.{i}.content.{j}`:
        `i` indexes the `messages` array you sent and `j` that message's `content`
        array — the same form error messages use.

      - `Reason BetaThinkingMismatchAllowedInputTransformationReason`

        Which binding check the block failed; the block was shown to the model all
        the same. Always `prefix_binding_mismatch` today — the conversation before
        the block differs from the conversation it was created in, or the block
        carries no record of one on a model that requires it. Were the check
        enforced for this request, the block would have been removed or the request
        rejected (`thinking.block_binding.prefix_mismatch_behavior`). A removal also
        takes the rest of that turn's consecutive thinking blocks, whereas here each
        block is checked on its own, so `thinking_mismatch_allowed` entries are a
        lower bound on what enforcement would remove.

        - `const BetaThinkingMismatchAllowedInputTransformationReasonModelBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "model_binding_mismatch"`

        - `const BetaThinkingMismatchAllowedInputTransformationReasonPrefixBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "prefix_binding_mismatch"`

        - `const BetaThinkingMismatchAllowedInputTransformationReasonOrganizationBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "organization_binding_mismatch"`

        - `const BetaThinkingMismatchAllowedInputTransformationReasonEndUserBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "end_user_binding_mismatch"`

- `type BetaRawMessageStreamEventUnion interface{…}`

  - `type BetaRawMessageStartEvent`

    - `Type MessageStart`

      default: message_start

    - `Message BetaMessage`

  - `type BetaRawMessageDeltaEvent`

    - `Type MessageDelta`

      default: message_delta

    - `ContextManagement BetaContextManagementResponse`

      Information about context management strategies applied during the request

    - `Delta BetaRawMessageDeltaEventDelta`

      - `Container BetaContainer`

        Information about the container used in this request.

        This will be non-null if a container tool (e.g. code execution) was used.

      - `StopDetails BetaRefusalStopDetails`

        Structured information about why model output stopped.

        This is `null` when the `stop_reason` has no additional detail to report.

      - `StopReason BetaStopReason`

      - `StopSequence string`

    - `Usage BetaMessageDeltaUsage`

      Billing and rate-limit usage.

      Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.

      Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.

      For example, `output_tokens` will be non-zero, even for an empty string response from Claude.

      Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.

      - `CacheCreationInputTokens int64`

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

        minimum: 0

      - `CacheReadInputTokens int64`

        The cumulative number of input tokens read from the cache.

        minimum: 0

      - `FallbackCredit BetaFallbackCreditUsage`

        Outcome of the `fallback_credit_token` presented on this request.

        Present on every response to a non-batch request that carried a
        `fallback_credit_token`, in either redemption mode; absent otherwise (batch
        items accept and ignore the token and carry no outcome object).

      - `InputTokens int64`

        The cumulative number of input tokens which were used.

        minimum: 0

      - `Iterations BetaIterationsUsage`

        Per-iteration token usage breakdown.

        Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by `type`. For `message` entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to:

        - Calculate the context window size from the last `message` entry
        - Understand token accumulation across server-side tool use loops

        A `compaction` entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a `compaction` entry, even when it is the last entry. A `compaction` entry's tokens are not included in the top-level `usage` fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each `compaction` entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results.

      - `OutputTokens int64`

        The cumulative number of output tokens which were used.

      - `OutputTokensDetails BetaOutputTokensDetails`

        Breakdown of output tokens by category.

        `output_tokens` remains the inclusive, authoritative total used for billing.
        This object provides a read-only decomposition for observability — for example,
        how many of the billed output tokens were spent on internal reasoning that may
        have been summarized before being returned to you.

      - `ServerToolUse BetaServerToolUsage`

        The number of server tool requests.

    - `InputTransformations []BetaInputTransformationUnion Optional`

      Changes the API made to the request's input before showing it to the model,
      and blocks that failed a binding check but were left unchanged: one entry per
      block, in request order. Two entry types today. `thinking_dropped` — a
      `thinking`, `redacted_thinking` or `connector_text` block from the request's
      `messages` that was removed from the prompt instead of being shown to the
      model because it failed a binding check. `thinking_mismatch_allowed` — a
      `thinking` or `redacted_thinking` block that failed the conversation check
      (the conversation before it differs from the one it was created in, or it
      carries no record of one on a model that requires it) and was shown to the
      model all the same, because that check is not enforced for this request.
      More entry types may be added over time; ignore types you do not recognize.

      Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on
      every such response from a model that supports extended thinking, as `[]`
      when there is no entry to report; without the beta, blocks are removed or
      left in place all the same but nothing is reported. Removed blocks contribute
      nothing to `usage.input_tokens`; blocks left in place count as sent. When
      streaming, the array is final in `message_start`; the final `message_delta`
      event carries it only when a server-side model fallback happened mid-stream,
      in which case it holds the serving model's entries and replaces the one in
      `message_start`.

      - `type BetaThinkingDroppedInputTransformation`

      - `type BetaThinkingMismatchAllowedInputTransformation`

  - `type BetaRawMessageStopEvent`

    - `Type MessageStop`

      default: message_stop

  - `type BetaRawContentBlockStartEvent`

    - `Type ContentBlockStart`

      default: content_block_start

    - `ContentBlock BetaRawContentBlockStartEventContentBlockUnion`

      - `type BetaTextBlock`

      - `type BetaThinkingBlock`

      - `type BetaRedactedThinkingBlock`

      - `type BetaToolUseBlock`

      - `type BetaServerToolUseBlock`

      - `type BetaWebSearchToolResultBlock`

      - `type BetaWebFetchToolResultBlock`

      - `type BetaAdvisorToolResultBlock`

      - `type BetaCodeExecutionToolResultBlock`

      - `type BetaBashCodeExecutionToolResultBlock`

      - `type BetaTextEditorCodeExecutionToolResultBlock`

      - `type BetaToolSearchToolResultBlock`

      - `type BetaMCPToolUseBlock`

      - `type BetaMCPToolResultBlock`

      - `type BetaContainerUploadBlock`

        Response model for a file uploaded to the container.

      - `type BetaCompactionBlock`

        A compaction block returned when autocompact is triggered.

        When content is None, it indicates the compaction failed to produce a valid
        summary (e.g., malformed output from the model). Clients may round-trip
        compaction blocks with null content; the server treats them as no-ops.

      - `type BetaFallbackBlock`

        Marks the point in `content` where one model's output gives way to the next.

        One block appears per hop where a preceding model actually ran this turn and
        declined. A turn where no preceding model ran and declined has no such
        boundary and carries no block — the signal for whether a fallback model
        served the response is the presence of a `fallback_message` entry in
        `usage.iterations`, not this block.

        The block is treated like a server-tool content block for streaming: it
        arrives via the standard `content_block_start` / `content_block_stop`
        pair and carries no deltas.

      - `type BetaMCPToolListingBlock`

        The tool listing the server fetched from an MCP server while producing
        this response. Send the assistant message back unchanged, this block
        included, so later requests use this listing instead of asking the MCP
        server again.

    - `Index int64`

  - `type BetaRawContentBlockDeltaEvent`

    - `Type ContentBlockDelta`

      default: content_block_delta

    - `Delta BetaRawContentBlockDeltaUnion`

      - `type BetaTextDelta`

        - `Type TextDelta`

          default: text_delta

        - `Text string`

      - `type BetaInputJSONDelta`

        - `Type InputJSONDelta`

          default: input_json_delta

        - `PartialJSON string`

      - `type BetaCitationsDelta`

        - `Type CitationsDelta`

          default: citations_delta

        - `Citation BetaCitationsDeltaCitationUnion`

          - `type BetaCitationCharLocation`

          - `type BetaCitationPageLocation`

          - `type BetaCitationContentBlockLocation`

          - `type BetaCitationsWebSearchResultLocation`

          - `type BetaCitationSearchResultLocation`

      - `type BetaThinkingDelta`

        - `Type ThinkingDelta`

          default: thinking_delta

        - `EstimatedTokens int64`

          Per-frame increment of a coarse, running estimate of the tokens this thinking block has produced so far. Present whenever the `thinking-token-count-2026-05-13` beta is set; `null` unless `thinking.display` resolves to `"omitted"` and a count is due this frame. Sum the increments across `thinking_delta` frames on this block for a progress indicator. Each increment is a non-negative multiple of a fixed quantum and the cadence is rate-limited, so this is a deliberately lossy display hint, not a billable count; `usage.output_tokens` remains authoritative.

        - `Thinking string`

          The incremental `thinking` text for this content block. Concatenate the `thinking` values of successive `thinking_delta` events to assemble the block's full `thinking` value.

      - `type BetaSignatureDelta`

        - `Type SignatureDelta`

          default: signature_delta

        - `Signature string`

          The `signature` for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a `signature_delta` event just before the block's `content_block_stop` event.

      - `type BetaCompactionContentBlockDelta`

        - `Type CompactionDelta`

          default: compaction_delta

        - `Content string`

        - `EncryptedContent string`

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

    - `Index int64`

  - `type BetaRawContentBlockStopEvent`

    - `Type ContentBlockStop`

      default: content_block_stop

    - `Index int64`

#### 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"),
	)
	betaMessage, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
		MaxTokens: 1024,
		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", betaMessage.ID)
}
```

##### Response (200)

```json
{
  "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
  "container": {
    "id": "container_011CpZohnwH4vuy7gazohgSP",
    "expires_at": "2019-12-27T18:11:19.117Z",
    "skills": [
      {
        "skill_id": "pdf",
        "type": "anthropic",
        "version": "latest"
      }
    ]
  },
  "content": [
    {
      "citations": [
        {
          "cited_text": "The grass is green. The sky is blue.",
          "document_index": 0,
          "document_title": "My Document",
          "end_char_index": 0,
          "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
          "start_char_index": 0,
          "type": "char_location"
        }
      ],
      "text": "Hi! My name is Claude.",
      "type": "text"
    }
  ],
  "context_management": {
    "applied_edits": [
      {
        "cleared_input_tokens": 0,
        "cleared_tool_uses": 0,
        "type": "clear_tool_uses_20250919"
      }
    ]
  },
  "diagnostics": {
    "cache_miss_reason": {
      "cache_missed_input_tokens": 0,
      "type": "model_changed"
    }
  },
  "model": "claude-opus-5-5",
  "role": "assistant",
  "stop_details": {
    "category": "cyber",
    "explanation": "This request was declined because it conflicts with Anthropic's Usage Policy.",
    "fallback_credit_token": "QW50aHJvcGljL0NsYXVkZQ==",
    "fallback_has_prefill_claim": true,
    "recommended_model": "claude-opus-4-8",
    "type": "refusal"
  },
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_creation_input_tokens": 2051,
    "cache_read_input_tokens": 2051,
    "fallback_credit": {
      "status": {
        "type": "redeemed"
      }
    },
    "inference_geo": "global",
    "input_tokens": 2095,
    "iterations": [
      {
        "cache_creation": {
          "ephemeral_1h_input_tokens": 0,
          "ephemeral_5m_input_tokens": 0
        },
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "input_tokens": 0,
        "model": "claude-haiku-5-5",
        "output_tokens": 0,
        "type": "message"
      }
    ],
    "output_tokens": 503,
    "output_tokens_details": {
      "thinking_tokens": 0
    },
    "server_tool_use": {
      "web_fetch_requests": 2,
      "web_search_requests": 0
    },
    "service_tier": "standard",
    "speed": "standard"
  },
  "input_transformations": [
    {
      "path": "path",
      "reason": "model_binding_mismatch",
      "type": "thinking_dropped"
    }
  ]
}
```

### 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
}
```

## Beta › Messages › Batches

### Create a Message Batch

`client.Beta.Messages.Batches.New(ctx, params) (*BetaMessageBatch, error)`

**POST** `/v1/messages/batches`

Send a batch of Message creation requests.

The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.

Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing?sdk_languages=go)

#### Parameters

- `params BetaMessageBatchNewParams`

  - `Requests []BetaMessageBatchNewParamsRequest`

    List of requests for prompt completion. Each is an individual request to create a Message.

    minItems: 1, maxItems: 100000

    - `CustomID string`

      Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.

      Must be unique for each request within the Message Batch.

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

    - `Params BetaMessageBatchNewParamsRequestParams`

      Messages API creation parameters for the individual request.

      See the [Messages API reference](https://platform.claude.com/docs/en/api/messages?sdk_languages=go) for full documentation on available parameters.

      - `MaxTokens int64`

        The maximum number of tokens to generate before stopping.

        Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.

        Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?sdk_languages=go#pre-warming-the-cache) without generating a response.

        Different models have different maximum values for this parameter.  See [models](https://platform.claude.com/docs/en/about-claude/models/overview?sdk_languages=go) for details.

        minimum: 0

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

        - `Type Summarize`

        - `Instructions string Optional`

          Replaces the server's default summarization prompt for this request. An empty or whitespace-only value counts as absent.

          maxLength: 16384

      - `Container BetaMessageBatchNewParamsRequestParamsContainerUnion Optional`

        Container identifier for reuse across requests.

        - `type BetaContainerParams`

          Container parameters with skills to be loaded.

          - `ID string Optional`

            Container id

          - `Skills []BetaSkillParams Optional`

            List of skills to load in the container

            maxItems: 20

            - `Type BetaSkillParamsType`

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

              - `const BetaSkillParamsTypeAnthropic BetaSkillParamsType = "anthropic"`

              - `const BetaSkillParamsTypeCustom BetaSkillParamsType = "custom"`

            - `SkillID string`

              Skill ID

              minLength: 1, maxLength: 64

            - `Version string Optional`

              Skill version or 'latest' for most recent version

              minLength: 1, maxLength: 64

        - `string`

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

        - `Edits []BetaContextManagementConfigEditUnionParam Optional`

          List of context management edits to apply

          - `type BetaClearToolUses20250919EditParam`

            - `Type ClearToolUses20250919`

            - `ClearAtLeast BetaInputTokensClearAtLeastParam Optional`

              Minimum number of tokens that must be cleared when triggered. Context will only be modified if at least this many tokens can be removed.

              - `Type InputTokens`

              - `Value int64`

                minimum: 0

            - `ClearToolInputs BetaClearToolUses20250919EditClearToolInputsUnionParam Optional`

              Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)

              - `bool`

              - `[]string`

            - `ExcludeTools []string Optional`

              Tool names whose uses are preserved from clearing

            - `Keep BetaToolUsesKeepParam Optional`

              Number of tool uses to retain in the conversation

              - `Type ToolUses`

              - `Value int64`

                minimum: 0

            - `Trigger BetaClearToolUses20250919EditTriggerUnionParam Optional`

              Condition that triggers the context management strategy

              - `type BetaInputTokensTriggerParam`

                - `Type InputTokens`

                - `Value int64`

                  minimum: 1

              - `type BetaToolUsesTriggerParam`

                - `Type ToolUses`

                - `Value int64`

                  minimum: 1

          - `type BetaClearThinking20251015EditParam`

            - `Type ClearThinking20251015`

            - `Keep BetaClearThinking20251015EditKeepUnionParam Optional`

              Number of most recent assistant turns to keep thinking blocks for. Older turns will have their thinking blocks removed.

              - `type BetaThinkingTurnsParam`

                - `Type ThinkingTurns`

                - `Value int64`

                  minimum: 1

              - `type BetaAllThinkingTurnsParam`

                - `Type All`

              - `All`

          - `type BetaCompact20260112EditParam`

            Automatically compact older context when reaching the configured trigger threshold.

            - `Type Compact20260112`

            - `Instructions string Optional`

              Additional instructions for summarization.

            - `PauseAfterCompaction bool Optional`

              Whether to pause after compaction and return the compaction block to the user.

            - `Trigger BetaInputTokensTriggerParam Optional`

              When to trigger compaction. Defaults to 150000 input tokens.

      - `Diagnostics BetaDiagnosticsParam Optional`

        Request-level diagnostics. Supply `previous_message_id` to have the response include `diagnostics.cache_miss_reason` explaining any prompt-cache divergence from that prior request.

        - `PreviousMessageID string Optional`

          The `id` (`msg_...`) from this client's previous /v1/messages response. The server compares that request's prompt fingerprint against this one and returns `diagnostics.cache_miss_reason` when the prompt-cache prefix could not be reused. Pass `null` on the first turn to opt in without a prior message to compare.

          maxLength: 256

      - `FallbackCreditToken BetaMessageBatchNewParamsRequestParamsFallbackCreditTokenUnion Optional`

        The `fallback_credit_token` from a prior refusal's `stop_details`.

        When a preceding request was refused and returned a `fallback_credit_token`,
        pass that code here on the retry to have the retry's cache-creation tokens
        for the prefix that was warm on the refused model billed at the cache-read
        rate. Must be redeemed by the same organization and workspace, with the same
        request body (optionally extended by one appended `assistant` message whose
        content is the partial text — with any trailing whitespace stripped from
        the final text block — and paired server-tool blocks streamed before the
        refusal; the appended-assistant form is not available for requests with
        `output_format` set or forced `tool_choice`), on an eligible fallback
        model, on the same platform,
        and within 5 minutes of the refusal; a mismatch is a 400. A token minted
        mid-server-tool-loop whose partial content was continuable may only be
        redeemed with the appended-assistant form — if an exact-body retry is
        rejected with a 400 saying the token must be redeemed by continuing the
        partial response, retry with the appended-assistant form instead.

        When the appended-assistant form is used on a model that otherwise disallows
        assistant-turn prefill, this token also authorizes that one prefill.

        - `string`

        - `type BetaFallbackCreditTokenParam`

          Object form of `fallback_credit_token`: the token plus a redemption
          mode.

          Requires `anthropic-beta: fallback-credit-2026-07-01`; without that
          header the field accepts the bare string only. The bare string and the
          mode-less object are equivalent (both select `strict`), so wrapping
          an existing token changes nothing by itself.

          - `Token string`

            The opaque `fallback_credit_token` from a prior refusal's `stop_details` — the same string the bare-string form carries.

            minLength: 1, maxLength: 2048

          - `Mode BetaFallbackCreditTokenParamMode Optional`

            How a failing token affects the retry. `strict` (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. `best_effort`: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's `usage.fallback_credit`. Two failures stay hard in both modes: a malformed token, and combining `fallback_credit_token` with `fallbacks`.

            - `const BetaFallbackCreditTokenParamModeStrict BetaFallbackCreditTokenParamMode = "strict"`

            - `const BetaFallbackCreditTokenParamModeBestEffort BetaFallbackCreditTokenParamMode = "best_effort"`

      - `Fallbacks BetaFallbacksParamUnion Optional`

        Opt-in server-side retry on one or more substitute models when the requested model declines for policy reasons. Tried in order: if the first entry also declines, the second is tried, and so on. Some models don't support fallbacks; on those models, a list of fallback models returns a 400 error. See [Server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback?sdk_languages=go#server-side-fallback). The string "default" requests the requested model's server-defined default fallback configuration. On a model that doesn't support fallbacks, the request runs on the requested model alone, so a declined request stays declined.

        - `[]BetaFallbackParam`

          - `Model Model`

            The model that will complete your prompt.

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

          - `MaxTokens int64 Optional`

          - `OutputConfig BetaOutputConfigParam Optional`

            - `Effort BetaOutputConfigEffort 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 BetaOutputConfigEffortLow BetaOutputConfigEffort = "low"`

              - `const BetaOutputConfigEffortMedium BetaOutputConfigEffort = "medium"`

              - `const BetaOutputConfigEffortHigh BetaOutputConfigEffort = "high"`

              - `const BetaOutputConfigEffortXhigh BetaOutputConfigEffort = "xhigh"`

              - `const BetaOutputConfigEffortMax BetaOutputConfigEffort = "max"`

            - `Format BetaJSONOutputFormatParam Optional`

              A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs?sdk_languages=go)

              - `Type JSONSchema`

              - `Schema map[string, any]`

                The JSON schema of the format

            - `TaskBudget BetaTokenTaskBudgetParam Optional`

              Configuration for token budget tracking across contexts.

              - `Type Tokens`

                The budget type. Currently only 'tokens' is supported.

              - `Total int64`

                Total token budget across all contexts in the session.

                minimum: 1024

              - `Remaining int64 Optional`

                Remaining tokens in the budget. Use this to track usage across contexts when implementing compaction client-side. Defaults to total if not provided.

                minimum: 0

          - `Speed BetaFallbackParamSpeed Optional`

            Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

            - `const BetaFallbackParamSpeedStandard BetaFallbackParamSpeed = "standard"`

            - `const BetaFallbackParamSpeedFast BetaFallbackParamSpeed = "fast"`

          - `Thinking BetaFallbackParamThinkingUnion Optional`

            - `type BetaThinkingConfigEnabledParam`

              - `Type Enabled`

              - `BudgetTokens int64`

                Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality.

                Must be ≥1024 and less than `max_tokens`.

                See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking?sdk_languages=go) for details.

                minimum: 1024

              - `BlockBinding BetaThinkingBlockBindingParam Optional`

                Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. `null`, absent or an empty object means every default.

                - `PrefixMismatchBehavior BetaThinkingPrefixMismatchBehavior Optional`

                  "error" (default) | "drop_block". What happens when a thinking block in `messages` fails the conversation check (it was created in a different conversation, or the messages before it have changed since). "error" fails the request with a 400 error. "drop_block" removes the failing blocks and the request proceeds; each removal is reported in `input_transformations`.

                  - `const BetaThinkingPrefixMismatchBehaviorError BetaThinkingPrefixMismatchBehavior = "error"`

                  - `const BetaThinkingPrefixMismatchBehaviorDropBlock BetaThinkingPrefixMismatchBehavior = "drop_block"`

              - `Display BetaThinkingConfigEnabledDisplay Optional`

                Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking?sdk_languages=go#controlling-thinking-display).

                - `const BetaThinkingConfigEnabledDisplaySummarized BetaThinkingConfigEnabledDisplay = "summarized"`

                - `const BetaThinkingConfigEnabledDisplayOmitted BetaThinkingConfigEnabledDisplay = "omitted"`

                - `const BetaThinkingConfigEnabledDisplayUpdates BetaThinkingConfigEnabledDisplay = "updates"`

            - `type BetaThinkingConfigDisabledParam`

              - `Type Disabled`

            - `type BetaThinkingConfigBetweenToolsParam`

              - `Type BetweenTools`

            - `type BetaThinkingConfigAdaptiveParam`

              - `Type Adaptive`

              - `BlockBinding BetaThinkingBlockBindingParam Optional`

                Controls for block binding: what happens when a thinking block this request sends back fails the conversation check. `null`, absent or an empty object means every default.

              - `Display BetaThinkingConfigAdaptiveDisplay Optional`

                Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. The default depends on the model; see [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking?sdk_languages=go#controlling-thinking-display).

                - `const BetaThinkingConfigAdaptiveDisplaySummarized BetaThinkingConfigAdaptiveDisplay = "summarized"`

                - `const BetaThinkingConfigAdaptiveDisplayOmitted BetaThinkingConfigAdaptiveDisplay = "omitted"`

                - `const BetaThinkingConfigAdaptiveDisplayUpdates BetaThinkingConfigAdaptiveDisplay = "updates"`

        - `Default`

      - `InferenceGeo string Optional`

        Specifies the geographic region for inference processing. If not specified, the workspace's `default_inference_geo` is used.

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

      - `Metadata BetaMetadataParam Optional`

        An object describing metadata about the request.

        - `UserID string Optional`

          An external identifier for the user who is associated with the request.

          This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.

          maxLength: 512

      - `OutputConfig BetaOutputConfigParam Optional`

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

      - `ServiceTier string Optional`

        Determines whether to use priority capacity (if available) or standard capacity for this request.

        Anthropic offers different levels of service for your API requests. See [service-tiers](https://platform.claude.com/docs/en/api/service-tiers?sdk_languages=go) for details.

        - `const BetaMessageBatchNewParamsRequestParamsServiceTierAuto BetaMessageBatchNewParamsRequestParamsServiceTier = "auto"`

        - `const BetaMessageBatchNewParamsRequestParamsServiceTierStandardOnly BetaMessageBatchNewParamsRequestParamsServiceTier = "standard_only"`

      - `Speed string 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 BetaMessageBatchNewParamsRequestParamsSpeedStandard BetaMessageBatchNewParamsRequestParamsSpeed = "standard"`

        - `const BetaMessageBatchNewParamsRequestParamsSpeedFast BetaMessageBatchNewParamsRequestParamsSpeed = "fast"`

      - `StopSequences []string Optional`

        Custom text sequences that will cause the model to stop generating.

        Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`.

        If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.

      - `Stream bool Optional`

        Whether to incrementally stream the response using server-sent events. When `true`, SDKs return a raw event stream.

        In the TypeScript, Python and Ruby SDKs, the recommended way to stream is `messages.stream()`. It sets `stream` for you and accumulates the events into the final message. See [Streaming with SDKs](https://platform.claude.com/docs/en/build-with-claude/streaming?sdk_languages=go#streaming-with-sdks) for an example in each language.

      - `System []BetaTextBlockParam 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).

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

        - `type BetaThinkingConfigEnabledParam`

        - `type BetaThinkingConfigDisabledParam`

        - `type BetaThinkingConfigBetweenToolsParam`

        - `type BetaThinkingConfigAdaptiveParam`

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

        - `type BetaToolChoiceAutoParam`

          The model will automatically decide whether to use tools.

          - `Type Auto`

          - `DisableParallelToolUse bool Optional`

            Whether to disable parallel tool use.

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

        - `type BetaToolChoiceAnyParam`

          The model will use any available tools.

          - `Type Any`

          - `DisableParallelToolUse bool Optional`

            Whether to disable parallel tool use.

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

        - `type BetaToolChoiceToolParam`

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

          - `Type Tool`

          - `Name string`

            The name of the tool to use.

          - `DisableParallelToolUse bool Optional`

            Whether to disable parallel tool use.

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

        - `type BetaToolChoiceNoneParam`

          The model will not be allowed to use tools.

          - `Type None`

      - `Tools []BetaToolUnionParam 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.

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

      - `Temperature float64 Optional`

        **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting temperature. A value of 1.0 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.

        Amount of randomness injected into the response.

        Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks.

        Note that even with `temperature` of `0.0`, the results will not be fully deterministic.

        minimum: 0, maximum: 1

      - `TopK int64 Optional`

        **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not accept top_k; any value will be rejected with a 400 error.

        Only sample from the top K options for each subsequent token.

        Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).

        Recommended for advanced use cases only.

        minimum: 0

      - `TopP float64 Optional`

        **Deprecated**: Deprecated. Models released after Claude Opus 4.6 do not support setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all other values will be rejected with a 400 error.

        Use nucleus sampling.

        In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`.

        Recommended for advanced use cases only.

        minimum: 0, maximum: 1

  - `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 the requests in this batch to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header. Applies to every request in the batch; an individual request whose `user_profile_id` body field conflicts with this header is errored.

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

#### Returns

- `type BetaMessageBatch`

  - `Type MessageBatch`

    Object type.

    For Message Batches, this is always `"message_batch"`.

    default: message_batch

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `ArchivedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.

    format: date-time

  - `CancelInitiatedAt Time`

    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was created.

    format: date-time

  - `EndedAt Time`

    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.

    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.

    format: date-time

  - `ProcessingStatus BetaMessageBatchProcessingStatus`

    Processing status of the Message Batch.

    - `const BetaMessageBatchProcessingStatusInProgress BetaMessageBatchProcessingStatus = "in_progress"`

    - `const BetaMessageBatchProcessingStatusCanceling BetaMessageBatchProcessingStatus = "canceling"`

    - `const BetaMessageBatchProcessingStatusEnded BetaMessageBatchProcessingStatus = "ended"`

  - `RequestCounts BetaMessageBatchRequestCounts`

    Tallies requests within the Message Batch, categorized by their status.

    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.

    - `Canceled int64`

      Number of requests in the Message Batch that have been canceled.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Errored int64`

      Number of requests in the Message Batch that encountered an error.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Expired int64`

      Number of requests in the Message Batch that have expired.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Processing int64`

      Number of requests in the Message Batch that are processing.

      default: 0

    - `Succeeded int64`

      Number of requests in the Message Batch that have completed successfully.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

  - `ResultsURL string`

    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.

    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

#### 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"),
	)
	betaMessageBatch, err := client.Beta.Messages.Batches.New(context.TODO(), anthropic.BetaMessageBatchNewParams{
		Requests: []anthropic.BetaMessageBatchNewParamsRequest{anthropic.BetaMessageBatchNewParamsRequest{
			CustomID: "my-custom-id-1",
			Params: anthropic.BetaMessageBatchNewParamsRequestParams{
				MaxTokens: 1024,
				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", betaMessageBatch.ID)
}
```

##### Response (200)

```json
{
  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
  "archived_at": "2024-08-20T18:37:24.100435Z",
  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
  "created_at": "2024-08-20T18:37:24.100435Z",
  "ended_at": "2024-08-20T18:37:24.100435Z",
  "expires_at": "2024-08-20T18:37:24.100435Z",
  "processing_status": "in_progress",
  "request_counts": {
    "canceled": 10,
    "errored": 30,
    "expired": 10,
    "processing": 100,
    "succeeded": 50
  },
  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
  "type": "message_batch"
}
```

### Retrieve a Message Batch

`client.Beta.Messages.Batches.Get(ctx, messageBatchID, query) (*BetaMessageBatch, error)`

**GET** `/v1/messages/batches/{message_batch_id}`

This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.

Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing?sdk_languages=go)

#### Parameters

- `messageBatchID string` (path parameter)

  ID of the Message Batch.

- `query BetaMessageBatchGetParams`

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

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

#### Returns

- `type BetaMessageBatch`

  - `Type MessageBatch`

    Object type.

    For Message Batches, this is always `"message_batch"`.

    default: message_batch

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `ArchivedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.

    format: date-time

  - `CancelInitiatedAt Time`

    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was created.

    format: date-time

  - `EndedAt Time`

    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.

    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.

    format: date-time

  - `ProcessingStatus BetaMessageBatchProcessingStatus`

    Processing status of the Message Batch.

    - `const BetaMessageBatchProcessingStatusInProgress BetaMessageBatchProcessingStatus = "in_progress"`

    - `const BetaMessageBatchProcessingStatusCanceling BetaMessageBatchProcessingStatus = "canceling"`

    - `const BetaMessageBatchProcessingStatusEnded BetaMessageBatchProcessingStatus = "ended"`

  - `RequestCounts BetaMessageBatchRequestCounts`

    Tallies requests within the Message Batch, categorized by their status.

    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.

    - `Canceled int64`

      Number of requests in the Message Batch that have been canceled.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Errored int64`

      Number of requests in the Message Batch that encountered an error.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Expired int64`

      Number of requests in the Message Batch that have expired.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Processing int64`

      Number of requests in the Message Batch that are processing.

      default: 0

    - `Succeeded int64`

      Number of requests in the Message Batch that have completed successfully.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

  - `ResultsURL string`

    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.

    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

#### 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"),
	)
	betaMessageBatch, err := client.Beta.Messages.Batches.Get(
		context.TODO(),
		"message_batch_id",
		anthropic.BetaMessageBatchGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaMessageBatch.ID)
}
```

##### Response (200)

```json
{
  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
  "archived_at": "2024-08-20T18:37:24.100435Z",
  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
  "created_at": "2024-08-20T18:37:24.100435Z",
  "ended_at": "2024-08-20T18:37:24.100435Z",
  "expires_at": "2024-08-20T18:37:24.100435Z",
  "processing_status": "in_progress",
  "request_counts": {
    "canceled": 10,
    "errored": 30,
    "expired": 10,
    "processing": 100,
    "succeeded": 50
  },
  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
  "type": "message_batch"
}
```

### List Message Batches

`client.Beta.Messages.Batches.List(ctx, params) (*Page[BetaMessageBatch], error)`

**GET** `/v1/messages/batches`

List all Message Batches within a Workspace. Most recently created batches are returned first.

Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing?sdk_languages=go)

#### Parameters

- `params BetaMessageBatchListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

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

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

#### Returns

- `type BetaMessageBatch`

  - `Type MessageBatch`

    Object type.

    For Message Batches, this is always `"message_batch"`.

    default: message_batch

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `ArchivedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.

    format: date-time

  - `CancelInitiatedAt Time`

    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was created.

    format: date-time

  - `EndedAt Time`

    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.

    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.

    format: date-time

  - `ProcessingStatus BetaMessageBatchProcessingStatus`

    Processing status of the Message Batch.

    - `const BetaMessageBatchProcessingStatusInProgress BetaMessageBatchProcessingStatus = "in_progress"`

    - `const BetaMessageBatchProcessingStatusCanceling BetaMessageBatchProcessingStatus = "canceling"`

    - `const BetaMessageBatchProcessingStatusEnded BetaMessageBatchProcessingStatus = "ended"`

  - `RequestCounts BetaMessageBatchRequestCounts`

    Tallies requests within the Message Batch, categorized by their status.

    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.

    - `Canceled int64`

      Number of requests in the Message Batch that have been canceled.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Errored int64`

      Number of requests in the Message Batch that encountered an error.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Expired int64`

      Number of requests in the Message Batch that have expired.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Processing int64`

      Number of requests in the Message Batch that are processing.

      default: 0

    - `Succeeded int64`

      Number of requests in the Message Batch that have completed successfully.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

  - `ResultsURL string`

    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.

    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

#### 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"),
	)
	page, err := client.Beta.Messages.Batches.List(context.TODO(), anthropic.BetaMessageBatchListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
      "archived_at": "2024-08-20T18:37:24.100435Z",
      "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
      "created_at": "2024-08-20T18:37:24.100435Z",
      "ended_at": "2024-08-20T18:37:24.100435Z",
      "expires_at": "2024-08-20T18:37:24.100435Z",
      "processing_status": "in_progress",
      "request_counts": {
        "canceled": 10,
        "errored": 30,
        "expired": 10,
        "processing": 100,
        "succeeded": 50
      },
      "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
      "type": "message_batch"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Cancel a Message Batch

`client.Beta.Messages.Batches.Cancel(ctx, messageBatchID, body) (*BetaMessageBatch, error)`

**POST** `/v1/messages/batches/{message_batch_id}/cancel`

Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.

The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.

Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing?sdk_languages=go)

#### Parameters

- `messageBatchID string` (path parameter)

  ID of the Message Batch.

- `body BetaMessageBatchCancelParams`

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

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

#### Returns

- `type BetaMessageBatch`

  - `Type MessageBatch`

    Object type.

    For Message Batches, this is always `"message_batch"`.

    default: message_batch

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `ArchivedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was archived and its results became unavailable.

    format: date-time

  - `CancelInitiatedAt Time`

    RFC 3339 datetime string representing the time at which cancellation was initiated for the Message Batch. Specified only if cancellation was initiated.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch was created.

    format: date-time

  - `EndedAt Time`

    RFC 3339 datetime string representing the time at which processing for the Message Batch ended. Specified only once processing ends.

    Processing ends when every request in a Message Batch has either succeeded, errored, canceled, or expired.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string representing the time at which the Message Batch will expire and end processing, which is 24 hours after creation.

    format: date-time

  - `ProcessingStatus BetaMessageBatchProcessingStatus`

    Processing status of the Message Batch.

    - `const BetaMessageBatchProcessingStatusInProgress BetaMessageBatchProcessingStatus = "in_progress"`

    - `const BetaMessageBatchProcessingStatusCanceling BetaMessageBatchProcessingStatus = "canceling"`

    - `const BetaMessageBatchProcessingStatusEnded BetaMessageBatchProcessingStatus = "ended"`

  - `RequestCounts BetaMessageBatchRequestCounts`

    Tallies requests within the Message Batch, categorized by their status.

    Requests start as `processing` and move to one of the other statuses only once processing of the entire batch ends. The sum of all values always matches the total number of requests in the batch.

    - `Canceled int64`

      Number of requests in the Message Batch that have been canceled.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Errored int64`

      Number of requests in the Message Batch that encountered an error.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Expired int64`

      Number of requests in the Message Batch that have expired.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

    - `Processing int64`

      Number of requests in the Message Batch that are processing.

      default: 0

    - `Succeeded int64`

      Number of requests in the Message Batch that have completed successfully.

      This is zero until processing of the entire Message Batch has ended.

      default: 0

  - `ResultsURL string`

    URL to a `.jsonl` file containing the results of the Message Batch requests. Specified only once processing ends.

    Results in the file are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

#### 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"),
	)
	betaMessageBatch, err := client.Beta.Messages.Batches.Cancel(
		context.TODO(),
		"message_batch_id",
		anthropic.BetaMessageBatchCancelParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaMessageBatch.ID)
}
```

##### Response (200)

```json
{
  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
  "archived_at": "2024-08-20T18:37:24.100435Z",
  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
  "created_at": "2024-08-20T18:37:24.100435Z",
  "ended_at": "2024-08-20T18:37:24.100435Z",
  "expires_at": "2024-08-20T18:37:24.100435Z",
  "processing_status": "in_progress",
  "request_counts": {
    "canceled": 10,
    "errored": 30,
    "expired": 10,
    "processing": 100,
    "succeeded": 50
  },
  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
  "type": "message_batch"
}
```

### Delete a Message Batch

`client.Beta.Messages.Batches.Delete(ctx, messageBatchID, body) (*BetaDeletedMessageBatch, error)`

**DELETE** `/v1/messages/batches/{message_batch_id}`

Delete a Message Batch.

Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.

Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing?sdk_languages=go)

#### Parameters

- `messageBatchID string` (path parameter)

  ID of the Message Batch.

- `body BetaMessageBatchDeleteParams`

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

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

#### Returns

- `type BetaDeletedMessageBatch`

  - `Type MessageBatchDeleted`

    Deleted object type.

    For Message Batches, this is always `"message_batch_deleted"`.

    default: message_batch_deleted

  - `ID string`

    ID of the Message Batch.

#### 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"),
	)
	betaDeletedMessageBatch, err := client.Beta.Messages.Batches.Delete(
		context.TODO(),
		"message_batch_id",
		anthropic.BetaMessageBatchDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedMessageBatch.ID)
}
```

##### Response (200)

```json
{
  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
  "type": "message_batch_deleted"
}
```

### Retrieve Message Batch results

`client.Beta.Messages.Batches.ResultsStreaming(ctx, messageBatchID, query) *jsonl.Stream[BetaMessageBatchIndividualResponse]`

**GET** `/v1/messages/batches/{message_batch_id}/results`

Streams the results of a Message Batch as a `.jsonl` file.

Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

Learn more about the Message Batches API in our [user guide](https://platform.claude.com/docs/en/build-with-claude/batch-processing?sdk_languages=go)

#### Parameters

- `messageBatchID string` (path parameter)

  ID of the Message Batch.

- `query BetaMessageBatchResultsParams`

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

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

#### Returns

- `type BetaMessageBatchIndividualResponse`

  This is a single line in the response `.jsonl` file and does not represent the response as a whole.

  - `CustomID string`

    Developer-provided ID created for each request in a Message Batch. Useful for matching results to requests, as results may be given out of request order.

    Must be unique for each request within the Message Batch.

  - `Result BetaMessageBatchResultUnion`

    Processing result for this request.

    Contains a Message output if processing was successful, an error response if processing failed, or the reason why processing was not attempted, such as cancellation or expiration.

    - `type BetaMessageBatchSucceededResult`

      - `Type Succeeded`

        default: succeeded

      - `Message BetaMessage`

        - `Type Message`

          Object type.

          For Messages, this is always `"message"`.

          default: message

        - `ID string`

          Unique object identifier.

          The format and length of IDs may change over time.

        - `Container BetaContainer`

          Information about the container used in this request.

          This will be non-null if a container tool (e.g. code execution) was used.

          - `ID string`

            Identifier for the container used in this request

          - `ExpiresAt Time`

            The time at which the container will expire.

            format: date-time

          - `Skills []BetaContainerSkill`

            Skills loaded in the container

            - `Type BetaContainerSkillType`

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

              - `const BetaContainerSkillTypeAnthropic BetaContainerSkillType = "anthropic"`

              - `const BetaContainerSkillTypeCustom BetaContainerSkillType = "custom"`

            - `SkillID string`

              Skill ID

              minLength: 1, maxLength: 64

            - `Version string`

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

              minLength: 1, maxLength: 64

        - `Content []BetaContentBlockUnion`

          Content generated by the model.

          This is an array of content blocks, each of which has a `type` that determines its shape.

          Example:

          ```json
          [{"type": "text", "text": "Hi, I'm Claude."}]
          ```

          If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output.

          For example, if the input `messages` were:

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

          Then the response `content` might be:

          ```json
          [{"type": "text", "text": "B)"}]
          ```

          - `type BetaTextBlock`

            - `Type Text`

              default: text

            - `Citations []BetaTextCitationUnion`

              Citations supporting the text block.

              The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.

              - `type BetaCitationCharLocation`

                - `Type CharLocation`

                  default: char_location

                - `CitedText string`

                - `DocumentIndex int64`

                  minimum: 0

                - `DocumentTitle string`

                - `EndCharIndex int64`

                - `FileID string`

                - `StartCharIndex int64`

                  minimum: 0

              - `type BetaCitationPageLocation`

                - `Type PageLocation`

                  default: page_location

                - `CitedText string`

                - `DocumentIndex int64`

                  minimum: 0

                - `DocumentTitle string`

                - `EndPageNumber int64`

                - `FileID string`

                - `StartPageNumber int64`

                  minimum: 1

              - `type BetaCitationContentBlockLocation`

                - `Type ContentBlockLocation`

                  default: content_block_location

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

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

                - `FileID string`

                - `StartBlockIndex int64`

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

                  minimum: 0

              - `type BetaCitationsWebSearchResultLocation`

                - `Type WebSearchResultLocation`

                  default: web_search_result_location

                - `CitedText string`

                - `EncryptedIndex string`

                - `Title string`

                  maxLength: 512

                - `URL string`

              - `type BetaCitationSearchResultLocation`

                - `Type SearchResultLocation`

                  default: search_result_location

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

            - `Text string`

          - `type BetaThinkingBlock`

            - `Type Thinking`

              default: thinking

            - `Signature string`

              A value used to verify that this thinking block was generated by Claude when it is passed back to the API.

              This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact.

              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking?sdk_languages=go) for details.

            - `Thinking string`

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

          - `type BetaRedactedThinkingBlock`

            - `Type RedactedThinking`

              default: redacted_thinking

            - `Data string`

              The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content.

              Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation.

              See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking?sdk_languages=go#redacted-thinking-blocks) for details.

          - `type BetaToolUseBlock`

            - `Type ToolUse`

              default: tool_use

            - `ID string`

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

            - `Input map[string, any]`

            - `Name string`

              minLength: 1

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

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

          - `type BetaServerToolUseBlock`

            - `Type ServerToolUse`

              default: server_tool_use

            - `ID string`

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

            - `Input map[string, any]`

            - `Name BetaServerToolUseBlockName`

              - `const BetaServerToolUseBlockNameAdvisor BetaServerToolUseBlockName = "advisor"`

              - `const BetaServerToolUseBlockNameWebSearch BetaServerToolUseBlockName = "web_search"`

              - `const BetaServerToolUseBlockNameWebFetch BetaServerToolUseBlockName = "web_fetch"`

              - `const BetaServerToolUseBlockNameCodeExecution BetaServerToolUseBlockName = "code_execution"`

              - `const BetaServerToolUseBlockNameBashCodeExecution BetaServerToolUseBlockName = "bash_code_execution"`

              - `const BetaServerToolUseBlockNameTextEditorCodeExecution BetaServerToolUseBlockName = "text_editor_code_execution"`

              - `const BetaServerToolUseBlockNameToolSearchToolRegex BetaServerToolUseBlockName = "tool_search_tool_regex"`

              - `const BetaServerToolUseBlockNameToolSearchToolBm25 BetaServerToolUseBlockName = "tool_search_tool_bm25"`

            - `Caller BetaServerToolUseBlockCallerUnion Optional`

              - `type BetaDirectCaller`

                Tool invocation directly from the model.

              - `type BetaServerToolCaller`

                Tool invocation generated by a server-side tool.

              - `type BetaServerToolCaller20260120`

          - `type BetaWebSearchToolResultBlock`

            - `Type WebSearchToolResult`

              default: web_search_tool_result

            - `Content BetaWebSearchToolResultBlockContentUnion`

              - `type BetaWebSearchToolResultError`

                - `Type WebSearchToolResultError`

                  default: web_search_tool_result_error

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

              - `[]BetaWebSearchResultBlock`

                - `Type WebSearchResult`

                  default: web_search_result

                - `EncryptedContent string`

                - `PageAge string`

                - `Title string`

                - `URL string`

            - `ToolUseID string`

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

            - `Caller BetaWebSearchToolResultBlockCallerUnion Optional`

              - `type BetaDirectCaller`

                Tool invocation directly from the model.

              - `type BetaServerToolCaller`

                Tool invocation generated by a server-side tool.

              - `type BetaServerToolCaller20260120`

          - `type BetaWebFetchToolResultBlock`

            - `Type WebFetchToolResult`

              default: web_fetch_tool_result

            - `Content BetaWebFetchToolResultBlockContentUnion`

              - `type BetaWebFetchToolResultErrorBlock`

                - `Type WebFetchToolResultError`

                  default: web_fetch_tool_result_error

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

                - `Type WebFetchResult`

                  default: web_fetch_result

                - `Content BetaDocumentBlock`

                  - `Type Document`

                    default: document

                  - `Citations BetaCitationConfig`

                    Citation configuration for the document

                    - `Enabled bool`

                      default: false

                  - `Source BetaDocumentBlockSourceUnion`

                    - `type BetaBase64PDFSource`

                      - `Type Base64`

                      - `Data string`

                        format: byte

                      - `MediaType ApplicationPDF`

                    - `type BetaPlainTextSource`

                      - `Type Text`

                      - `Data string`

                      - `MediaType TextPlain`

                  - `Title string`

                    The title of the document

                - `RetrievedAt string`

                  ISO 8601 timestamp when the content was retrieved

                - `URL string`

                  Fetched content URL

            - `ToolUseID string`

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

            - `Caller BetaWebFetchToolResultBlockCallerUnion Optional`

              - `type BetaDirectCaller`

                Tool invocation directly from the model.

              - `type BetaServerToolCaller`

                Tool invocation generated by a server-side tool.

              - `type BetaServerToolCaller20260120`

          - `type BetaAdvisorToolResultBlock`

            - `Type AdvisorToolResult`

              default: advisor_tool_result

            - `Content BetaAdvisorToolResultBlockContentUnion`

              - `type BetaAdvisorToolResultError`

                - `Type AdvisorToolResultError`

                  default: advisor_tool_result_error

                - `ErrorCode BetaAdvisorToolResultErrorErrorCode`

                  - `const BetaAdvisorToolResultErrorErrorCodeMaxUsesExceeded BetaAdvisorToolResultErrorErrorCode = "max_uses_exceeded"`

                  - `const BetaAdvisorToolResultErrorErrorCodePromptTooLong BetaAdvisorToolResultErrorErrorCode = "prompt_too_long"`

                  - `const BetaAdvisorToolResultErrorErrorCodeTooManyRequests BetaAdvisorToolResultErrorErrorCode = "too_many_requests"`

                  - `const BetaAdvisorToolResultErrorErrorCodeOverloaded BetaAdvisorToolResultErrorErrorCode = "overloaded"`

                  - `const BetaAdvisorToolResultErrorErrorCodeUnavailable BetaAdvisorToolResultErrorErrorCode = "unavailable"`

                  - `const BetaAdvisorToolResultErrorErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorErrorCode = "execution_time_exceeded"`

                  - `const BetaAdvisorToolResultErrorErrorCodeModelNotFound BetaAdvisorToolResultErrorErrorCode = "model_not_found"`

              - `type BetaAdvisorResultBlock`

                - `Type AdvisorResult`

                  default: advisor_result

                - `StopReason string`

                  The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`). `max_tokens` indicates the advisor's output was truncated at the tool's `max_tokens` value or the advisor model's policy cap.

                - `Text string`

              - `type BetaAdvisorRedactedResultBlock`

                - `Type AdvisorRedactedResult`

                  default: advisor_redacted_result

                - `EncryptedContent string`

                  Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect or modify.

                - `StopReason string`

                  The advisor sub-inference's stop reason (same values as the top-level message `stop_reason`).

            - `ToolUseID string`

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

          - `type BetaCodeExecutionToolResultBlock`

            - `Type CodeExecutionToolResult`

              default: code_execution_tool_result

            - `Content BetaCodeExecutionToolResultBlockContentUnion`

              - `type BetaCodeExecutionToolResultError`

                - `Type CodeExecutionToolResultError`

                  default: code_execution_tool_result_error

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

                - `Type CodeExecutionResult`

                  default: code_execution_result

                - `Content []BetaCodeExecutionOutputBlock`

                  - `Type CodeExecutionOutput`

                    default: code_execution_output

                  - `FileID string`

                - `ReturnCode int64`

                - `Stderr string`

                - `Stdout string`

              - `type BetaEncryptedCodeExecutionResultBlock`

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

                - `Type EncryptedCodeExecutionResult`

                  default: encrypted_code_execution_result

                - `Content []BetaCodeExecutionOutputBlock`

                  - `Type CodeExecutionOutput`

                    default: code_execution_output

                  - `FileID string`

                - `EncryptedStdout string`

                - `ReturnCode int64`

                - `Stderr string`

            - `ToolUseID string`

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

          - `type BetaBashCodeExecutionToolResultBlock`

            - `Type BashCodeExecutionToolResult`

              default: bash_code_execution_tool_result

            - `Content BetaBashCodeExecutionToolResultBlockContentUnion`

              - `type BetaBashCodeExecutionToolResultError`

                - `Type BashCodeExecutionToolResultError`

                  default: bash_code_execution_tool_result_error

                - `ErrorCode BetaBashCodeExecutionToolResultErrorErrorCode`

                  - `const BetaBashCodeExecutionToolResultErrorErrorCodeInvalidToolInput BetaBashCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"`

                  - `const BetaBashCodeExecutionToolResultErrorErrorCodeUnavailable BetaBashCodeExecutionToolResultErrorErrorCode = "unavailable"`

                  - `const BetaBashCodeExecutionToolResultErrorErrorCodeTooManyRequests BetaBashCodeExecutionToolResultErrorErrorCode = "too_many_requests"`

                  - `const BetaBashCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"`

                  - `const BetaBashCodeExecutionToolResultErrorErrorCodeOutputFileTooLarge BetaBashCodeExecutionToolResultErrorErrorCode = "output_file_too_large"`

              - `type BetaBashCodeExecutionResultBlock`

                - `Type BashCodeExecutionResult`

                  default: bash_code_execution_result

                - `Content []BetaBashCodeExecutionOutputBlock`

                  - `Type BashCodeExecutionOutput`

                    default: bash_code_execution_output

                  - `FileID string`

                - `ReturnCode int64`

                - `Stderr string`

                - `Stdout string`

            - `ToolUseID string`

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

          - `type BetaTextEditorCodeExecutionToolResultBlock`

            - `Type TextEditorCodeExecutionToolResult`

              default: text_editor_code_execution_tool_result

            - `Content BetaTextEditorCodeExecutionToolResultBlockContentUnion`

              - `type BetaTextEditorCodeExecutionToolResultError`

                - `Type TextEditorCodeExecutionToolResultError`

                  default: text_editor_code_execution_tool_result_error

                - `ErrorCode BetaTextEditorCodeExecutionToolResultErrorErrorCode`

                  - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeInvalidToolInput BetaTextEditorCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"`

                  - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeUnavailable BetaTextEditorCodeExecutionToolResultErrorErrorCode = "unavailable"`

                  - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeTooManyRequests BetaTextEditorCodeExecutionToolResultErrorErrorCode = "too_many_requests"`

                  - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"`

                  - `const BetaTextEditorCodeExecutionToolResultErrorErrorCodeFileNotFound BetaTextEditorCodeExecutionToolResultErrorErrorCode = "file_not_found"`

                - `ErrorMessage string`

              - `type BetaTextEditorCodeExecutionViewResultBlock`

                - `Type TextEditorCodeExecutionViewResult`

                  default: text_editor_code_execution_view_result

                - `Content string`

                - `FileType BetaTextEditorCodeExecutionViewResultBlockFileType`

                  - `const BetaTextEditorCodeExecutionViewResultBlockFileTypeText BetaTextEditorCodeExecutionViewResultBlockFileType = "text"`

                  - `const BetaTextEditorCodeExecutionViewResultBlockFileTypeImage BetaTextEditorCodeExecutionViewResultBlockFileType = "image"`

                  - `const BetaTextEditorCodeExecutionViewResultBlockFileTypePDF BetaTextEditorCodeExecutionViewResultBlockFileType = "pdf"`

                - `NumLines int64`

                - `StartLine int64`

                - `TotalLines int64`

              - `type BetaTextEditorCodeExecutionCreateResultBlock`

                - `Type TextEditorCodeExecutionCreateResult`

                  default: text_editor_code_execution_create_result

                - `IsFileUpdate bool`

              - `type BetaTextEditorCodeExecutionStrReplaceResultBlock`

                - `Type TextEditorCodeExecutionStrReplaceResult`

                  default: text_editor_code_execution_str_replace_result

                - `Lines []string`

                - `NewLines int64`

                - `NewStart int64`

                - `OldLines int64`

                - `OldStart int64`

            - `ToolUseID string`

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

          - `type BetaToolSearchToolResultBlock`

            - `Type ToolSearchToolResult`

              default: tool_search_tool_result

            - `Content BetaToolSearchToolResultBlockContentUnion`

              - `type BetaToolSearchToolResultError`

                - `Type ToolSearchToolResultError`

                  default: tool_search_tool_result_error

                - `ErrorCode BetaToolSearchToolResultErrorErrorCode`

                  - `const BetaToolSearchToolResultErrorErrorCodeInvalidToolInput BetaToolSearchToolResultErrorErrorCode = "invalid_tool_input"`

                  - `const BetaToolSearchToolResultErrorErrorCodeUnavailable BetaToolSearchToolResultErrorErrorCode = "unavailable"`

                  - `const BetaToolSearchToolResultErrorErrorCodeTooManyRequests BetaToolSearchToolResultErrorErrorCode = "too_many_requests"`

                  - `const BetaToolSearchToolResultErrorErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorErrorCode = "execution_time_exceeded"`

                - `ErrorMessage string`

              - `type BetaToolSearchToolSearchResultBlock`

                - `Type ToolSearchToolSearchResult`

                  default: tool_search_tool_search_result

                - `ToolReferences []BetaToolReferenceBlock`

                  - `Type ToolReference`

                    default: tool_reference

                  - `ToolName string`

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

            - `ToolUseID string`

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

          - `type BetaMCPToolUseBlock`

            - `Type MCPToolUse`

              default: mcp_tool_use

            - `ID string`

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

            - `Input map[string, any]`

            - `Name string`

              The name of the MCP tool

            - `ServerName string`

              The name of the MCP server

          - `type BetaMCPToolResultBlock`

            - `Type MCPToolResult`

              default: mcp_tool_result

            - `Content BetaMCPToolResultBlockContentUnion`

              - `string`

              - `[]BetaTextBlock`

                - `Type Text`

                  default: text

                - `Citations []BetaTextCitationUnion`

                  Citations supporting the text block.

                  The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`.

                - `Text string`

            - `IsError bool`

              default: false

            - `ToolUseID string`

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

          - `type BetaContainerUploadBlock`

            Response model for a file uploaded to the container.

            - `Type ContainerUpload`

              default: container_upload

            - `FileID string`

          - `type BetaCompactionBlock`

            A compaction block returned when autocompact is triggered.

            When content is None, it indicates the compaction failed to produce a valid
            summary (e.g., malformed output from the model). Clients may round-trip
            compaction blocks with null content; the server treats them as no-ops.

            - `Type Compaction`

              default: compaction

            - `Content string`

              Summary of compacted content, or null if compaction failed

            - `EncryptedContent string`

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

            - `Signature string Optional`

              Signature over the summary, to be sent back with the block verbatim

            - `ToolChanges []BetaCompactionBlockToolChangeUnion Optional`

              The tool changes of the compacted range: the `tool_addition` and `tool_removal` blocks that take the request's `tools` to the tool set in effect at the end of the range, or `[]` when the range changed no tool. Absent when the server did not compute them. Send the block back unchanged.

              - `type BetaResponseToolAdditionBlock`

                An entry of a `compaction` block's `tool_changes`: a tool the
                compacted range made available, as a reference to a `tools` entry or
                MCP toolset, or as the tool definition in effect at the end of the
                range, by value. Send it back unchanged.

                - `Type ToolAddition`

                  default: tool_addition

                - `Tool BetaResponseToolAdditionBlockToolUnion`

                  The tool made available: a reference to a `tools` entry or MCP toolset, or a `tool_definition` carrying the definition by value.

                  - `type BetaResponseToolChangeToolReference`

                    Reference to a single tool, by the name the model uses to call it, as
                    a `compaction` block's `tool_changes` entry reports it: a tool
                    declared in `tools` or defined by an earlier `tool_addition` block.
                    Send it back unchanged with the block.

                    - `Type ToolReference`

                      default: tool_reference

                    - `Name string`

                  - `type BetaResponseToolChangeMCPToolReference`

                    Reference to a single MCP tool, by its server and its name on that
                    server, as a `compaction` block's `tool_changes` entry reports it.
                    Send it back unchanged with the block.

                    - `Type MCPToolReference`

                      default: mcp_tool_reference

                    - `Name string`

                    - `ServerName string`

                  - `type BetaResponseToolChangeMCPToolsetReference`

                    Reference to every tool in the named MCP server's toolset, as a
                    `compaction` block's `tool_changes` entry reports it. Send it back
                    unchanged with the block.

                    - `Type MCPToolsetReference`

                      default: mcp_toolset_reference

                    - `ServerName string`

                  - `type BetaToolChangeToolDefinition`

                    A tool defined by value, as a `compaction` block's `tool_changes` entry
                    reports it: `definition` is the tool's definition as it was sent, in the
                    form of a `tools` entry, without `cache_control`. Send it back unchanged
                    with the block.

                    - `Type ToolDefinition`

                      default: tool_definition

                    - `Definition BetaResponseToolUnion`

                      - `type BetaResponseTool`

                        A custom tool definition, as sent.

                        - `Type BetaResponseToolType Optional`

                        - `InputSchema BetaResponseToolInputSchema`

                          [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 BetaResponseToolAllowedCallerDirect BetaResponseToolAllowedCaller = "direct"`

                          - `const BetaResponseToolAllowedCallerCodeExecution20250825 BetaResponseToolAllowedCaller = "code_execution_20250825"`

                          - `const BetaResponseToolAllowedCallerCodeExecution20260120 BetaResponseToolAllowedCaller = "code_execution_20260120"`

                          - `const BetaResponseToolAllowedCallerCodeExecution20260521 BetaResponseToolAllowedCaller = "code_execution_20260521"`

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

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

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

                          - `Enabled bool Optional`

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

              - `type BetaResponseToolRemovalBlock`

                An entry of a `compaction` block's `tool_changes`: a tool of the
                request's `tools` (or an MCP tool or toolset) that the compacted range
                withdrew. Send it back unchanged.

                - `Type ToolRemoval`

                  default: tool_removal

                - `Tool BetaResponseToolRemovalBlockToolUnion`

                  A reference to the withdrawn `tools` entry, MCP tool or MCP toolset.

                  - `type BetaResponseToolChangeToolReference`

                    Reference to a single tool, by the name the model uses to call it, as
                    a `compaction` block's `tool_changes` entry reports it: a tool
                    declared in `tools` or defined by an earlier `tool_addition` block.
                    Send it back unchanged with the block.

                  - `type BetaResponseToolChangeMCPToolReference`

                    Reference to a single MCP tool, by its server and its name on that
                    server, as a `compaction` block's `tool_changes` entry reports it.
                    Send it back unchanged with the block.

                  - `type BetaResponseToolChangeMCPToolsetReference`

                    Reference to every tool in the named MCP server's toolset, as a
                    `compaction` block's `tool_changes` entry reports it. Send it back
                    unchanged with the block.

          - `type BetaFallbackBlock`

            Marks the point in `content` where one model's output gives way to the next.

            One block appears per hop where a preceding model actually ran this turn and
            declined. A turn where no preceding model ran and declined has no such
            boundary and carries no block — the signal for whether a fallback model
            served the response is the presence of a `fallback_message` entry in
            `usage.iterations`, not this block.

            The block is treated like a server-tool content block for streaming: it
            arrives via the standard `content_block_start` / `content_block_stop`
            pair and carries no deltas.

            - `Type Fallback`

              default: fallback

            - `From BetaFallbackInfo`

              The model whose output ends at this point — the model that declined at this hop. When the declining hop is the requested model, its `model` echoes the top-level `model` string the caller sent (alias or canonical); when the declining hop is a fallback model, its `model` is that model's canonical id.

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

              The fallback model producing the content that follows this block. Its `model` is always the canonical id.

            - `Trigger BetaFallbackRefusalTrigger`

              What caused the `from` model to hand over at this hop.

              - `Type Refusal`

                default: refusal

              - `Category BetaFallbackRefusalTriggerCategory`

                The policy category that triggered the `from` model's refusal at this hop. `null` when the refusal doesn't map to a named category. Same vocabulary as `stop_details.category`.

                - `const BetaFallbackRefusalTriggerCategoryCyber BetaFallbackRefusalTriggerCategory = "cyber"`

                  The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.

                - `const BetaFallbackRefusalTriggerCategoryBio BetaFallbackRefusalTriggerCategory = "bio"`

                  The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.

                - `const BetaFallbackRefusalTriggerCategoryFrontierLLM BetaFallbackRefusalTriggerCategory = "frontier_llm"`

                  The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.

                - `const BetaFallbackRefusalTriggerCategoryReasoningExtraction BetaFallbackRefusalTriggerCategory = "reasoning_extraction"`

                  The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking?sdk_languages=go).

                - `const BetaFallbackRefusalTriggerCategoryGeneralHarms BetaFallbackRefusalTriggerCategory = "general_harms"`

                  The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.

          - `type BetaMCPToolListingBlock`

            The tool listing the server fetched from an MCP server while producing
            this response. Send the assistant message back unchanged, this block
            included, so later requests use this listing instead of asking the MCP
            server again.

            - `Type MCPToolListing`

              default: mcp_tool_listing

            - `MCPServerName string`

            - `Tools []BetaMCPTool`

              - `InputSchema map[string, any]`

              - `Name string`

              - `Description string Optional`

        - `ContextManagement BetaContextManagementResponse`

          Context management response.

          Information about context management strategies applied during the request.

          - `AppliedEdits []BetaContextManagementResponseAppliedEditUnion`

            List of context management edits that were applied.

            - `type BetaClearToolUses20250919EditResponse`

              - `Type ClearToolUses20250919`

                The type of context management edit applied.

                default: clear_tool_uses_20250919

              - `ClearedInputTokens int64`

                Number of input tokens cleared by this edit.

                minimum: 0

              - `ClearedToolUses int64`

                Number of tool uses that were cleared.

                minimum: 0

            - `type BetaClearThinking20251015EditResponse`

              - `Type ClearThinking20251015`

                The type of context management edit applied.

                default: clear_thinking_20251015

              - `ClearedInputTokens int64`

                Number of input tokens cleared by this edit.

                minimum: 0

              - `ClearedThinkingTurns int64`

                Number of thinking turns that were cleared.

                minimum: 0

        - `Diagnostics BetaDiagnostics`

          Request-level diagnostics. `null` when the request did not supply `diagnostics`, or when it did and no prompt-cache divergence was detected.

          - `CacheMissReason BetaCacheMissReasonUnion`

            Explains why the prompt cache could not fully reuse the prefix from the request identified by `diagnostics.previous_message_id`. `null` means diagnosis is still pending — the response was serialized before the background comparison completed.

            - `type BetaCacheMissModelChanged`

              - `Type ModelChanged`

                default: model_changed

              - `CacheMissedInputTokens int64`

                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

            - `type BetaCacheMissSystemChanged`

              - `Type SystemChanged`

                default: system_changed

              - `CacheMissedInputTokens int64`

                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

            - `type BetaCacheMissToolsChanged`

              - `Type ToolsChanged`

                default: tools_changed

              - `CacheMissedInputTokens int64`

                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

            - `type BetaCacheMissMessagesChanged`

              - `Type MessagesChanged`

                default: messages_changed

              - `CacheMissedInputTokens int64`

                Approximate number of input tokens that would have been read from cache had the prefix matched the previous request.

            - `type BetaCacheMissPreviousMessageNotFound`

              - `Type PreviousMessageNotFound`

                default: previous_message_not_found

            - `type BetaCacheMissUnavailable`

              - `Type Unavailable`

                default: unavailable

        - `Model Model`

          The model that will complete your prompt.

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

        - `Role Assistant`

          Conversational role of the generated message.

          This will always be `"assistant"`.

          default: assistant

        - `StopDetails BetaRefusalStopDetails`

          Structured information about why model output stopped.

          This is `null` when the `stop_reason` has no additional detail to report.

          - `Type Refusal`

            default: refusal

          - `Category BetaRefusalStopDetailsCategory`

            The policy category that triggered the refusal.

            `null` when the refusal doesn't map to a named category.

            - `const BetaRefusalStopDetailsCategoryCyber BetaRefusalStopDetailsCategory = "cyber"`

              The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category.

            - `const BetaRefusalStopDetailsCategoryBio BetaRefusalStopDetailsCategory = "bio"`

              The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category.

            - `const BetaRefusalStopDetailsCategoryFrontierLLM BetaRefusalStopDetailsCategory = "frontier_llm"`

              The request could assist the development of competing AI models, which is restricted under [Anthropic's commercial terms](https://www.anthropic.com/legal/commercial-terms). Benign machine learning work can also trigger this category.

            - `const BetaRefusalStopDetailsCategoryReasoningExtraction BetaRefusalStopDetailsCategory = "reasoning_extraction"`

              The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking?sdk_languages=go).

            - `const BetaRefusalStopDetailsCategoryGeneralHarms BetaRefusalStopDetailsCategory = "general_harms"`

              The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category.

          - `Explanation string`

            Human-readable explanation of the refusal.

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

          - `FallbackCreditToken string`

            Opaque code that refunds the cache-miss cost when retrying this refused
            request on the fallback model. Pass it as `fallback_credit_token` on the
            retry request. Expires 5 minutes after the refusal.

            The retry is sent either with the same request body (`system`, `messages`,
            `tools`, and other render-shaping fields), or with the same body plus one
            appended `assistant` message whose content is the partial text (with any
            trailing whitespace stripped from the final text block) and paired
            server-tool blocks from this refusal — which also authorizes that
            appended turn as an assistant-prefill continuation on models that otherwise
            disallow prefill. A token minted mid-server-tool-loop whose partial content
            was continuable may only be redeemed the second way — if a same-body retry
            is rejected with a 400 saying the token must be redeemed by continuing the
            partial response, retry the second way instead. Either way: same workspace,
            same platform; a mismatch is a 400. Resending a token for an already-warm
            prefix is permitted but yields no additional credit.

            `null` when the refused model isn't eligible for a fallback credit.

          - `FallbackHasPrefillClaim bool`

            Whether the accompanying `fallback_credit_token` may be redeemed with the
            appended-assistant retry form. Only set when `fallback_credit_token` is
            present.

            `true`: retry by resending the same request body plus one appended
            `assistant` message whose content is this response's `content` with any
            trailing whitespace stripped from the final text block and unpaired
            `tool_use` blocks omitted (the same appended-turn shape described on
            `fallback_credit_token`), with the token attached. `false`: retry by
            resending the original request body unchanged, with the token attached —
            the appended-assistant form is not available for this refusal (no
            continuable partial content, or the request uses `output_format` or a
            `tool_choice` that forces tool use). One exception: when the request used
            `output_format` or a forced `tool_choice` and the refusal arrived after
            server tools (including MCP connector tools) had already executed, the
            token may not be redeemable by either retry form; if the exact-body retry
            is then rejected with a 400 saying the token must be redeemed by
            continuing the partial response, discard the token and retry without it.

            Advisory: if an appended-assistant retry is rejected with a 400 despite
            `true`, fall back to resending the original request body with the token.

          - `RecommendedModel string`

            The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.

        - `StopReason BetaStopReason`

          The reason that we stopped.

          This may be one the following values:

          * `"end_turn"`: the model reached a natural stopping point
          * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
          * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
          * `"tool_use"`: the model invoked one or more tools
          * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue.
          * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
          * `"model_context_window_exceeded"`: we exceeded the model's context window

          In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise.

          - `const BetaStopReasonEndTurn BetaStopReason = "end_turn"`

          - `const BetaStopReasonMaxTokens BetaStopReason = "max_tokens"`

          - `const BetaStopReasonStopSequence BetaStopReason = "stop_sequence"`

          - `const BetaStopReasonToolUse BetaStopReason = "tool_use"`

          - `const BetaStopReasonPauseTurn BetaStopReason = "pause_turn"`

          - `const BetaStopReasonCompaction BetaStopReason = "compaction"`

          - `const BetaStopReasonRefusal BetaStopReason = "refusal"`

          - `const BetaStopReasonModelContextWindowExceeded BetaStopReason = "model_context_window_exceeded"`

        - `StopSequence string`

          Which custom stop sequence was generated, if any.

          This value will be a non-null string if one of your custom stop sequences was generated.

        - `Usage BetaUsage`

          Billing and rate-limit usage.

          Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.

          Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response.

          For example, `output_tokens` will be non-zero, even for an empty string response from Claude.

          Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`.

          - `CacheCreation BetaCacheCreation`

            Breakdown of cached tokens by TTL

            - `Ephemeral1hInputTokens int64`

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

              default: 0, minimum: 0

            - `Ephemeral5mInputTokens int64`

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

              default: 0, minimum: 0

          - `CacheCreationInputTokens int64`

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

            minimum: 0

          - `CacheReadInputTokens int64`

            The number of input tokens read from the cache.

            minimum: 0

          - `FallbackCredit BetaFallbackCreditUsage`

            Outcome of the `fallback_credit_token` presented on this request.

            Present on every response to a non-batch request that carried a
            `fallback_credit_token`, in either redemption mode; absent otherwise (batch
            items accept and ignore the token and carry no outcome object).

            - `Status BetaFallbackCreditUsageStatusUnion`

              Whether the fallback-credit reprice was applied to this response's billing.

              A union discriminated on `type`. `redeemed`: the retry is billed as if
              the conversation had been on the retry model all along — including when the
              resulting shift is zero because there was nothing to move. `not_applied`:
              no reprice was applied; the arm's `reason` says why.

              - `type BetaFallbackCreditRedeemed`

                The reprice was applied: the retry is billed as if the conversation
                had been on the retry model all along.

                - `Type Redeemed`

                  default: redeemed

              - `type BetaFallbackCreditNotApplied`

                No reprice was applied; `reason` says why.

                - `Type NotApplied`

                  default: not_applied

                - `Reason BetaFallbackCreditNotAppliedReason`

                  Why the reprice was not applied.

                  A closed enum; additions to the redemption-check vocabulary arrive as
                  deliberate schema updates.

                  - `const BetaFallbackCreditNotAppliedReasonBodyMismatch BetaFallbackCreditNotAppliedReason = "body_mismatch"`

                  - `const BetaFallbackCreditNotAppliedReasonContinuationExcluded BetaFallbackCreditNotAppliedReason = "continuation_excluded"`

                  - `const BetaFallbackCreditNotAppliedReasonContinuationOnly BetaFallbackCreditNotAppliedReason = "continuation_only"`

                  - `const BetaFallbackCreditNotAppliedReasonExpired BetaFallbackCreditNotAppliedReason = "expired"`

                  - `const BetaFallbackCreditNotAppliedReasonInvalidTargetModel BetaFallbackCreditNotAppliedReason = "invalid_target_model"`

                  - `const BetaFallbackCreditNotAppliedReasonNotEnabled BetaFallbackCreditNotAppliedReason = "not_enabled"`

                  - `const BetaFallbackCreditNotAppliedReasonRepriceUnavailable BetaFallbackCreditNotAppliedReason = "reprice_unavailable"`

                  - `const BetaFallbackCreditNotAppliedReasonTemporarilyUnavailable BetaFallbackCreditNotAppliedReason = "temporarily_unavailable"`

                  - `const BetaFallbackCreditNotAppliedReasonVariantFieldsPresent BetaFallbackCreditNotAppliedReason = "variant_fields_present"`

                  - `const BetaFallbackCreditNotAppliedReasonWrongOrganization BetaFallbackCreditNotAppliedReason = "wrong_organization"`

                  - `const BetaFallbackCreditNotAppliedReasonWrongPlatform BetaFallbackCreditNotAppliedReason = "wrong_platform"`

                  - `const BetaFallbackCreditNotAppliedReasonWrongWorkspace BetaFallbackCreditNotAppliedReason = "wrong_workspace"`

                - `RemoveToRedeem []string Optional`

                  Request fields to remove before retrying, so the retry can redeem this
                  token.

                  Present exactly when `reason` is `variant_fields_present` — never null,
                  never an empty array; absent otherwise. Fields are named only from your own request, and only after
                  the sealed variant hash matched. A served best-effort retry has already
                  been billed at normal price; nothing redeems retroactively, but a corrected
                  re-send inside the token's five-minute window can still redeem.

          - `InferenceGeo string`

            The geographic region where inference was performed for this request.

          - `InputTokens int64`

            The number of input tokens which were used.

            minimum: 0

          - `Iterations BetaIterationsUsage`

            Per-iteration token usage breakdown.

            Each entry represents one sampling iteration, with its own input/output token counts and cache statistics, discriminated by `type`. For `message` entries (model sampling iterations, such as the turns of a server-side tool use loop), this allows you to:

            - Calculate the context window size from the last `message` entry
            - Understand token accumulation across server-side tool use loops

            A `compaction` entry reports the token usage of the compaction operation itself — the server-side request that summarizes the context being closed — NOT the size of the context that was compacted away, and its token counts can be much smaller than that closed context (for example, a compaction that closes a ~200k-token context can report only a few thousand tokens). Do not derive the context window size from a `compaction` entry, even when it is the last entry. A `compaction` entry's tokens are not included in the top-level `usage` fields. When an input-token trigger is in effect (the default — 150,000 tokens unless configured otherwise), each `compaction` entry closes a context that had reached at least that threshold, though the context can exceed it by the final iteration's output and tool results.

            - `type BetaMessageIterationUsage`

              Token usage for a sampling iteration.

              - `Type Message`

                Usage for a sampling iteration

                default: message

              - `CacheCreation BetaCacheCreation`

                Breakdown of cached tokens by TTL

              - `CacheCreationInputTokens int64`

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

                default: 0, minimum: 0

              - `CacheReadInputTokens int64`

                The number of input tokens read from the cache.

                default: 0, minimum: 0

              - `InputTokens int64`

                The number of input tokens which were used.

                minimum: 0

              - `Model Model`

                The model that will complete your prompt.

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

              - `OutputTokens int64`

                The number of output tokens which were used.

                minimum: 0

            - `type BetaCompactionIterationUsage`

              Token usage for a compaction iteration.

              - `Type Compaction`

                Usage for a compaction iteration

                default: compaction

              - `CacheCreation BetaCacheCreation`

                Breakdown of cached tokens by TTL

              - `CacheCreationInputTokens int64`

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

                default: 0, minimum: 0

              - `CacheReadInputTokens int64`

                The number of input tokens read from the cache.

                default: 0, minimum: 0

              - `InputTokens int64`

                The number of input tokens which were used.

                minimum: 0

              - `OutputTokens int64`

                The number of output tokens which were used.

                minimum: 0

            - `type BetaAdvisorMessageIterationUsage`

              Token usage for an advisor sub-inference iteration.

              - `Type AdvisorMessage`

                Usage for an advisor sub-inference iteration

                default: advisor_message

              - `CacheCreation BetaCacheCreation`

                Breakdown of cached tokens by TTL

              - `CacheCreationInputTokens int64`

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

                default: 0, minimum: 0

              - `CacheReadInputTokens int64`

                The number of input tokens read from the cache.

                default: 0, minimum: 0

              - `InputTokens int64`

                The number of input tokens which were used.

                minimum: 0

              - `Model Model`

                The model that will complete your prompt.

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

              - `OutputTokens int64`

                The number of output tokens which were used.

                minimum: 0

            - `type BetaFallbackMessageIterationUsage`

              Token usage for the fallback-model attempt of a server-side fallback request.

              The terminal entry of a fallback-served turn: when a fallback hop's
              output is the returned message, the entry for the iteration that
              completed it carries this type in place of `message`. A declined hop
              and the serving hop's earlier tool-loop iterations produce `message`
              entries. Whether a fallback model served the response is signalled by
              the presence of this entry in `usage.iterations`.

              - `Type FallbackMessage`

                Usage for the fallback-model attempt that served the response

                default: fallback_message

              - `CacheCreation BetaCacheCreation`

                Breakdown of cached tokens by TTL

              - `CacheCreationInputTokens int64`

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

                default: 0, minimum: 0

              - `CacheReadInputTokens int64`

                The number of input tokens read from the cache.

                default: 0, minimum: 0

              - `InputTokens int64`

                The number of input tokens which were used.

                minimum: 0

              - `Model Model`

                The model that will complete your prompt.

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

              - `OutputTokens int64`

                The number of output tokens which were used.

                minimum: 0

          - `OutputTokens int64`

            The number of output tokens which were used.

            minimum: 0

          - `OutputTokensDetails BetaOutputTokensDetails`

            Breakdown of output tokens by category.

            `output_tokens` remains the inclusive, authoritative total used for billing.
            This object provides a read-only decomposition for observability — for example,
            how many of the billed output tokens were spent on internal reasoning that may
            have been summarized before being returned to you.

            - `ThinkingTokens int64`

              Number of output tokens the model generated as internal reasoning, including
              the thinking-block delimiter tokens.

              Reflects the raw reasoning the model produced, not the (possibly shorter)
              summarized thinking text returned in the response body. Computed by
              re-tokenizing the raw reasoning text, so it may differ from the model's exact
              generation count by a small number of tokens. Always ≤ `output_tokens`;
              `output_tokens - thinking_tokens` approximates the non-reasoning output.

              default: 0, minimum: 0

          - `ServerToolUse BetaServerToolUsage`

            The number of server tool requests.

            - `WebFetchRequests int64`

              The number of web fetch tool requests.

              default: 0, minimum: 0

            - `WebSearchRequests int64`

              The number of web search tool requests.

              default: 0, minimum: 0

          - `ServiceTier BetaUsageServiceTier`

            If the request used the priority, standard, or batch tier.

            - `const BetaUsageServiceTierStandard BetaUsageServiceTier = "standard"`

            - `const BetaUsageServiceTierPriority BetaUsageServiceTier = "priority"`

            - `const BetaUsageServiceTierBatch BetaUsageServiceTier = "batch"`

          - `Speed BetaUsageSpeed`

            The inference speed mode used for this request.

            - `const BetaUsageSpeedStandard BetaUsageSpeed = "standard"`

            - `const BetaUsageSpeedFast BetaUsageSpeed = "fast"`

        - `InputTransformations []BetaInputTransformationUnion Optional`

          Changes the API made to the request's input before showing it to the model,
          and blocks that failed a binding check but were left unchanged: one entry per
          block, in request order. Two entry types today. `thinking_dropped` — a
          `thinking`, `redacted_thinking` or `connector_text` block from the request's
          `messages` that was removed from the prompt instead of being shown to the
          model because it failed a binding check. `thinking_mismatch_allowed` — a
          `thinking` or `redacted_thinking` block that failed the conversation check
          (the conversation before it differs from the one it was created in, or it
          carries no record of one on a model that requires it) and was shown to the
          model all the same, because that check is not enforced for this request.
          More entry types may be added over time; ignore types you do not recognize.

          Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on
          every such response from a model that supports extended thinking, as `[]`
          when there is no entry to report; without the beta, blocks are removed or
          left in place all the same but nothing is reported. Removed blocks contribute
          nothing to `usage.input_tokens`; blocks left in place count as sent. When
          streaming, the array is final in `message_start`; the final `message_delta`
          event carries it only when a server-side model fallback happened mid-stream,
          in which case it holds the serving model's entries and replaces the one in
          `message_start`.

          - `type BetaThinkingDroppedInputTransformation`

            - `Type ThinkingDropped`

              Always `thinking_dropped` for this entry type.

              default: thinking_dropped

            - `Path string`

              Where the removed block was in your request, as `messages.{i}.content.{j}`:
              `i` indexes the `messages` array you sent and `j` that message's `content`
              array — the same form error messages use.

            - `Reason BetaThinkingDroppedInputTransformationReason`

              Which binding check removed the block: `model_binding_mismatch` — it was
              created by a model whose reasoning the requested model may not read;
              `prefix_binding_mismatch` — the conversation before it differs from the
              conversation it was created in (the rest of that turn's consecutive thinking
              blocks are removed with it, each with this reason);
              `organization_binding_mismatch` — it was created under a different
              organization (an Anthropic organization, AWS account or Google Cloud project)
              and this organization is not one of its additional organizations;
              `end_user_binding_mismatch` — it was created for a different end user, or
              was removed by the consumer-organization binding. A block that would fail
              several checks reports one reason, in this order of precedence:
              `organization_binding_mismatch`, `end_user_binding_mismatch`,
              `model_binding_mismatch`, `prefix_binding_mismatch`.

              - `const BetaThinkingDroppedInputTransformationReasonModelBindingMismatch BetaThinkingDroppedInputTransformationReason = "model_binding_mismatch"`

              - `const BetaThinkingDroppedInputTransformationReasonPrefixBindingMismatch BetaThinkingDroppedInputTransformationReason = "prefix_binding_mismatch"`

              - `const BetaThinkingDroppedInputTransformationReasonOrganizationBindingMismatch BetaThinkingDroppedInputTransformationReason = "organization_binding_mismatch"`

              - `const BetaThinkingDroppedInputTransformationReasonEndUserBindingMismatch BetaThinkingDroppedInputTransformationReason = "end_user_binding_mismatch"`

          - `type BetaThinkingMismatchAllowedInputTransformation`

            - `Type ThinkingMismatchAllowed`

              Always `thinking_mismatch_allowed` for this entry type.

              default: thinking_mismatch_allowed

            - `Path string`

              Where the block is in your request, as `messages.{i}.content.{j}`:
              `i` indexes the `messages` array you sent and `j` that message's `content`
              array — the same form error messages use.

            - `Reason BetaThinkingMismatchAllowedInputTransformationReason`

              Which binding check the block failed; the block was shown to the model all
              the same. Always `prefix_binding_mismatch` today — the conversation before
              the block differs from the conversation it was created in, or the block
              carries no record of one on a model that requires it. Were the check
              enforced for this request, the block would have been removed or the request
              rejected (`thinking.block_binding.prefix_mismatch_behavior`). A removal also
              takes the rest of that turn's consecutive thinking blocks, whereas here each
              block is checked on its own, so `thinking_mismatch_allowed` entries are a
              lower bound on what enforcement would remove.

              - `const BetaThinkingMismatchAllowedInputTransformationReasonModelBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "model_binding_mismatch"`

              - `const BetaThinkingMismatchAllowedInputTransformationReasonPrefixBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "prefix_binding_mismatch"`

              - `const BetaThinkingMismatchAllowedInputTransformationReasonOrganizationBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "organization_binding_mismatch"`

              - `const BetaThinkingMismatchAllowedInputTransformationReasonEndUserBindingMismatch BetaThinkingMismatchAllowedInputTransformationReason = "end_user_binding_mismatch"`

    - `type BetaMessageBatchErroredResult`

      - `Type Errored`

        default: errored

      - `Error BetaErrorResponse`

        - `Type Error`

          default: error

        - `Error BetaErrorUnion`

          - `type BetaInvalidRequestError`

            - `Type InvalidRequestError`

              default: invalid_request_error

            - `Message string`

              default: Invalid request

          - `type BetaAuthenticationError`

            - `Type AuthenticationError`

              default: authentication_error

            - `Message string`

              default: Authentication error

          - `type BetaBillingError`

            - `Type BillingError`

              default: billing_error

            - `Message string`

              default: Billing error

          - `type BetaPermissionError`

            - `Type PermissionError`

              default: permission_error

            - `Message string`

              default: Permission denied

          - `type BetaNotFoundError`

            - `Type NotFoundError`

              default: not_found_error

            - `Message string`

              default: Not found

          - `type BetaRateLimitError`

            - `Type RateLimitError`

              default: rate_limit_error

            - `Message string`

              default: Rate limited

          - `type BetaGatewayTimeoutError`

            - `Type TimeoutError`

              default: timeout_error

            - `Message string`

              default: Request timeout

          - `type BetaAPIError`

            - `Type APIError`

              default: api_error

            - `Message string`

              default: Internal server error

          - `type BetaOverloadedError`

            - `Type OverloadedError`

              default: overloaded_error

            - `Message string`

              default: Overloaded

        - `RequestID string`

    - `type BetaMessageBatchCanceledResult`

      - `Type Canceled`

        default: canceled

    - `type BetaMessageBatchExpiredResult`

      - `Type Expired`

        default: expired

#### 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"),
	)
	stream := client.Beta.Messages.Batches.ResultsStreaming(
		context.TODO(),
		"message_batch_id",
		anthropic.BetaMessageBatchResultsParams{},
	)
	for stream.Next() {
		fmt.Printf("%+v\n", stream.Current())
	}
	err := stream.Err()
	if err != nil {
		panic(err.Error())
	}
}
```

## Beta › Agents

### Create Agent

`client.Beta.Agents.New(ctx, params) (*BetaManagedAgentsAgent, error)`

**POST** `/v1/agents`

Create Agent

#### Parameters

- `params BetaAgentNewParams`

  - `Model BetaManagedAgentsModelConfigParams`

    Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview?sdk_languages=go#latest-models-comparison), e.g. `claude-opus-5-5`, or a `model_config` object for additional configuration control

    - `type BetaManagedAgentsModelConfigParams`

      An object that defines additional configuration control over model use

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigParamsEffortUnion Optional`

        How hard Claude works on each inference call. Accepts a bare level string (`"high"`) or `{"type": "high"}`. On create, omitting it resolves the per-model default; on update, omitting it leaves the stored value unchanged.

        - `type BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel string`

          How hard Claude works on each turn. Higher levels favor reasoning depth over latency. Not all models accept every level; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelLow BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "low"`

            Low effort. Favors latency over reasoning depth.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMedium BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "medium"`

            Medium effort. Balances latency and reasoning depth.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelHigh BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "high"`

            High effort. Favors reasoning depth.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelXhigh BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "xhigh"`

            Extra-high effort. Not all models accept this level.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMax BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "max"`

            Maximum effort. Favors reasoning depth over latency.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. On update, `model` is whole-object replacement — omitting inference_geo clears it.

      - `Speed BetaManagedAgentsModelConfigParamsSpeed Optional`

        Inference speed mode. Defaults to `standard`.

        - `const BetaManagedAgentsModelConfigParamsSpeedStandard BetaManagedAgentsModelConfigParamsSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigParamsSpeedFast BetaManagedAgentsModelConfigParamsSpeed = "fast"`

  - `Name string`

    Human-readable name for the agent.

    minLength: 1, maxLength: 256

  - `Description param.Opt[string] Optional`

    Description of what the agent does.

    maxLength: 2048

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityParamsUnion Optional`

    Execution principal for runs of this agent. Omitting it, sending null, or sending `{"type": "service_account"}` stores the default.

  - `MCPServers []BetaManagedAgentsURLMCPServerParams Optional`

    MCP servers this agent connects to. Maximum 20. Names must be unique within the array. Every server must be referenced by an `mcp_toolset` in `tools`; unreferenced servers are rejected. See the [MCP connector guide](https://platform.claude.com/docs/en/managed-agents/mcp-connector?sdk_languages=go).

    - `Type BetaManagedAgentsURLMCPServerParamsType`

    - `Name string`

      Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.

      minLength: 1, maxLength: 255

    - `URL string`

      Endpoint URL for the MCP server.

      maxLength: 2048

  - `Metadata map[string, string] Optional`

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `Multiagent BetaManagedAgentsMultiagentParamsUnion Optional`

    Multiagent orchestration configuration.

  - `Skills []BetaManagedAgentsSkillParamsUnion Optional`

    Skills available to the agent.

    - `type BetaManagedAgentsAnthropicSkillParams`

      An Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillParamsType`

      - `SkillID string`

        Identifier of the Anthropic skill (e.g., "xlsx").

        minLength: 1, maxLength: 64

      - `Version string Optional`

        Version to pin. Defaults to latest if omitted.

        minLength: 1, maxLength: 64

    - `type BetaManagedAgentsCustomSkillParams`

      A user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillParamsType`

      - `SkillID string`

        Tagged ID of the custom skill (e.g., "skill_01XJ5...").

        minLength: 1, maxLength: 64

      - `Version string Optional`

        Version to pin. Defaults to latest if omitted.

        minLength: 1, maxLength: 64

  - `System param.Opt[string] Optional`

    System prompt for the agent.

    maxLength: 100000

  - `Tools []BetaAgentNewParamsToolUnion Optional`

    Tool configurations available to the agent. Maximum of 256 tools across all toolsets allowed.

    - `type BetaManagedAgentsAgentToolset20260401Params`

      Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.

      - `Type BetaManagedAgentsAgentToolset20260401ParamsType`

      - `Configs []BetaManagedAgentsAgentToolConfigParamsUnion Optional`

        Per-tool configuration overrides.

        - `type BetaManagedAgentsBashToolConfigParams`

          Configuration override for the bash tool.

          - `Type BetaManagedAgentsBashToolConfigParamsType Optional`

          - `Name Bash`

            Must be "bash".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsBashToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfigParams`

          Configuration override for the edit tool.

          - `Type BetaManagedAgentsEditToolConfigParamsType Optional`

          - `Name Edit`

            Must be "edit".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsEditToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfigParams`

          Configuration override for the read tool.

          - `Type BetaManagedAgentsReadToolConfigParamsType Optional`

          - `Name Read`

            Must be "read".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsReadToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfigParams`

          Configuration override for the write tool.

          - `Type BetaManagedAgentsWriteToolConfigParamsType Optional`

          - `Name Write`

            Must be "write".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfigParams`

          Configuration override for the glob tool.

          - `Type BetaManagedAgentsGlobToolConfigParamsType Optional`

          - `Name Glob`

            Must be "glob".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfigParams`

          Configuration override for the grep tool.

          - `Type BetaManagedAgentsGrepToolConfigParamsType Optional`

          - `Name Grep`

            Must be "grep".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfigParams`

          Configuration override for the web_fetch tool.

          - `Type BetaManagedAgentsWebFetchToolConfigParamsType Optional`

          - `Name WebFetch`

            Must be "web_fetch".

          - `AllowedDomains []string Optional`

            Only fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.

          - `BlockedDomains []string Optional`

            Never fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `MaxContentTokens int64 Optional`

            Maximum number of tokens of fetched text content to include in context per call. Does not apply to binary content such as PDFs.

            format: int32

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSourcesParams Optional`

            Which sources contribute URLs the tool may fetch. Omit to allow every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion Optional`

              Which custom tools' results contribute URLs that may be fetched: "all" (the default), "none", or an only or except list. Each name in a list must be a custom tool in the same tools array.

              - `type BetaManagedAgentsWebFetchURLSourceShorthand string`

                String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

                - `const BetaManagedAgentsWebFetchURLSourceShorthandAll BetaManagedAgentsWebFetchURLSourceShorthand = "all"`

                - `const BetaManagedAgentsWebFetchURLSourceShorthandNone BetaManagedAgentsWebFetchURLSourceShorthand = "none"`

              - `type BetaManagedAgentsWebFetchURLSourceToolFilterUnion interface{…}`

                Which tools' results contribute URLs that may be fetched.

                - `type BetaManagedAgentsWebFetchURLSourceAll`

                  Every URL from this source may be fetched. This is the default.

                  - `Type All`

                - `type BetaManagedAgentsWebFetchURLSourceNone`

                  This source contributes no URLs that may be fetched.

                  - `Type None`

                - `type BetaManagedAgentsWebFetchURLSourceOnly`

                  Only the named tools' results contribute URLs that may be fetched.

                  - `Type Only`

                  - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                    The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                    - `Type ToolReference`

                      Must be "tool_reference".

                    - `Name string`

                      Name of the tool. Compared exactly, so upper and lower case letters are different.

                      minLength: 1, maxLength: 128

                - `type BetaManagedAgentsWebFetchURLSourceExcept`

                  Every tool's results contribute URLs that may be fetched, except the named tools' results.

                  - `Type Except`

                  - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                    The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                    - `Type ToolReference`

                      Must be "tool_reference".

                    - `Name string`

                      Name of the tool. Compared exactly, so upper and lower case letters are different.

                      minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion Optional`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched: "all" (the default), "none", or an only or except list. Each name in a list must be "web_search" or "web_fetch".

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputParamsUnion Optional`

              Whether URLs in the text of user messages may be fetched: "all" (the default) or "none".

              - `type BetaManagedAgentsWebFetchURLSourceShorthand string`

                String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

              - `type BetaManagedAgentsWebFetchURLSourceUserInputUnion interface{…}`

                Whether URLs in the text of user messages may be fetched.

                - `type BetaManagedAgentsWebFetchURLSourceAll`

                  Every URL from this source may be fetched. This is the default.

                - `type BetaManagedAgentsWebFetchURLSourceNone`

                  This source contributes no URLs that may be fetched.

        - `type BetaManagedAgentsWebSearchToolConfigParams`

          Configuration override for the web_search tool.

          - `Type BetaManagedAgentsWebSearchToolConfigParamsType Optional`

          - `Name WebSearch`

            Must be "web_search".

          - `AllowedDomains []string Optional`

            Only return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.

          - `BlockedDomains []string Optional`

            Never return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `UserLocation BetaManagedAgentsUserLocationParam Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfigParams Optional`

        Default configuration applied to all tools in this set.

        - `Enabled bool Optional`

          Whether tools are enabled and available to Claude by default. Defaults to true if not specified.

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion Optional`

          Default permission policy for tools. Controls whether tool calls are auto-approved or require confirmation.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolsetParams`

      Configuration for tools from an MCP server defined in `mcp_servers`.

      - `Type BetaManagedAgentsMCPToolsetParamsType`

      - `MCPServerName string`

        Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.

        minLength: 1, maxLength: 255

      - `Configs []BetaManagedAgentsMCPToolConfigParams Optional`

        Per-tool configuration overrides.

        - `Name string`

          Name of the MCP tool to configure. 1-128 characters.

          minLength: 1, maxLength: 128

        - `Enabled bool Optional`

          Whether this tool is enabled. Overrides the `default_config` setting.

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion Optional`

          Permission policy for this tool. Overrides the `default_config` setting.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfigParams Optional`

        Default configuration for all tools from this server.

        - `Enabled bool Optional`

          Whether tools are enabled by default. Defaults to true if not specified.

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion Optional`

          Default permission policy for tools from this server.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsCustomToolParams`

      A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.

      - `Type BetaManagedAgentsCustomToolParamsType`

      - `Description string`

        Description of what the tool does, shown to the agent to help it decide when to use the tool.

        minLength: 1

      - `InputSchema BetaManagedAgentsCustomToolInputSchemaParam`

        JSON Schema defining the expected input parameters for the tool.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

        Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.

        minLength: 1, maxLength: 128

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsAgent`

  A Managed Agents `agent`.

  - `Type BetaManagedAgentsAgentType`

  - `ID string`

  - `ArchivedAt Time`

    When the agent was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Description string`

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

    Execution principal for runs of this agent. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

    - `type BetaManagedAgentsAWSRoleExecutionIdentity`

      An AWS IAM role principal as returned in API responses.

      - `Type AWSRole`

      - `RoleARN string`

        The IAM role's ARN.

    - `type BetaManagedAgentsServiceAccountExecutionIdentity`

      The Anthropic-managed service account as returned in API responses.

      - `Type ServiceAccount`

  - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

    - `Type BetaManagedAgentsMCPServerURLDefinitionType`

    - `Name string`

    - `URL string`

  - `Metadata map[string, string]`

  - `Model BetaManagedAgentsModelConfig`

    Model identifier and configuration.

    - `ID BetaManagedAgentsModel`

      The model that will power your agent.

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

      - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

        Fastest model for high-volume, real-time tasks

      - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

      - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

      - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

      - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

        Best combination of speed and intelligence

      - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

      - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

      - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

    - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

      How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

      - `type BetaManagedAgentsEffortLow`

        Low effort. Favors latency over reasoning depth.

        - `Type BetaManagedAgentsEffortLowType`

      - `type BetaManagedAgentsEffortMedium`

        Medium effort. Balances latency and reasoning depth.

        - `Type BetaManagedAgentsEffortMediumType`

      - `type BetaManagedAgentsEffortHigh`

        High effort. Favors reasoning depth.

        - `Type BetaManagedAgentsEffortHighType`

      - `type BetaManagedAgentsEffortXhigh`

        Extra-high effort. Not all models accept this level.

        - `Type BetaManagedAgentsEffortXhighType`

      - `type BetaManagedAgentsEffortMax`

        Maximum effort. Favors reasoning depth over latency.

        - `Type BetaManagedAgentsEffortMaxType`

    - `InferenceGeo string Optional`

      Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

    - `Speed BetaManagedAgentsModelConfigSpeed Optional`

      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

      - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

      - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentUnion`

    Multiagent orchestration configuration. Null when the agent is single-threaded.

    - `type BetaManagedAgentsMultiagentCoordinator`

      Resolved coordinator topology with a concrete agent roster.

      - `Type BetaManagedAgentsMultiagentCoordinatorType`

      - `Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion`

        Agents the coordinator may spawn as session threads, each resolved to a specific version.

        - `type BetaManagedAgentsAgentReference`

          A resolved agent reference with a concrete version.

          - `Type BetaManagedAgentsAgentReferenceType`

          - `ID string`

          - `Version int64`

            format: int32

        - `type BetaManagedAgentsAdvisor`

          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

          - `Type BetaManagedAgentsAdvisorType`

          - `Model string`

            The advisor model id.

    - `type BetaManagedAgentsMultiagent20261001`

      Resolved multiagent configuration with three members, each enabled or disabled on its own.

      - `Type Multiagent20261001`

      - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

        Whether the session's primary thread can consult an advisor model.

        - `type BetaManagedAgentsMultiagentAdvisorEnabled`

          The session's primary thread can consult `model` mid-turn.

          - `Type Enabled`

          - `Model string`

            The advisor model id.

        - `type BetaManagedAgentsMultiagentAdvisorDisabled`

          The agent has no advisor.

          - `Type Disabled`

      - `Subagents BetaManagedAgentsMultiagentSubagentsUnion`

        Whether the agent can spawn session threads.

        - `type BetaManagedAgentsMultiagentSubagentsEnabled`

          The agent can spawn session threads.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether the agent can define inline agents, which are not saved, when it spawns session threads.

            - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

              The agent can define inline agents.

              - `Type Enabled`

            - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

              The agent cannot define inline agents.

              - `Type Disabled`

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentSubagentsDisabled`

          The agent cannot spawn session threads.

          - `Type Disabled`

      - `Workflows BetaManagedAgentsMultiagentWorkflowsUnion`

        Whether the agent can start workflow runs.

        - `type BetaManagedAgentsMultiagentWorkflowsEnabled`

          The agent can start workflow runs.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether a run's plan can define inline agents, which are not saved.

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

          The agent cannot start workflow runs.

          - `Type Disabled`

  - `Name string`

  - `Skills []BetaManagedAgentsAgentSkillUnion`

    - `type BetaManagedAgentsAnthropicSkill`

      A resolved Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillType`

      - `SkillID string`

      - `Version string`

    - `type BetaManagedAgentsCustomSkill`

      A resolved user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillType`

      - `SkillID string`

      - `Version string`

  - `System string`

  - `Tools []BetaManagedAgentsAgentToolUnion`

    - `type BetaManagedAgentsAgentToolset20260401`

      - `Type BetaManagedAgentsAgentToolset20260401Type`

      - `Configs []BetaManagedAgentsAgentToolConfigUnion`

        - `type BetaManagedAgentsBashToolConfig`

          Configuration for the bash tool.

          - `Type Bash`

          - `Enabled bool`

          - `Name Bash`

          - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfig`

          Configuration for the edit tool.

          - `Type Edit`

          - `Enabled bool`

          - `Name Edit`

          - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfig`

          Configuration for the read tool.

          - `Type Read`

          - `Enabled bool`

          - `Name Read`

          - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfig`

          Configuration for the write tool.

          - `Type Write`

          - `Enabled bool`

          - `Name Write`

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfig`

          Configuration for the glob tool.

          - `Type Glob`

          - `Enabled bool`

          - `Name Glob`

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfig`

          Configuration for the grep tool.

          - `Type Grep`

          - `Enabled bool`

          - `Name Grep`

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfig`

          Configuration for the web_fetch tool.

          - `Type WebFetch`

          - `Enabled bool`

          - `Name WebFetch`

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSources`

            Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

                - `Type All`

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

                - `Type None`

              - `type BetaManagedAgentsWebFetchURLSourceOnly`

                Only the named tools' results contribute URLs that may be fetched.

                - `Type Only`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

              - `type BetaManagedAgentsWebFetchURLSourceExcept`

                Every tool's results contribute URLs that may be fetched, except the named tools' results.

                - `Type Except`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

              Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `MaxContentTokens int64 Optional`

            format: int32

        - `type BetaManagedAgentsWebSearchToolConfig`

          Configuration for the web_search tool.

          - `Type WebSearch`

          - `Enabled bool`

          - `Name WebSearch`

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `UserLocation BetaManagedAgentsUserLocation Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

        Resolved default configuration for agent tools.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolset`

      - `Type BetaManagedAgentsMCPToolsetType`

      - `Configs []BetaManagedAgentsMCPToolConfig`

        - `Enabled bool`

        - `Name string`

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

        Resolved default configuration for all tools from an MCP server.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `MCPServerName string`

    - `type BetaManagedAgentsCustomTool`

      A custom tool as returned in API responses.

      - `Type BetaManagedAgentsCustomToolType`

      - `Description string`

      - `InputSchema BetaManagedAgentsCustomToolInputSchema`

        JSON Schema for custom tool input parameters.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Version int64`

    The agent's current version. Starts at 1 and increments when the agent is modified.

    format: int32

#### 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"),
	)
	betaManagedAgentsAgent, err := client.Beta.Agents.New(context.TODO(), anthropic.BetaAgentNewParams{
		Model: anthropic.BetaManagedAgentsModelConfigParams{
			ID: anthropic.BetaManagedAgentsModelClaudeOpus5_5,
		},
		Name: "My First Agent",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsAgent.ID)
}
```

##### Response (200)

```json
{
  "id": "agent_011CZkYpogX7uDKUyvBTophP",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "A general-purpose starter agent.",
  "execution_identity": {
    "type": "service_account"
  },
  "mcp_servers": [
    {
      "name": "example-mcp",
      "type": "url",
      "url": "https://example-server.modelcontextprotocol.io/sse"
    }
  ],
  "metadata": {
    "foo": "bar"
  },
  "model": {
    "id": "claude-opus-5-5",
    "effort": {
      "type": "low"
    },
    "inference_geo": "inference_geo",
    "speed": "standard"
  },
  "multiagent": {
    "advisor": {
      "type": "disabled"
    },
    "subagents": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    },
    "type": "multiagent_20261001",
    "workflows": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    }
  },
  "name": "My First Agent",
  "skills": [
    {
      "skill_id": "xlsx",
      "type": "anthropic",
      "version": "1"
    },
    {
      "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
      "type": "custom",
      "version": "2"
    }
  ],
  "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
  "tools": [
    {
      "configs": [
        {
          "enabled": true,
          "name": "bash",
          "permission_policy": {
            "type": "always_allow"
          },
          "type": "bash"
        }
      ],
      "default_config": {
        "enabled": true,
        "permission_policy": {
          "type": "always_ask"
        }
      },
      "type": "agent_toolset_20260401"
    }
  ],
  "type": "agent",
  "updated_at": "2026-03-15T10:00:00Z",
  "version": 1
}
```

### List Agents

`client.Beta.Agents.List(ctx, params) (*PageCursor[BetaManagedAgentsAgent], error)`

**GET** `/v1/agents`

List Agents

#### Parameters

- `params BetaAgentListParams`

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return agents created at or after this time (inclusive).

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return agents created at or before this time (inclusive).

    format: date-time

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Include archived agents in results. Defaults to false.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum results per page. Default 20, maximum 100.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor from a previous response.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsAgent`

  A Managed Agents `agent`.

  - `Type BetaManagedAgentsAgentType`

  - `ID string`

  - `ArchivedAt Time`

    When the agent was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Description string`

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

    Execution principal for runs of this agent. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

    - `type BetaManagedAgentsAWSRoleExecutionIdentity`

      An AWS IAM role principal as returned in API responses.

      - `Type AWSRole`

      - `RoleARN string`

        The IAM role's ARN.

    - `type BetaManagedAgentsServiceAccountExecutionIdentity`

      The Anthropic-managed service account as returned in API responses.

      - `Type ServiceAccount`

  - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

    - `Type BetaManagedAgentsMCPServerURLDefinitionType`

    - `Name string`

    - `URL string`

  - `Metadata map[string, string]`

  - `Model BetaManagedAgentsModelConfig`

    Model identifier and configuration.

    - `ID BetaManagedAgentsModel`

      The model that will power your agent.

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

      - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

        Fastest model for high-volume, real-time tasks

      - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

      - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

      - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

      - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

        Best combination of speed and intelligence

      - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

      - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

      - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

    - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

      How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

      - `type BetaManagedAgentsEffortLow`

        Low effort. Favors latency over reasoning depth.

        - `Type BetaManagedAgentsEffortLowType`

      - `type BetaManagedAgentsEffortMedium`

        Medium effort. Balances latency and reasoning depth.

        - `Type BetaManagedAgentsEffortMediumType`

      - `type BetaManagedAgentsEffortHigh`

        High effort. Favors reasoning depth.

        - `Type BetaManagedAgentsEffortHighType`

      - `type BetaManagedAgentsEffortXhigh`

        Extra-high effort. Not all models accept this level.

        - `Type BetaManagedAgentsEffortXhighType`

      - `type BetaManagedAgentsEffortMax`

        Maximum effort. Favors reasoning depth over latency.

        - `Type BetaManagedAgentsEffortMaxType`

    - `InferenceGeo string Optional`

      Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

    - `Speed BetaManagedAgentsModelConfigSpeed Optional`

      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

      - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

      - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentUnion`

    Multiagent orchestration configuration. Null when the agent is single-threaded.

    - `type BetaManagedAgentsMultiagentCoordinator`

      Resolved coordinator topology with a concrete agent roster.

      - `Type BetaManagedAgentsMultiagentCoordinatorType`

      - `Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion`

        Agents the coordinator may spawn as session threads, each resolved to a specific version.

        - `type BetaManagedAgentsAgentReference`

          A resolved agent reference with a concrete version.

          - `Type BetaManagedAgentsAgentReferenceType`

          - `ID string`

          - `Version int64`

            format: int32

        - `type BetaManagedAgentsAdvisor`

          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

          - `Type BetaManagedAgentsAdvisorType`

          - `Model string`

            The advisor model id.

    - `type BetaManagedAgentsMultiagent20261001`

      Resolved multiagent configuration with three members, each enabled or disabled on its own.

      - `Type Multiagent20261001`

      - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

        Whether the session's primary thread can consult an advisor model.

        - `type BetaManagedAgentsMultiagentAdvisorEnabled`

          The session's primary thread can consult `model` mid-turn.

          - `Type Enabled`

          - `Model string`

            The advisor model id.

        - `type BetaManagedAgentsMultiagentAdvisorDisabled`

          The agent has no advisor.

          - `Type Disabled`

      - `Subagents BetaManagedAgentsMultiagentSubagentsUnion`

        Whether the agent can spawn session threads.

        - `type BetaManagedAgentsMultiagentSubagentsEnabled`

          The agent can spawn session threads.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether the agent can define inline agents, which are not saved, when it spawns session threads.

            - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

              The agent can define inline agents.

              - `Type Enabled`

            - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

              The agent cannot define inline agents.

              - `Type Disabled`

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentSubagentsDisabled`

          The agent cannot spawn session threads.

          - `Type Disabled`

      - `Workflows BetaManagedAgentsMultiagentWorkflowsUnion`

        Whether the agent can start workflow runs.

        - `type BetaManagedAgentsMultiagentWorkflowsEnabled`

          The agent can start workflow runs.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether a run's plan can define inline agents, which are not saved.

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

          The agent cannot start workflow runs.

          - `Type Disabled`

  - `Name string`

  - `Skills []BetaManagedAgentsAgentSkillUnion`

    - `type BetaManagedAgentsAnthropicSkill`

      A resolved Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillType`

      - `SkillID string`

      - `Version string`

    - `type BetaManagedAgentsCustomSkill`

      A resolved user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillType`

      - `SkillID string`

      - `Version string`

  - `System string`

  - `Tools []BetaManagedAgentsAgentToolUnion`

    - `type BetaManagedAgentsAgentToolset20260401`

      - `Type BetaManagedAgentsAgentToolset20260401Type`

      - `Configs []BetaManagedAgentsAgentToolConfigUnion`

        - `type BetaManagedAgentsBashToolConfig`

          Configuration for the bash tool.

          - `Type Bash`

          - `Enabled bool`

          - `Name Bash`

          - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfig`

          Configuration for the edit tool.

          - `Type Edit`

          - `Enabled bool`

          - `Name Edit`

          - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfig`

          Configuration for the read tool.

          - `Type Read`

          - `Enabled bool`

          - `Name Read`

          - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfig`

          Configuration for the write tool.

          - `Type Write`

          - `Enabled bool`

          - `Name Write`

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfig`

          Configuration for the glob tool.

          - `Type Glob`

          - `Enabled bool`

          - `Name Glob`

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfig`

          Configuration for the grep tool.

          - `Type Grep`

          - `Enabled bool`

          - `Name Grep`

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfig`

          Configuration for the web_fetch tool.

          - `Type WebFetch`

          - `Enabled bool`

          - `Name WebFetch`

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSources`

            Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

                - `Type All`

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

                - `Type None`

              - `type BetaManagedAgentsWebFetchURLSourceOnly`

                Only the named tools' results contribute URLs that may be fetched.

                - `Type Only`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

              - `type BetaManagedAgentsWebFetchURLSourceExcept`

                Every tool's results contribute URLs that may be fetched, except the named tools' results.

                - `Type Except`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

              Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `MaxContentTokens int64 Optional`

            format: int32

        - `type BetaManagedAgentsWebSearchToolConfig`

          Configuration for the web_search tool.

          - `Type WebSearch`

          - `Enabled bool`

          - `Name WebSearch`

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `UserLocation BetaManagedAgentsUserLocation Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

        Resolved default configuration for agent tools.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolset`

      - `Type BetaManagedAgentsMCPToolsetType`

      - `Configs []BetaManagedAgentsMCPToolConfig`

        - `Enabled bool`

        - `Name string`

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

        Resolved default configuration for all tools from an MCP server.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `MCPServerName string`

    - `type BetaManagedAgentsCustomTool`

      A custom tool as returned in API responses.

      - `Type BetaManagedAgentsCustomToolType`

      - `Description string`

      - `InputSchema BetaManagedAgentsCustomToolInputSchema`

        JSON Schema for custom tool input parameters.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Version int64`

    The agent's current version. Starts at 1 and increments when the agent is modified.

    format: int32

#### 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"),
	)
	page, err := client.Beta.Agents.List(context.TODO(), anthropic.BetaAgentListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "agent_011CZkYpogX7uDKUyvBTophP",
      "archived_at": null,
      "created_at": "2026-03-15T10:00:00Z",
      "description": "A general-purpose starter agent.",
      "execution_identity": {
        "type": "service_account"
      },
      "mcp_servers": [
        {
          "name": "example-mcp",
          "type": "url",
          "url": "https://example-server.modelcontextprotocol.io/sse"
        }
      ],
      "metadata": {
        "foo": "bar"
      },
      "model": {
        "id": "claude-opus-5-5",
        "effort": {
          "type": "low"
        },
        "inference_geo": "inference_geo",
        "speed": "standard"
      },
      "multiagent": {
        "advisor": {
          "type": "disabled"
        },
        "subagents": {
          "inline_agents": {
            "type": "enabled"
          },
          "predefined_agents": [
            {
              "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
              "type": "agent",
              "version": 1
            }
          ],
          "type": "enabled"
        },
        "type": "multiagent_20261001",
        "workflows": {
          "inline_agents": {
            "type": "enabled"
          },
          "predefined_agents": [
            {
              "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
              "type": "agent",
              "version": 1
            }
          ],
          "type": "enabled"
        }
      },
      "name": "My First Agent",
      "skills": [
        {
          "skill_id": "xlsx",
          "type": "anthropic",
          "version": "1"
        },
        {
          "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
          "type": "custom",
          "version": "2"
        }
      ],
      "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
      "tools": [
        {
          "configs": [
            {
              "enabled": true,
              "name": "bash",
              "permission_policy": {
                "type": "always_allow"
              },
              "type": "bash"
            }
          ],
          "default_config": {
            "enabled": true,
            "permission_policy": {
              "type": "always_ask"
            }
          },
          "type": "agent_toolset_20260401"
        }
      ],
      "type": "agent",
      "updated_at": "2026-03-15T10:00:00Z",
      "version": 1
    }
  ],
  "next_page": "next_page"
}
```

### Get Agent

`client.Beta.Agents.Get(ctx, agentID, params) (*BetaManagedAgentsAgent, error)`

**GET** `/v1/agents/{agent_id}`

Get Agent

#### Parameters

- `agentID string` (path parameter)

  Unique identifier of the agent to retrieve.

- `params BetaAgentGetParams`

  - `Version param.Opt[int64] Optional` (query parameter)

    Agent version. Omit for the most recent version. Must be at least 1 if specified.

    format: int32

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsAgent`

  A Managed Agents `agent`.

  - `Type BetaManagedAgentsAgentType`

  - `ID string`

  - `ArchivedAt Time`

    When the agent was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Description string`

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

    Execution principal for runs of this agent. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

    - `type BetaManagedAgentsAWSRoleExecutionIdentity`

      An AWS IAM role principal as returned in API responses.

      - `Type AWSRole`

      - `RoleARN string`

        The IAM role's ARN.

    - `type BetaManagedAgentsServiceAccountExecutionIdentity`

      The Anthropic-managed service account as returned in API responses.

      - `Type ServiceAccount`

  - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

    - `Type BetaManagedAgentsMCPServerURLDefinitionType`

    - `Name string`

    - `URL string`

  - `Metadata map[string, string]`

  - `Model BetaManagedAgentsModelConfig`

    Model identifier and configuration.

    - `ID BetaManagedAgentsModel`

      The model that will power your agent.

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

      - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

        Fastest model for high-volume, real-time tasks

      - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

      - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

      - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

      - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

        Best combination of speed and intelligence

      - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

      - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

      - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

    - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

      How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

      - `type BetaManagedAgentsEffortLow`

        Low effort. Favors latency over reasoning depth.

        - `Type BetaManagedAgentsEffortLowType`

      - `type BetaManagedAgentsEffortMedium`

        Medium effort. Balances latency and reasoning depth.

        - `Type BetaManagedAgentsEffortMediumType`

      - `type BetaManagedAgentsEffortHigh`

        High effort. Favors reasoning depth.

        - `Type BetaManagedAgentsEffortHighType`

      - `type BetaManagedAgentsEffortXhigh`

        Extra-high effort. Not all models accept this level.

        - `Type BetaManagedAgentsEffortXhighType`

      - `type BetaManagedAgentsEffortMax`

        Maximum effort. Favors reasoning depth over latency.

        - `Type BetaManagedAgentsEffortMaxType`

    - `InferenceGeo string Optional`

      Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

    - `Speed BetaManagedAgentsModelConfigSpeed Optional`

      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

      - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

      - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentUnion`

    Multiagent orchestration configuration. Null when the agent is single-threaded.

    - `type BetaManagedAgentsMultiagentCoordinator`

      Resolved coordinator topology with a concrete agent roster.

      - `Type BetaManagedAgentsMultiagentCoordinatorType`

      - `Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion`

        Agents the coordinator may spawn as session threads, each resolved to a specific version.

        - `type BetaManagedAgentsAgentReference`

          A resolved agent reference with a concrete version.

          - `Type BetaManagedAgentsAgentReferenceType`

          - `ID string`

          - `Version int64`

            format: int32

        - `type BetaManagedAgentsAdvisor`

          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

          - `Type BetaManagedAgentsAdvisorType`

          - `Model string`

            The advisor model id.

    - `type BetaManagedAgentsMultiagent20261001`

      Resolved multiagent configuration with three members, each enabled or disabled on its own.

      - `Type Multiagent20261001`

      - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

        Whether the session's primary thread can consult an advisor model.

        - `type BetaManagedAgentsMultiagentAdvisorEnabled`

          The session's primary thread can consult `model` mid-turn.

          - `Type Enabled`

          - `Model string`

            The advisor model id.

        - `type BetaManagedAgentsMultiagentAdvisorDisabled`

          The agent has no advisor.

          - `Type Disabled`

      - `Subagents BetaManagedAgentsMultiagentSubagentsUnion`

        Whether the agent can spawn session threads.

        - `type BetaManagedAgentsMultiagentSubagentsEnabled`

          The agent can spawn session threads.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether the agent can define inline agents, which are not saved, when it spawns session threads.

            - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

              The agent can define inline agents.

              - `Type Enabled`

            - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

              The agent cannot define inline agents.

              - `Type Disabled`

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentSubagentsDisabled`

          The agent cannot spawn session threads.

          - `Type Disabled`

      - `Workflows BetaManagedAgentsMultiagentWorkflowsUnion`

        Whether the agent can start workflow runs.

        - `type BetaManagedAgentsMultiagentWorkflowsEnabled`

          The agent can start workflow runs.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether a run's plan can define inline agents, which are not saved.

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

          The agent cannot start workflow runs.

          - `Type Disabled`

  - `Name string`

  - `Skills []BetaManagedAgentsAgentSkillUnion`

    - `type BetaManagedAgentsAnthropicSkill`

      A resolved Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillType`

      - `SkillID string`

      - `Version string`

    - `type BetaManagedAgentsCustomSkill`

      A resolved user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillType`

      - `SkillID string`

      - `Version string`

  - `System string`

  - `Tools []BetaManagedAgentsAgentToolUnion`

    - `type BetaManagedAgentsAgentToolset20260401`

      - `Type BetaManagedAgentsAgentToolset20260401Type`

      - `Configs []BetaManagedAgentsAgentToolConfigUnion`

        - `type BetaManagedAgentsBashToolConfig`

          Configuration for the bash tool.

          - `Type Bash`

          - `Enabled bool`

          - `Name Bash`

          - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfig`

          Configuration for the edit tool.

          - `Type Edit`

          - `Enabled bool`

          - `Name Edit`

          - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfig`

          Configuration for the read tool.

          - `Type Read`

          - `Enabled bool`

          - `Name Read`

          - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfig`

          Configuration for the write tool.

          - `Type Write`

          - `Enabled bool`

          - `Name Write`

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfig`

          Configuration for the glob tool.

          - `Type Glob`

          - `Enabled bool`

          - `Name Glob`

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfig`

          Configuration for the grep tool.

          - `Type Grep`

          - `Enabled bool`

          - `Name Grep`

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfig`

          Configuration for the web_fetch tool.

          - `Type WebFetch`

          - `Enabled bool`

          - `Name WebFetch`

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSources`

            Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

                - `Type All`

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

                - `Type None`

              - `type BetaManagedAgentsWebFetchURLSourceOnly`

                Only the named tools' results contribute URLs that may be fetched.

                - `Type Only`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

              - `type BetaManagedAgentsWebFetchURLSourceExcept`

                Every tool's results contribute URLs that may be fetched, except the named tools' results.

                - `Type Except`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

              Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `MaxContentTokens int64 Optional`

            format: int32

        - `type BetaManagedAgentsWebSearchToolConfig`

          Configuration for the web_search tool.

          - `Type WebSearch`

          - `Enabled bool`

          - `Name WebSearch`

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `UserLocation BetaManagedAgentsUserLocation Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

        Resolved default configuration for agent tools.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolset`

      - `Type BetaManagedAgentsMCPToolsetType`

      - `Configs []BetaManagedAgentsMCPToolConfig`

        - `Enabled bool`

        - `Name string`

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

        Resolved default configuration for all tools from an MCP server.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `MCPServerName string`

    - `type BetaManagedAgentsCustomTool`

      A custom tool as returned in API responses.

      - `Type BetaManagedAgentsCustomToolType`

      - `Description string`

      - `InputSchema BetaManagedAgentsCustomToolInputSchema`

        JSON Schema for custom tool input parameters.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Version int64`

    The agent's current version. Starts at 1 and increments when the agent is modified.

    format: int32

#### 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"),
	)
	betaManagedAgentsAgent, err := client.Beta.Agents.Get(
		context.TODO(),
		"agent_011CZkYpogX7uDKUyvBTophP",
		anthropic.BetaAgentGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsAgent.ID)
}
```

##### Response (200)

```json
{
  "id": "agent_011CZkYpogX7uDKUyvBTophP",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "A general-purpose starter agent.",
  "execution_identity": {
    "type": "service_account"
  },
  "mcp_servers": [
    {
      "name": "example-mcp",
      "type": "url",
      "url": "https://example-server.modelcontextprotocol.io/sse"
    }
  ],
  "metadata": {
    "foo": "bar"
  },
  "model": {
    "id": "claude-opus-5-5",
    "effort": {
      "type": "low"
    },
    "inference_geo": "inference_geo",
    "speed": "standard"
  },
  "multiagent": {
    "advisor": {
      "type": "disabled"
    },
    "subagents": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    },
    "type": "multiagent_20261001",
    "workflows": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    }
  },
  "name": "My First Agent",
  "skills": [
    {
      "skill_id": "xlsx",
      "type": "anthropic",
      "version": "1"
    },
    {
      "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
      "type": "custom",
      "version": "2"
    }
  ],
  "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
  "tools": [
    {
      "configs": [
        {
          "enabled": true,
          "name": "bash",
          "permission_policy": {
            "type": "always_allow"
          },
          "type": "bash"
        }
      ],
      "default_config": {
        "enabled": true,
        "permission_policy": {
          "type": "always_ask"
        }
      },
      "type": "agent_toolset_20260401"
    }
  ],
  "type": "agent",
  "updated_at": "2026-03-15T10:00:00Z",
  "version": 1
}
```

### Update Agent

`client.Beta.Agents.Update(ctx, agentID, params) (*BetaManagedAgentsAgent, error)`

**POST** `/v1/agents/{agent_id}`

Update Agent

#### Parameters

- `agentID string` (path parameter)

  Unique identifier of the agent to update.

- `params BetaAgentUpdateParams`

  - `Description param.Opt[string] Optional`

    Description. Omit to preserve; send empty string or null to clear.

    maxLength: 2048

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityParamsUnion Optional`

    Execution principal for runs of this agent. Full replacement. Omit to preserve; send null or `{"type": "service_account"}` to restore the default.

  - `MCPServers []BetaManagedAgentsURLMCPServerParams Optional`

    MCP servers. Full replacement. Omit to preserve; send empty array or `null` to clear. Names must be unique. Maximum 20. Every server must be referenced by an `mcp_toolset` in the agent's resulting `tools`; unreferenced servers are rejected. See the [MCP connector guide](https://platform.claude.com/docs/en/managed-agents/mcp-connector?sdk_languages=go).

    - `Type BetaManagedAgentsURLMCPServerParamsType`

    - `Name string`

      Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.

      minLength: 1, maxLength: 255

    - `URL string`

      Endpoint URL for the MCP server.

      maxLength: 2048

  - `Metadata map[string, string] Optional`

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.

  - `Model BetaManagedAgentsModelConfigParams Optional`

    Model identifier. Accepts the [model string](https://platform.claude.com/docs/en/about-claude/models/overview?sdk_languages=go#latest-models-comparison), e.g. `claude-opus-5-5`, or a `model_config` object for additional configuration control. Omit to preserve. Cannot be cleared.

    - `type BetaManagedAgentsModelConfigParams`

      An object that defines additional configuration control over model use

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigParamsEffortUnion Optional`

        How hard Claude works on each inference call. Accepts a bare level string (`"high"`) or `{"type": "high"}`. On create, omitting it resolves the per-model default; on update, omitting it leaves the stored value unchanged.

        - `type BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel string`

          How hard Claude works on each turn. Higher levels favor reasoning depth over latency. Not all models accept every level; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelLow BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "low"`

            Low effort. Favors latency over reasoning depth.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMedium BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "medium"`

            Medium effort. Balances latency and reasoning depth.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelHigh BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "high"`

            High effort. Favors reasoning depth.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelXhigh BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "xhigh"`

            Extra-high effort. Not all models accept this level.

          - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMax BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "max"`

            Maximum effort. Favors reasoning depth over latency.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. On update, `model` is whole-object replacement — omitting inference_geo clears it.

      - `Speed BetaManagedAgentsModelConfigParamsSpeed Optional`

        Inference speed mode. Defaults to `standard`.

        - `const BetaManagedAgentsModelConfigParamsSpeedStandard BetaManagedAgentsModelConfigParamsSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigParamsSpeedFast BetaManagedAgentsModelConfigParamsSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentParamsUnion Optional`

    Multiagent orchestration configuration. Full replacement. Omit to preserve; send null to clear.

  - `Name param.Opt[string] Optional`

    Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.

    maxLength: 256

  - `Skills []BetaManagedAgentsSkillParamsUnion Optional`

    Skills. Full replacement. Omit to preserve; send empty array or null to clear.

    - `type BetaManagedAgentsAnthropicSkillParams`

      An Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillParamsType`

      - `SkillID string`

        Identifier of the Anthropic skill (e.g., "xlsx").

        minLength: 1, maxLength: 64

      - `Version string Optional`

        Version to pin. Defaults to latest if omitted.

        minLength: 1, maxLength: 64

    - `type BetaManagedAgentsCustomSkillParams`

      A user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillParamsType`

      - `SkillID string`

        Tagged ID of the custom skill (e.g., "skill_01XJ5...").

        minLength: 1, maxLength: 64

      - `Version string Optional`

        Version to pin. Defaults to latest if omitted.

        minLength: 1, maxLength: 64

  - `System param.Opt[string] Optional`

    System prompt. Omit to preserve; send empty string or null to clear.

    maxLength: 100000

  - `Tools []BetaAgentUpdateParamsToolUnion Optional`

    Tool configurations available to the agent. Full replacement. Omit to preserve; send empty array or null to clear. Maximum of 256 tools across all toolsets allowed.

    - `type BetaManagedAgentsAgentToolset20260401Params`

      Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.

      - `Type BetaManagedAgentsAgentToolset20260401ParamsType`

      - `Configs []BetaManagedAgentsAgentToolConfigParamsUnion Optional`

        Per-tool configuration overrides.

        - `type BetaManagedAgentsBashToolConfigParams`

          Configuration override for the bash tool.

          - `Type BetaManagedAgentsBashToolConfigParamsType Optional`

          - `Name Bash`

            Must be "bash".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsBashToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfigParams`

          Configuration override for the edit tool.

          - `Type BetaManagedAgentsEditToolConfigParamsType Optional`

          - `Name Edit`

            Must be "edit".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsEditToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfigParams`

          Configuration override for the read tool.

          - `Type BetaManagedAgentsReadToolConfigParamsType Optional`

          - `Name Read`

            Must be "read".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsReadToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfigParams`

          Configuration override for the write tool.

          - `Type BetaManagedAgentsWriteToolConfigParamsType Optional`

          - `Name Write`

            Must be "write".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfigParams`

          Configuration override for the glob tool.

          - `Type BetaManagedAgentsGlobToolConfigParamsType Optional`

          - `Name Glob`

            Must be "glob".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfigParams`

          Configuration override for the grep tool.

          - `Type BetaManagedAgentsGrepToolConfigParamsType Optional`

          - `Name Grep`

            Must be "grep".

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfigParams`

          Configuration override for the web_fetch tool.

          - `Type BetaManagedAgentsWebFetchToolConfigParamsType Optional`

          - `Name WebFetch`

            Must be "web_fetch".

          - `AllowedDomains []string Optional`

            Only fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.

          - `BlockedDomains []string Optional`

            Never fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `MaxContentTokens int64 Optional`

            Maximum number of tokens of fetched text content to include in context per call. Does not apply to binary content such as PDFs.

            format: int32

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSourcesParams Optional`

            Which sources contribute URLs the tool may fetch. Omit to allow every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion Optional`

              Which custom tools' results contribute URLs that may be fetched: "all" (the default), "none", or an only or except list. Each name in a list must be a custom tool in the same tools array.

              - `type BetaManagedAgentsWebFetchURLSourceShorthand string`

                String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

                - `const BetaManagedAgentsWebFetchURLSourceShorthandAll BetaManagedAgentsWebFetchURLSourceShorthand = "all"`

                - `const BetaManagedAgentsWebFetchURLSourceShorthandNone BetaManagedAgentsWebFetchURLSourceShorthand = "none"`

              - `type BetaManagedAgentsWebFetchURLSourceToolFilterUnion interface{…}`

                Which tools' results contribute URLs that may be fetched.

                - `type BetaManagedAgentsWebFetchURLSourceAll`

                  Every URL from this source may be fetched. This is the default.

                  - `Type All`

                - `type BetaManagedAgentsWebFetchURLSourceNone`

                  This source contributes no URLs that may be fetched.

                  - `Type None`

                - `type BetaManagedAgentsWebFetchURLSourceOnly`

                  Only the named tools' results contribute URLs that may be fetched.

                  - `Type Only`

                  - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                    The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                    - `Type ToolReference`

                      Must be "tool_reference".

                    - `Name string`

                      Name of the tool. Compared exactly, so upper and lower case letters are different.

                      minLength: 1, maxLength: 128

                - `type BetaManagedAgentsWebFetchURLSourceExcept`

                  Every tool's results contribute URLs that may be fetched, except the named tools' results.

                  - `Type Except`

                  - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                    The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                    - `Type ToolReference`

                      Must be "tool_reference".

                    - `Name string`

                      Name of the tool. Compared exactly, so upper and lower case letters are different.

                      minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion Optional`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched: "all" (the default), "none", or an only or except list. Each name in a list must be "web_search" or "web_fetch".

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputParamsUnion Optional`

              Whether URLs in the text of user messages may be fetched: "all" (the default) or "none".

              - `type BetaManagedAgentsWebFetchURLSourceShorthand string`

                String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

              - `type BetaManagedAgentsWebFetchURLSourceUserInputUnion interface{…}`

                Whether URLs in the text of user messages may be fetched.

                - `type BetaManagedAgentsWebFetchURLSourceAll`

                  Every URL from this source may be fetched. This is the default.

                - `type BetaManagedAgentsWebFetchURLSourceNone`

                  This source contributes no URLs that may be fetched.

        - `type BetaManagedAgentsWebSearchToolConfigParams`

          Configuration override for the web_search tool.

          - `Type BetaManagedAgentsWebSearchToolConfigParamsType Optional`

          - `Name WebSearch`

            Must be "web_search".

          - `AllowedDomains []string Optional`

            Only return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.

          - `BlockedDomains []string Optional`

            Never return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.

          - `Enabled bool Optional`

            Whether this tool is enabled and available to Claude. Overrides the default_config setting.

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigParamsPermissionPolicyUnion Optional`

            Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `UserLocation BetaManagedAgentsUserLocationParam Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfigParams Optional`

        Default configuration applied to all tools in this set.

        - `Enabled bool Optional`

          Whether tools are enabled and available to Claude by default. Defaults to true if not specified.

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion Optional`

          Default permission policy for tools. Controls whether tool calls are auto-approved or require confirmation.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolsetParams`

      Configuration for tools from an MCP server defined in `mcp_servers`.

      - `Type BetaManagedAgentsMCPToolsetParamsType`

      - `MCPServerName string`

        Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.

        minLength: 1, maxLength: 255

      - `Configs []BetaManagedAgentsMCPToolConfigParams Optional`

        Per-tool configuration overrides.

        - `Name string`

          Name of the MCP tool to configure. 1-128 characters.

          minLength: 1, maxLength: 128

        - `Enabled bool Optional`

          Whether this tool is enabled. Overrides the `default_config` setting.

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion Optional`

          Permission policy for this tool. Overrides the `default_config` setting.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfigParams Optional`

        Default configuration for all tools from this server.

        - `Enabled bool Optional`

          Whether tools are enabled by default. Defaults to true if not specified.

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion Optional`

          Default permission policy for tools from this server.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsCustomToolParams`

      A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.

      - `Type BetaManagedAgentsCustomToolParamsType`

      - `Description string`

        Description of what the tool does, shown to the agent to help it decide when to use the tool.

        minLength: 1

      - `InputSchema BetaManagedAgentsCustomToolInputSchemaParam`

        JSON Schema defining the expected input parameters for the tool.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

        Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.

        minLength: 1, maxLength: 128

  - `Version param.Opt[int64] Optional`

    The agent's current version, used to prevent concurrent overwrites. Obtain this value from a create or retrieve response. Must be at least 1 if specified. When supplied, the request fails if it does not match the server's current version; omit to apply the update unconditionally.

    format: int32

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsAgent`

  A Managed Agents `agent`.

  - `Type BetaManagedAgentsAgentType`

  - `ID string`

  - `ArchivedAt Time`

    When the agent was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Description string`

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

    Execution principal for runs of this agent. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

    - `type BetaManagedAgentsAWSRoleExecutionIdentity`

      An AWS IAM role principal as returned in API responses.

      - `Type AWSRole`

      - `RoleARN string`

        The IAM role's ARN.

    - `type BetaManagedAgentsServiceAccountExecutionIdentity`

      The Anthropic-managed service account as returned in API responses.

      - `Type ServiceAccount`

  - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

    - `Type BetaManagedAgentsMCPServerURLDefinitionType`

    - `Name string`

    - `URL string`

  - `Metadata map[string, string]`

  - `Model BetaManagedAgentsModelConfig`

    Model identifier and configuration.

    - `ID BetaManagedAgentsModel`

      The model that will power your agent.

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

      - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

        Fastest model for high-volume, real-time tasks

      - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

      - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

      - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

      - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

        Best combination of speed and intelligence

      - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

      - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

      - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

    - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

      How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

      - `type BetaManagedAgentsEffortLow`

        Low effort. Favors latency over reasoning depth.

        - `Type BetaManagedAgentsEffortLowType`

      - `type BetaManagedAgentsEffortMedium`

        Medium effort. Balances latency and reasoning depth.

        - `Type BetaManagedAgentsEffortMediumType`

      - `type BetaManagedAgentsEffortHigh`

        High effort. Favors reasoning depth.

        - `Type BetaManagedAgentsEffortHighType`

      - `type BetaManagedAgentsEffortXhigh`

        Extra-high effort. Not all models accept this level.

        - `Type BetaManagedAgentsEffortXhighType`

      - `type BetaManagedAgentsEffortMax`

        Maximum effort. Favors reasoning depth over latency.

        - `Type BetaManagedAgentsEffortMaxType`

    - `InferenceGeo string Optional`

      Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

    - `Speed BetaManagedAgentsModelConfigSpeed Optional`

      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

      - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

      - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentUnion`

    Multiagent orchestration configuration. Null when the agent is single-threaded.

    - `type BetaManagedAgentsMultiagentCoordinator`

      Resolved coordinator topology with a concrete agent roster.

      - `Type BetaManagedAgentsMultiagentCoordinatorType`

      - `Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion`

        Agents the coordinator may spawn as session threads, each resolved to a specific version.

        - `type BetaManagedAgentsAgentReference`

          A resolved agent reference with a concrete version.

          - `Type BetaManagedAgentsAgentReferenceType`

          - `ID string`

          - `Version int64`

            format: int32

        - `type BetaManagedAgentsAdvisor`

          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

          - `Type BetaManagedAgentsAdvisorType`

          - `Model string`

            The advisor model id.

    - `type BetaManagedAgentsMultiagent20261001`

      Resolved multiagent configuration with three members, each enabled or disabled on its own.

      - `Type Multiagent20261001`

      - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

        Whether the session's primary thread can consult an advisor model.

        - `type BetaManagedAgentsMultiagentAdvisorEnabled`

          The session's primary thread can consult `model` mid-turn.

          - `Type Enabled`

          - `Model string`

            The advisor model id.

        - `type BetaManagedAgentsMultiagentAdvisorDisabled`

          The agent has no advisor.

          - `Type Disabled`

      - `Subagents BetaManagedAgentsMultiagentSubagentsUnion`

        Whether the agent can spawn session threads.

        - `type BetaManagedAgentsMultiagentSubagentsEnabled`

          The agent can spawn session threads.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether the agent can define inline agents, which are not saved, when it spawns session threads.

            - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

              The agent can define inline agents.

              - `Type Enabled`

            - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

              The agent cannot define inline agents.

              - `Type Disabled`

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentSubagentsDisabled`

          The agent cannot spawn session threads.

          - `Type Disabled`

      - `Workflows BetaManagedAgentsMultiagentWorkflowsUnion`

        Whether the agent can start workflow runs.

        - `type BetaManagedAgentsMultiagentWorkflowsEnabled`

          The agent can start workflow runs.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether a run's plan can define inline agents, which are not saved.

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

          The agent cannot start workflow runs.

          - `Type Disabled`

  - `Name string`

  - `Skills []BetaManagedAgentsAgentSkillUnion`

    - `type BetaManagedAgentsAnthropicSkill`

      A resolved Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillType`

      - `SkillID string`

      - `Version string`

    - `type BetaManagedAgentsCustomSkill`

      A resolved user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillType`

      - `SkillID string`

      - `Version string`

  - `System string`

  - `Tools []BetaManagedAgentsAgentToolUnion`

    - `type BetaManagedAgentsAgentToolset20260401`

      - `Type BetaManagedAgentsAgentToolset20260401Type`

      - `Configs []BetaManagedAgentsAgentToolConfigUnion`

        - `type BetaManagedAgentsBashToolConfig`

          Configuration for the bash tool.

          - `Type Bash`

          - `Enabled bool`

          - `Name Bash`

          - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfig`

          Configuration for the edit tool.

          - `Type Edit`

          - `Enabled bool`

          - `Name Edit`

          - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfig`

          Configuration for the read tool.

          - `Type Read`

          - `Enabled bool`

          - `Name Read`

          - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfig`

          Configuration for the write tool.

          - `Type Write`

          - `Enabled bool`

          - `Name Write`

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfig`

          Configuration for the glob tool.

          - `Type Glob`

          - `Enabled bool`

          - `Name Glob`

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfig`

          Configuration for the grep tool.

          - `Type Grep`

          - `Enabled bool`

          - `Name Grep`

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfig`

          Configuration for the web_fetch tool.

          - `Type WebFetch`

          - `Enabled bool`

          - `Name WebFetch`

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSources`

            Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

                - `Type All`

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

                - `Type None`

              - `type BetaManagedAgentsWebFetchURLSourceOnly`

                Only the named tools' results contribute URLs that may be fetched.

                - `Type Only`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

              - `type BetaManagedAgentsWebFetchURLSourceExcept`

                Every tool's results contribute URLs that may be fetched, except the named tools' results.

                - `Type Except`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

              Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `MaxContentTokens int64 Optional`

            format: int32

        - `type BetaManagedAgentsWebSearchToolConfig`

          Configuration for the web_search tool.

          - `Type WebSearch`

          - `Enabled bool`

          - `Name WebSearch`

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `UserLocation BetaManagedAgentsUserLocation Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

        Resolved default configuration for agent tools.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolset`

      - `Type BetaManagedAgentsMCPToolsetType`

      - `Configs []BetaManagedAgentsMCPToolConfig`

        - `Enabled bool`

        - `Name string`

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

        Resolved default configuration for all tools from an MCP server.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `MCPServerName string`

    - `type BetaManagedAgentsCustomTool`

      A custom tool as returned in API responses.

      - `Type BetaManagedAgentsCustomToolType`

      - `Description string`

      - `InputSchema BetaManagedAgentsCustomToolInputSchema`

        JSON Schema for custom tool input parameters.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Version int64`

    The agent's current version. Starts at 1 and increments when the agent is modified.

    format: int32

#### 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"),
	)
	betaManagedAgentsAgent, err := client.Beta.Agents.Update(
		context.TODO(),
		"agent_011CZkYpogX7uDKUyvBTophP",
		anthropic.BetaAgentUpdateParams{
			Description: anthropic.String("updated"),
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsAgent.ID)
}
```

##### Response (200)

```json
{
  "id": "agent_011CZkYpogX7uDKUyvBTophP",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "A general-purpose starter agent.",
  "execution_identity": {
    "type": "service_account"
  },
  "mcp_servers": [
    {
      "name": "example-mcp",
      "type": "url",
      "url": "https://example-server.modelcontextprotocol.io/sse"
    }
  ],
  "metadata": {
    "foo": "bar"
  },
  "model": {
    "id": "claude-opus-5-5",
    "effort": {
      "type": "low"
    },
    "inference_geo": "inference_geo",
    "speed": "standard"
  },
  "multiagent": {
    "advisor": {
      "type": "disabled"
    },
    "subagents": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    },
    "type": "multiagent_20261001",
    "workflows": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    }
  },
  "name": "My First Agent",
  "skills": [
    {
      "skill_id": "xlsx",
      "type": "anthropic",
      "version": "1"
    },
    {
      "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
      "type": "custom",
      "version": "2"
    }
  ],
  "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
  "tools": [
    {
      "configs": [
        {
          "enabled": true,
          "name": "bash",
          "permission_policy": {
            "type": "always_allow"
          },
          "type": "bash"
        }
      ],
      "default_config": {
        "enabled": true,
        "permission_policy": {
          "type": "always_ask"
        }
      },
      "type": "agent_toolset_20260401"
    }
  ],
  "type": "agent",
  "updated_at": "2026-03-15T10:00:00Z",
  "version": 1
}
```

### Archive Agent

`client.Beta.Agents.Archive(ctx, agentID, body) (*BetaManagedAgentsAgent, error)`

**POST** `/v1/agents/{agent_id}/archive`

Archive Agent

#### Parameters

- `agentID string` (path parameter)

  Unique identifier of the agent to archive.

- `body BetaAgentArchiveParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsAgent`

  A Managed Agents `agent`.

  - `Type BetaManagedAgentsAgentType`

  - `ID string`

  - `ArchivedAt Time`

    When the agent was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Description string`

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

    Execution principal for runs of this agent. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

    - `type BetaManagedAgentsAWSRoleExecutionIdentity`

      An AWS IAM role principal as returned in API responses.

      - `Type AWSRole`

      - `RoleARN string`

        The IAM role's ARN.

    - `type BetaManagedAgentsServiceAccountExecutionIdentity`

      The Anthropic-managed service account as returned in API responses.

      - `Type ServiceAccount`

  - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

    - `Type BetaManagedAgentsMCPServerURLDefinitionType`

    - `Name string`

    - `URL string`

  - `Metadata map[string, string]`

  - `Model BetaManagedAgentsModelConfig`

    Model identifier and configuration.

    - `ID BetaManagedAgentsModel`

      The model that will power your agent.

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

      - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

        Fastest model for high-volume, real-time tasks

      - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

      - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

      - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

      - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

        Best combination of speed and intelligence

      - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

      - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

      - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

    - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

      How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

      - `type BetaManagedAgentsEffortLow`

        Low effort. Favors latency over reasoning depth.

        - `Type BetaManagedAgentsEffortLowType`

      - `type BetaManagedAgentsEffortMedium`

        Medium effort. Balances latency and reasoning depth.

        - `Type BetaManagedAgentsEffortMediumType`

      - `type BetaManagedAgentsEffortHigh`

        High effort. Favors reasoning depth.

        - `Type BetaManagedAgentsEffortHighType`

      - `type BetaManagedAgentsEffortXhigh`

        Extra-high effort. Not all models accept this level.

        - `Type BetaManagedAgentsEffortXhighType`

      - `type BetaManagedAgentsEffortMax`

        Maximum effort. Favors reasoning depth over latency.

        - `Type BetaManagedAgentsEffortMaxType`

    - `InferenceGeo string Optional`

      Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

    - `Speed BetaManagedAgentsModelConfigSpeed Optional`

      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

      - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

      - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentUnion`

    Multiagent orchestration configuration. Null when the agent is single-threaded.

    - `type BetaManagedAgentsMultiagentCoordinator`

      Resolved coordinator topology with a concrete agent roster.

      - `Type BetaManagedAgentsMultiagentCoordinatorType`

      - `Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion`

        Agents the coordinator may spawn as session threads, each resolved to a specific version.

        - `type BetaManagedAgentsAgentReference`

          A resolved agent reference with a concrete version.

          - `Type BetaManagedAgentsAgentReferenceType`

          - `ID string`

          - `Version int64`

            format: int32

        - `type BetaManagedAgentsAdvisor`

          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

          - `Type BetaManagedAgentsAdvisorType`

          - `Model string`

            The advisor model id.

    - `type BetaManagedAgentsMultiagent20261001`

      Resolved multiagent configuration with three members, each enabled or disabled on its own.

      - `Type Multiagent20261001`

      - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

        Whether the session's primary thread can consult an advisor model.

        - `type BetaManagedAgentsMultiagentAdvisorEnabled`

          The session's primary thread can consult `model` mid-turn.

          - `Type Enabled`

          - `Model string`

            The advisor model id.

        - `type BetaManagedAgentsMultiagentAdvisorDisabled`

          The agent has no advisor.

          - `Type Disabled`

      - `Subagents BetaManagedAgentsMultiagentSubagentsUnion`

        Whether the agent can spawn session threads.

        - `type BetaManagedAgentsMultiagentSubagentsEnabled`

          The agent can spawn session threads.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether the agent can define inline agents, which are not saved, when it spawns session threads.

            - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

              The agent can define inline agents.

              - `Type Enabled`

            - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

              The agent cannot define inline agents.

              - `Type Disabled`

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentSubagentsDisabled`

          The agent cannot spawn session threads.

          - `Type Disabled`

      - `Workflows BetaManagedAgentsMultiagentWorkflowsUnion`

        Whether the agent can start workflow runs.

        - `type BetaManagedAgentsMultiagentWorkflowsEnabled`

          The agent can start workflow runs.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether a run's plan can define inline agents, which are not saved.

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

          The agent cannot start workflow runs.

          - `Type Disabled`

  - `Name string`

  - `Skills []BetaManagedAgentsAgentSkillUnion`

    - `type BetaManagedAgentsAnthropicSkill`

      A resolved Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillType`

      - `SkillID string`

      - `Version string`

    - `type BetaManagedAgentsCustomSkill`

      A resolved user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillType`

      - `SkillID string`

      - `Version string`

  - `System string`

  - `Tools []BetaManagedAgentsAgentToolUnion`

    - `type BetaManagedAgentsAgentToolset20260401`

      - `Type BetaManagedAgentsAgentToolset20260401Type`

      - `Configs []BetaManagedAgentsAgentToolConfigUnion`

        - `type BetaManagedAgentsBashToolConfig`

          Configuration for the bash tool.

          - `Type Bash`

          - `Enabled bool`

          - `Name Bash`

          - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfig`

          Configuration for the edit tool.

          - `Type Edit`

          - `Enabled bool`

          - `Name Edit`

          - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfig`

          Configuration for the read tool.

          - `Type Read`

          - `Enabled bool`

          - `Name Read`

          - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfig`

          Configuration for the write tool.

          - `Type Write`

          - `Enabled bool`

          - `Name Write`

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfig`

          Configuration for the glob tool.

          - `Type Glob`

          - `Enabled bool`

          - `Name Glob`

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfig`

          Configuration for the grep tool.

          - `Type Grep`

          - `Enabled bool`

          - `Name Grep`

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfig`

          Configuration for the web_fetch tool.

          - `Type WebFetch`

          - `Enabled bool`

          - `Name WebFetch`

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSources`

            Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

                - `Type All`

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

                - `Type None`

              - `type BetaManagedAgentsWebFetchURLSourceOnly`

                Only the named tools' results contribute URLs that may be fetched.

                - `Type Only`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

              - `type BetaManagedAgentsWebFetchURLSourceExcept`

                Every tool's results contribute URLs that may be fetched, except the named tools' results.

                - `Type Except`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

              Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `MaxContentTokens int64 Optional`

            format: int32

        - `type BetaManagedAgentsWebSearchToolConfig`

          Configuration for the web_search tool.

          - `Type WebSearch`

          - `Enabled bool`

          - `Name WebSearch`

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `UserLocation BetaManagedAgentsUserLocation Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

        Resolved default configuration for agent tools.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolset`

      - `Type BetaManagedAgentsMCPToolsetType`

      - `Configs []BetaManagedAgentsMCPToolConfig`

        - `Enabled bool`

        - `Name string`

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

        Resolved default configuration for all tools from an MCP server.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `MCPServerName string`

    - `type BetaManagedAgentsCustomTool`

      A custom tool as returned in API responses.

      - `Type BetaManagedAgentsCustomToolType`

      - `Description string`

      - `InputSchema BetaManagedAgentsCustomToolInputSchema`

        JSON Schema for custom tool input parameters.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Version int64`

    The agent's current version. Starts at 1 and increments when the agent is modified.

    format: int32

#### 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"),
	)
	betaManagedAgentsAgent, err := client.Beta.Agents.Archive(
		context.TODO(),
		"agent_011CZkYpogX7uDKUyvBTophP",
		anthropic.BetaAgentArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsAgent.ID)
}
```

##### Response (200)

```json
{
  "id": "agent_011CZkYpogX7uDKUyvBTophP",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "A general-purpose starter agent.",
  "execution_identity": {
    "type": "service_account"
  },
  "mcp_servers": [
    {
      "name": "example-mcp",
      "type": "url",
      "url": "https://example-server.modelcontextprotocol.io/sse"
    }
  ],
  "metadata": {
    "foo": "bar"
  },
  "model": {
    "id": "claude-opus-5-5",
    "effort": {
      "type": "low"
    },
    "inference_geo": "inference_geo",
    "speed": "standard"
  },
  "multiagent": {
    "advisor": {
      "type": "disabled"
    },
    "subagents": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    },
    "type": "multiagent_20261001",
    "workflows": {
      "inline_agents": {
        "type": "enabled"
      },
      "predefined_agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "type": "agent",
          "version": 1
        }
      ],
      "type": "enabled"
    }
  },
  "name": "My First Agent",
  "skills": [
    {
      "skill_id": "xlsx",
      "type": "anthropic",
      "version": "1"
    },
    {
      "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
      "type": "custom",
      "version": "2"
    }
  ],
  "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
  "tools": [
    {
      "configs": [
        {
          "enabled": true,
          "name": "bash",
          "permission_policy": {
            "type": "always_allow"
          },
          "type": "bash"
        }
      ],
      "default_config": {
        "enabled": true,
        "permission_policy": {
          "type": "always_ask"
        }
      },
      "type": "agent_toolset_20260401"
    }
  ],
  "type": "agent",
  "updated_at": "2026-03-15T10:00:00Z",
  "version": 1
}
```

## Beta › Agents › Versions

### List Agent Versions

`client.Beta.Agents.Versions.List(ctx, agentID, params) (*PageCursor[BetaManagedAgentsAgent], error)`

**GET** `/v1/agents/{agent_id}/versions`

List Agent Versions

#### Parameters

- `agentID string` (path parameter)

  Agent ID to list versions for.

- `params BetaAgentVersionListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum results per page. Default 20, maximum 100.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsAgent`

  A Managed Agents `agent`.

  - `Type BetaManagedAgentsAgentType`

  - `ID string`

  - `ArchivedAt Time`

    When the agent was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Description string`

  - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

    Execution principal for runs of this agent. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

    - `type BetaManagedAgentsAWSRoleExecutionIdentity`

      An AWS IAM role principal as returned in API responses.

      - `Type AWSRole`

      - `RoleARN string`

        The IAM role's ARN.

    - `type BetaManagedAgentsServiceAccountExecutionIdentity`

      The Anthropic-managed service account as returned in API responses.

      - `Type ServiceAccount`

  - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

    - `Type BetaManagedAgentsMCPServerURLDefinitionType`

    - `Name string`

    - `URL string`

  - `Metadata map[string, string]`

  - `Model BetaManagedAgentsModelConfig`

    Model identifier and configuration.

    - `ID BetaManagedAgentsModel`

      The model that will power your agent.

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

      - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

        Fastest model for high-volume, real-time tasks

      - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

      - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

      - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

        Efficient model for coding and agents

      - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

      - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

        Best combination of speed and intelligence

      - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

      - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

      - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

        Powerful intelligence for long-running agents and coding

      - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

    - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

      How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

      - `type BetaManagedAgentsEffortLow`

        Low effort. Favors latency over reasoning depth.

        - `Type BetaManagedAgentsEffortLowType`

      - `type BetaManagedAgentsEffortMedium`

        Medium effort. Balances latency and reasoning depth.

        - `Type BetaManagedAgentsEffortMediumType`

      - `type BetaManagedAgentsEffortHigh`

        High effort. Favors reasoning depth.

        - `Type BetaManagedAgentsEffortHighType`

      - `type BetaManagedAgentsEffortXhigh`

        Extra-high effort. Not all models accept this level.

        - `Type BetaManagedAgentsEffortXhighType`

      - `type BetaManagedAgentsEffortMax`

        Maximum effort. Favors reasoning depth over latency.

        - `Type BetaManagedAgentsEffortMaxType`

    - `InferenceGeo string Optional`

      Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

    - `Speed BetaManagedAgentsModelConfigSpeed Optional`

      Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

      - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

      - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

  - `Multiagent BetaManagedAgentsMultiagentUnion`

    Multiagent orchestration configuration. Null when the agent is single-threaded.

    - `type BetaManagedAgentsMultiagentCoordinator`

      Resolved coordinator topology with a concrete agent roster.

      - `Type BetaManagedAgentsMultiagentCoordinatorType`

      - `Agents []BetaManagedAgentsMultiagentCoordinatorAgentUnion`

        Agents the coordinator may spawn as session threads, each resolved to a specific version.

        - `type BetaManagedAgentsAgentReference`

          A resolved agent reference with a concrete version.

          - `Type BetaManagedAgentsAgentReferenceType`

          - `ID string`

          - `Version int64`

            format: int32

        - `type BetaManagedAgentsAdvisor`

          Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

          - `Type BetaManagedAgentsAdvisorType`

          - `Model string`

            The advisor model id.

    - `type BetaManagedAgentsMultiagent20261001`

      Resolved multiagent configuration with three members, each enabled or disabled on its own.

      - `Type Multiagent20261001`

      - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

        Whether the session's primary thread can consult an advisor model.

        - `type BetaManagedAgentsMultiagentAdvisorEnabled`

          The session's primary thread can consult `model` mid-turn.

          - `Type Enabled`

          - `Model string`

            The advisor model id.

        - `type BetaManagedAgentsMultiagentAdvisorDisabled`

          The agent has no advisor.

          - `Type Disabled`

      - `Subagents BetaManagedAgentsMultiagentSubagentsUnion`

        Whether the agent can spawn session threads.

        - `type BetaManagedAgentsMultiagentSubagentsEnabled`

          The agent can spawn session threads.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether the agent can define inline agents, which are not saved, when it spawns session threads.

            - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

              The agent can define inline agents.

              - `Type Enabled`

            - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

              The agent cannot define inline agents.

              - `Type Disabled`

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that this agent can spawn as session threads, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentSubagentsDisabled`

          The agent cannot spawn session threads.

          - `Type Disabled`

      - `Workflows BetaManagedAgentsMultiagentWorkflowsUnion`

        Whether the agent can start workflow runs.

        - `type BetaManagedAgentsMultiagentWorkflowsEnabled`

          The agent can start workflow runs.

          - `Type Enabled`

          - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

            Whether a run's plan can define inline agents, which are not saved.

          - `PredefinedAgents []BetaManagedAgentsAgentReference`

            Predefined agents, which are saved agents that a run's plan can use, each resolved to a specific version.

            - `Type BetaManagedAgentsAgentReferenceType`

            - `ID string`

            - `Version int64`

              format: int32

        - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

          The agent cannot start workflow runs.

          - `Type Disabled`

  - `Name string`

  - `Skills []BetaManagedAgentsAgentSkillUnion`

    - `type BetaManagedAgentsAnthropicSkill`

      A resolved Anthropic-managed skill.

      - `Type BetaManagedAgentsAnthropicSkillType`

      - `SkillID string`

      - `Version string`

    - `type BetaManagedAgentsCustomSkill`

      A resolved user-created custom skill.

      - `Type BetaManagedAgentsCustomSkillType`

      - `SkillID string`

      - `Version string`

  - `System string`

  - `Tools []BetaManagedAgentsAgentToolUnion`

    - `type BetaManagedAgentsAgentToolset20260401`

      - `Type BetaManagedAgentsAgentToolset20260401Type`

      - `Configs []BetaManagedAgentsAgentToolConfigUnion`

        - `type BetaManagedAgentsBashToolConfig`

          Configuration for the bash tool.

          - `Type Bash`

          - `Enabled bool`

          - `Name Bash`

          - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

              - `Type BetaManagedAgentsAlwaysAllowPolicyType`

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

              - `Type BetaManagedAgentsAlwaysAskPolicyType`

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `Type Auto`

        - `type BetaManagedAgentsEditToolConfig`

          Configuration for the edit tool.

          - `Type Edit`

          - `Enabled bool`

          - `Name Edit`

          - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsReadToolConfig`

          Configuration for the read tool.

          - `Type Read`

          - `Enabled bool`

          - `Name Read`

          - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWriteToolConfig`

          Configuration for the write tool.

          - `Type Write`

          - `Enabled bool`

          - `Name Write`

          - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGlobToolConfig`

          Configuration for the glob tool.

          - `Type Glob`

          - `Enabled bool`

          - `Name Glob`

          - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsGrepToolConfig`

          Configuration for the grep tool.

          - `Type Grep`

          - `Enabled bool`

          - `Name Grep`

          - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsWebFetchToolConfig`

          Configuration for the web_fetch tool.

          - `Type WebFetch`

          - `Enabled bool`

          - `Name WebFetch`

          - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `URLSources BetaManagedAgentsWebFetchURLSources`

            Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

            - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

                - `Type All`

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

                - `Type None`

              - `type BetaManagedAgentsWebFetchURLSourceOnly`

                Only the named tools' results contribute URLs that may be fetched.

                - `Type Only`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

              - `type BetaManagedAgentsWebFetchURLSourceExcept`

                Every tool's results contribute URLs that may be fetched, except the named tools' results.

                - `Type Except`

                - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                  The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                  - `Type ToolReference`

                    Must be "tool_reference".

                  - `Name string`

                    Name of the tool. Compared exactly, so upper and lower case letters are different.

                    minLength: 1, maxLength: 128

            - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

              Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

            - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

              Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

              - `type BetaManagedAgentsWebFetchURLSourceAll`

                Every URL from this source may be fetched. This is the default.

              - `type BetaManagedAgentsWebFetchURLSourceNone`

                This source contributes no URLs that may be fetched.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `MaxContentTokens int64 Optional`

            format: int32

        - `type BetaManagedAgentsWebSearchToolConfig`

          Configuration for the web_search tool.

          - `Type WebSearch`

          - `Enabled bool`

          - `Name WebSearch`

          - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

            Permission policy for tool execution.

            - `type BetaManagedAgentsAlwaysAllowPolicy`

              Tool calls are automatically approved without user confirmation.

            - `type BetaManagedAgentsAlwaysAskPolicy`

              Tool calls require user confirmation before execution.

            - `type BetaManagedAgentsAutoPolicy`

              The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `AllowedDomains []string Optional`

          - `BlockedDomains []string Optional`

          - `UserLocation BetaManagedAgentsUserLocation Optional`

            Approximate user location for search result localization.

            - `Type Approximate`

              Location precision. Only "approximate" is supported.

            - `City string Optional`

              City name.

              minLength: 1, maxLength: 255

            - `Country string Optional`

              Two-letter ISO 3166-1 country code, uppercase.

            - `Region string Optional`

              Region or state name.

              minLength: 1, maxLength: 255

            - `Timezone string Optional`

              IANA timezone identifier, e.g. "America/Los_Angeles".

              minLength: 1, maxLength: 255

      - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

        Resolved default configuration for agent tools.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

    - `type BetaManagedAgentsMCPToolset`

      - `Type BetaManagedAgentsMCPToolsetType`

      - `Configs []BetaManagedAgentsMCPToolConfig`

        - `Enabled bool`

        - `Name string`

        - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

        Resolved default configuration for all tools from an MCP server.

        - `Enabled bool`

        - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

          Permission policy for tool execution.

          - `type BetaManagedAgentsAlwaysAllowPolicy`

            Tool calls are automatically approved without user confirmation.

          - `type BetaManagedAgentsAlwaysAskPolicy`

            Tool calls require user confirmation before execution.

          - `type BetaManagedAgentsAutoPolicy`

            The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

      - `MCPServerName string`

    - `type BetaManagedAgentsCustomTool`

      A custom tool as returned in API responses.

      - `Type BetaManagedAgentsCustomToolType`

      - `Description string`

      - `InputSchema BetaManagedAgentsCustomToolInputSchema`

        JSON Schema for custom tool input parameters.

        - `Type Object`

        - `Properties map[string, any] Optional`

        - `Required []string Optional`

      - `Name string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Version int64`

    The agent's current version. Starts at 1 and increments when the agent is modified.

    format: int32

#### 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"),
	)
	page, err := client.Beta.Agents.Versions.List(
		context.TODO(),
		"agent_011CZkYpogX7uDKUyvBTophP",
		anthropic.BetaAgentVersionListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "agent_011CZkYpogX7uDKUyvBTophP",
      "archived_at": null,
      "created_at": "2026-03-15T10:00:00Z",
      "description": "A general-purpose starter agent.",
      "execution_identity": {
        "type": "service_account"
      },
      "mcp_servers": [
        {
          "name": "example-mcp",
          "type": "url",
          "url": "https://example-server.modelcontextprotocol.io/sse"
        }
      ],
      "metadata": {
        "foo": "bar"
      },
      "model": {
        "id": "claude-opus-5-5",
        "effort": {
          "type": "low"
        },
        "inference_geo": "inference_geo",
        "speed": "standard"
      },
      "multiagent": {
        "advisor": {
          "type": "disabled"
        },
        "subagents": {
          "inline_agents": {
            "type": "enabled"
          },
          "predefined_agents": [
            {
              "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
              "type": "agent",
              "version": 1
            }
          ],
          "type": "enabled"
        },
        "type": "multiagent_20261001",
        "workflows": {
          "inline_agents": {
            "type": "enabled"
          },
          "predefined_agents": [
            {
              "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
              "type": "agent",
              "version": 1
            }
          ],
          "type": "enabled"
        }
      },
      "name": "My First Agent",
      "skills": [
        {
          "skill_id": "xlsx",
          "type": "anthropic",
          "version": "1"
        },
        {
          "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
          "type": "custom",
          "version": "2"
        }
      ],
      "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
      "tools": [
        {
          "configs": [
            {
              "enabled": true,
              "name": "bash",
              "permission_policy": {
                "type": "always_allow"
              },
              "type": "bash"
            }
          ],
          "default_config": {
            "enabled": true,
            "permission_policy": {
              "type": "always_ask"
            }
          },
          "type": "agent_toolset_20260401"
        }
      ],
      "type": "agent",
      "updated_at": "2026-03-15T10:00:00Z",
      "version": 1
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Environments

### Create Environment

`client.Beta.Environments.New(ctx, params) (*BetaEnvironment, error)`

**POST** `/v1/environments`

Create a new environment with the specified configuration.

#### Parameters

- `params BetaEnvironmentNewParams`

  - `Name string`

    Human-readable name for the environment

    minLength: 1, maxLength: 256

  - `Config BetaEnvironmentNewParamsConfigUnion Optional`

    Environment configuration

    - `type BetaCloudConfigParams`

      Request params for `cloud` environment configuration.

      Fields default to null; on update, omitted fields preserve the
      existing value.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigParamsNetworkingUnion Optional`

        Network configuration policy. Omit on update to preserve the existing value.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetworkParams`

          Limited network request params.

          Fields default to null; on update, omitted fields preserve the
          existing value.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool Optional`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.

          - `AllowPackageManagers bool Optional`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false` on creation. Must be `true` when `packages` are specified.

          - `AllowedHosts []string Optional`

            Specifies domains the container can reach.

      - `Packages BetaPackagesParams Optional`

        Package manager configuration. Under `limited` networking, requires `networking.allow_package_managers` to be `true`. Omit on update to preserve the existing value.

        - `Type BetaPackagesParamsType Optional`

          Package configuration type

          default: packages

        - `Apt []string Optional`

          Ubuntu/Debian packages to install

        - `Cargo []string Optional`

          Rust packages to install

        - `Gem []string Optional`

          Ruby packages to install

        - `Go []string Optional`

          Go packages to install

        - `Npm []string Optional`

          Node.js packages to install

        - `Pip []string Optional`

          Python packages to install

    - `type BetaSelfHostedConfigParams`

      Request params for `self_hosted` environment configuration.

      - `Type SelfHosted`

        Environment type

  - `Description param.Opt[string] Optional`

    Optional description of the environment

    maxLength: 1024

  - `Metadata map[string, string] Optional`

    User-provided metadata key-value pairs

  - `Scope BetaEnvironmentNewParamsScope Optional`

    The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only. API organizations support only 'organization'; 'account' is rejected. If not specified, defaults based on organization type.

    - `const BetaEnvironmentNewParamsScopeOrganization BetaEnvironmentNewParamsScope = "organization"`

    - `const BetaEnvironmentNewParamsScopeAccount BetaEnvironmentNewParamsScope = "account"`

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

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

#### Returns

- `type BetaEnvironment`

  Unified Environment resource for both cloud and self-hosted environments.

  - `Type Environment`

    The type of object (always 'environment')

    default: environment

  - `ID string`

    Environment identifier (e.g., 'env_...')

  - `ArchivedAt string`

    RFC 3339 timestamp when environment was archived, or null if not archived

  - `Config BetaEnvironmentConfigUnion`

    Environment configuration (either Anthropic Cloud or self-hosted)

    - `type BetaCloudConfig`

      `cloud` environment configuration.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigNetworkingUnion`

        Network configuration policy.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetwork`

          Limited network access.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.

          - `AllowPackageManagers bool`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.

          - `AllowedHosts []string`

            Specifies domains the container can reach.

      - `Packages BetaPackages`

        Package manager configuration.

        - `Type BetaPackagesType Optional`

          Package configuration type

          default: packages

        - `Apt []string`

          Ubuntu/Debian packages to install

        - `Cargo []string`

          Rust packages to install

        - `Gem []string`

          Ruby packages to install

        - `Go []string`

          Go packages to install

        - `Npm []string`

          Node.js packages to install

        - `Pip []string`

          Python packages to install

    - `type BetaSelfHostedConfig`

      Configuration for self-hosted environments.

      - `Type SelfHosted`

        Environment type

  - `CreatedAt string`

    RFC 3339 timestamp when environment was created

  - `Description string`

    User-provided description for the environment; null when unset

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs

  - `Name string`

    Human-readable name for the environment

  - `UpdatedAt string`

    RFC 3339 timestamp when environment was last updated

  - `Scope BetaEnvironmentScope Optional`

    The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

    - `const BetaEnvironmentScopeOrganization BetaEnvironmentScope = "organization"`

    - `const BetaEnvironmentScopeAccount BetaEnvironmentScope = "account"`

#### 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"),
	)
	betaEnvironment, err := client.Beta.Environments.New(context.TODO(), anthropic.BetaEnvironmentNewParams{
		Name: "python-data-analysis",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaEnvironment.ID)
}
```

##### Response (200)

```json
{
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "archived_at": null,
  "config": {
    "networking": {
      "allow_mcp_servers": false,
      "allow_package_managers": true,
      "allowed_hosts": [
        "api.example.com"
      ],
      "type": "limited"
    },
    "packages": {
      "apt": [
        "string"
      ],
      "cargo": [
        "string"
      ],
      "gem": [
        "string"
      ],
      "go": [
        "string"
      ],
      "npm": [
        "string"
      ],
      "pip": [
        "pandas",
        "numpy"
      ],
      "type": "packages"
    },
    "type": "cloud"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Python environment with data-analysis packages.",
  "metadata": {},
  "name": "python-data-analysis",
  "type": "environment",
  "updated_at": "2026-03-15T10:00:00Z",
  "scope": "organization"
}
```

### List Environments

`client.Beta.Environments.List(ctx, params) (*PageCursor[BetaEnvironment], error)`

**GET** `/v1/environments`

List environments with pagination support.

#### Parameters

- `params BetaEnvironmentListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Include archived environments in the response

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of environments to return

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from previous response for pagination. Pass the `next_page` value from the previous response.

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

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

#### Returns

- `type BetaEnvironment`

  Unified Environment resource for both cloud and self-hosted environments.

  - `Type Environment`

    The type of object (always 'environment')

    default: environment

  - `ID string`

    Environment identifier (e.g., 'env_...')

  - `ArchivedAt string`

    RFC 3339 timestamp when environment was archived, or null if not archived

  - `Config BetaEnvironmentConfigUnion`

    Environment configuration (either Anthropic Cloud or self-hosted)

    - `type BetaCloudConfig`

      `cloud` environment configuration.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigNetworkingUnion`

        Network configuration policy.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetwork`

          Limited network access.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.

          - `AllowPackageManagers bool`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.

          - `AllowedHosts []string`

            Specifies domains the container can reach.

      - `Packages BetaPackages`

        Package manager configuration.

        - `Type BetaPackagesType Optional`

          Package configuration type

          default: packages

        - `Apt []string`

          Ubuntu/Debian packages to install

        - `Cargo []string`

          Rust packages to install

        - `Gem []string`

          Ruby packages to install

        - `Go []string`

          Go packages to install

        - `Npm []string`

          Node.js packages to install

        - `Pip []string`

          Python packages to install

    - `type BetaSelfHostedConfig`

      Configuration for self-hosted environments.

      - `Type SelfHosted`

        Environment type

  - `CreatedAt string`

    RFC 3339 timestamp when environment was created

  - `Description string`

    User-provided description for the environment; null when unset

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs

  - `Name string`

    Human-readable name for the environment

  - `UpdatedAt string`

    RFC 3339 timestamp when environment was last updated

  - `Scope BetaEnvironmentScope Optional`

    The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

    - `const BetaEnvironmentScopeOrganization BetaEnvironmentScope = "organization"`

    - `const BetaEnvironmentScopeAccount BetaEnvironmentScope = "account"`

#### 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"),
	)
	page, err := client.Beta.Environments.List(context.TODO(), anthropic.BetaEnvironmentListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
      "archived_at": null,
      "config": {
        "networking": {
          "allow_mcp_servers": false,
          "allow_package_managers": true,
          "allowed_hosts": [
            "api.example.com"
          ],
          "type": "limited"
        },
        "packages": {
          "apt": [
            "string"
          ],
          "cargo": [
            "string"
          ],
          "gem": [
            "string"
          ],
          "go": [
            "string"
          ],
          "npm": [
            "string"
          ],
          "pip": [
            "pandas",
            "numpy"
          ],
          "type": "packages"
        },
        "type": "cloud"
      },
      "created_at": "2026-03-15T10:00:00Z",
      "description": "Python environment with data-analysis packages.",
      "metadata": {},
      "name": "python-data-analysis",
      "type": "environment",
      "updated_at": "2026-03-15T10:00:00Z",
      "scope": "organization"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get Environment

`client.Beta.Environments.Get(ctx, environmentID, query) (*BetaEnvironment, error)`

**GET** `/v1/environments/{environment_id}`

Retrieve a specific environment by ID.

#### Parameters

- `environmentID string` (path parameter)

- `query BetaEnvironmentGetParams`

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

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

#### Returns

- `type BetaEnvironment`

  Unified Environment resource for both cloud and self-hosted environments.

  - `Type Environment`

    The type of object (always 'environment')

    default: environment

  - `ID string`

    Environment identifier (e.g., 'env_...')

  - `ArchivedAt string`

    RFC 3339 timestamp when environment was archived, or null if not archived

  - `Config BetaEnvironmentConfigUnion`

    Environment configuration (either Anthropic Cloud or self-hosted)

    - `type BetaCloudConfig`

      `cloud` environment configuration.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigNetworkingUnion`

        Network configuration policy.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetwork`

          Limited network access.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.

          - `AllowPackageManagers bool`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.

          - `AllowedHosts []string`

            Specifies domains the container can reach.

      - `Packages BetaPackages`

        Package manager configuration.

        - `Type BetaPackagesType Optional`

          Package configuration type

          default: packages

        - `Apt []string`

          Ubuntu/Debian packages to install

        - `Cargo []string`

          Rust packages to install

        - `Gem []string`

          Ruby packages to install

        - `Go []string`

          Go packages to install

        - `Npm []string`

          Node.js packages to install

        - `Pip []string`

          Python packages to install

    - `type BetaSelfHostedConfig`

      Configuration for self-hosted environments.

      - `Type SelfHosted`

        Environment type

  - `CreatedAt string`

    RFC 3339 timestamp when environment was created

  - `Description string`

    User-provided description for the environment; null when unset

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs

  - `Name string`

    Human-readable name for the environment

  - `UpdatedAt string`

    RFC 3339 timestamp when environment was last updated

  - `Scope BetaEnvironmentScope Optional`

    The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

    - `const BetaEnvironmentScopeOrganization BetaEnvironmentScope = "organization"`

    - `const BetaEnvironmentScopeAccount BetaEnvironmentScope = "account"`

#### 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"),
	)
	betaEnvironment, err := client.Beta.Environments.Get(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaEnvironment.ID)
}
```

##### Response (200)

```json
{
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "archived_at": null,
  "config": {
    "networking": {
      "allow_mcp_servers": false,
      "allow_package_managers": true,
      "allowed_hosts": [
        "api.example.com"
      ],
      "type": "limited"
    },
    "packages": {
      "apt": [
        "string"
      ],
      "cargo": [
        "string"
      ],
      "gem": [
        "string"
      ],
      "go": [
        "string"
      ],
      "npm": [
        "string"
      ],
      "pip": [
        "pandas",
        "numpy"
      ],
      "type": "packages"
    },
    "type": "cloud"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Python environment with data-analysis packages.",
  "metadata": {},
  "name": "python-data-analysis",
  "type": "environment",
  "updated_at": "2026-03-15T10:00:00Z",
  "scope": "organization"
}
```

### Update Environment

`client.Beta.Environments.Update(ctx, environmentID, params) (*BetaEnvironment, error)`

**POST** `/v1/environments/{environment_id}`

Update an existing environment's configuration.

#### Parameters

- `environmentID string` (path parameter)

- `params BetaEnvironmentUpdateParams`

  - `Config BetaEnvironmentUpdateParamsConfigUnion Optional`

    Updated environment configuration

    - `type BetaCloudConfigParams`

      Request params for `cloud` environment configuration.

      Fields default to null; on update, omitted fields preserve the
      existing value.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigParamsNetworkingUnion Optional`

        Network configuration policy. Omit on update to preserve the existing value.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetworkParams`

          Limited network request params.

          Fields default to null; on update, omitted fields preserve the
          existing value.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool Optional`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array. Defaults to `false`.

          - `AllowPackageManagers bool Optional`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array. Defaults to `false` on creation. Must be `true` when `packages` are specified.

          - `AllowedHosts []string Optional`

            Specifies domains the container can reach.

      - `Packages BetaPackagesParams Optional`

        Package manager configuration. Under `limited` networking, requires `networking.allow_package_managers` to be `true`. Omit on update to preserve the existing value.

        - `Type BetaPackagesParamsType Optional`

          Package configuration type

          default: packages

        - `Apt []string Optional`

          Ubuntu/Debian packages to install

        - `Cargo []string Optional`

          Rust packages to install

        - `Gem []string Optional`

          Ruby packages to install

        - `Go []string Optional`

          Go packages to install

        - `Npm []string Optional`

          Node.js packages to install

        - `Pip []string Optional`

          Python packages to install

    - `type BetaSelfHostedConfigParams`

      Request params for `self_hosted` environment configuration.

      - `Type SelfHosted`

        Environment type

  - `Description param.Opt[string] Optional`

    Updated description of the environment. Omit to preserve; null clears to null; an empty string is stored as an empty string.

    maxLength: 1024

  - `Metadata map[string, string] Optional`

    User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.

  - `Name param.Opt[string] Optional`

    Updated name for the environment

    minLength: 1, maxLength: 256

  - `Scope BetaEnvironmentUpdateParamsScope Optional`

    The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only.

    - `const BetaEnvironmentUpdateParamsScopeOrganization BetaEnvironmentUpdateParamsScope = "organization"`

    - `const BetaEnvironmentUpdateParamsScopeAccount BetaEnvironmentUpdateParamsScope = "account"`

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

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

#### Returns

- `type BetaEnvironment`

  Unified Environment resource for both cloud and self-hosted environments.

  - `Type Environment`

    The type of object (always 'environment')

    default: environment

  - `ID string`

    Environment identifier (e.g., 'env_...')

  - `ArchivedAt string`

    RFC 3339 timestamp when environment was archived, or null if not archived

  - `Config BetaEnvironmentConfigUnion`

    Environment configuration (either Anthropic Cloud or self-hosted)

    - `type BetaCloudConfig`

      `cloud` environment configuration.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigNetworkingUnion`

        Network configuration policy.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetwork`

          Limited network access.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.

          - `AllowPackageManagers bool`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.

          - `AllowedHosts []string`

            Specifies domains the container can reach.

      - `Packages BetaPackages`

        Package manager configuration.

        - `Type BetaPackagesType Optional`

          Package configuration type

          default: packages

        - `Apt []string`

          Ubuntu/Debian packages to install

        - `Cargo []string`

          Rust packages to install

        - `Gem []string`

          Ruby packages to install

        - `Go []string`

          Go packages to install

        - `Npm []string`

          Node.js packages to install

        - `Pip []string`

          Python packages to install

    - `type BetaSelfHostedConfig`

      Configuration for self-hosted environments.

      - `Type SelfHosted`

        Environment type

  - `CreatedAt string`

    RFC 3339 timestamp when environment was created

  - `Description string`

    User-provided description for the environment; null when unset

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs

  - `Name string`

    Human-readable name for the environment

  - `UpdatedAt string`

    RFC 3339 timestamp when environment was last updated

  - `Scope BetaEnvironmentScope Optional`

    The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

    - `const BetaEnvironmentScopeOrganization BetaEnvironmentScope = "organization"`

    - `const BetaEnvironmentScopeAccount BetaEnvironmentScope = "account"`

#### 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"),
	)
	betaEnvironment, err := client.Beta.Environments.Update(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaEnvironment.ID)
}
```

##### Response (200)

```json
{
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "archived_at": null,
  "config": {
    "networking": {
      "allow_mcp_servers": false,
      "allow_package_managers": true,
      "allowed_hosts": [
        "api.example.com"
      ],
      "type": "limited"
    },
    "packages": {
      "apt": [
        "string"
      ],
      "cargo": [
        "string"
      ],
      "gem": [
        "string"
      ],
      "go": [
        "string"
      ],
      "npm": [
        "string"
      ],
      "pip": [
        "pandas",
        "numpy"
      ],
      "type": "packages"
    },
    "type": "cloud"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Python environment with data-analysis packages.",
  "metadata": {},
  "name": "python-data-analysis",
  "type": "environment",
  "updated_at": "2026-03-15T10:00:00Z",
  "scope": "organization"
}
```

### Delete Environment

`client.Beta.Environments.Delete(ctx, environmentID, body) (*BetaEnvironmentDeleteResponse, error)`

**DELETE** `/v1/environments/{environment_id}`

Delete an environment by ID. Returns a confirmation of the deletion.

#### Parameters

- `environmentID string` (path parameter)

- `body BetaEnvironmentDeleteParams`

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

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

#### Returns

- `type BetaEnvironmentDeleteResponse`

  Response after deleting an environment.

  - `Type BetaEnvironmentDeleteResponseType`

    The type of response

    default: environment_deleted

  - `ID string`

    Environment identifier

#### 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"),
	)
	betaEnvironmentDeleteResponse, err := client.Beta.Environments.Delete(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaEnvironmentDeleteResponse.ID)
}
```

##### Response (200)

```json
{
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "type": "environment_deleted"
}
```

### Archive Environment

`client.Beta.Environments.Archive(ctx, environmentID, body) (*BetaEnvironment, error)`

**POST** `/v1/environments/{environment_id}/archive`

Archive an environment by ID. Archived environments cannot be used to create new sessions.

#### Parameters

- `environmentID string` (path parameter)

- `body BetaEnvironmentArchiveParams`

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

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

#### Returns

- `type BetaEnvironment`

  Unified Environment resource for both cloud and self-hosted environments.

  - `Type Environment`

    The type of object (always 'environment')

    default: environment

  - `ID string`

    Environment identifier (e.g., 'env_...')

  - `ArchivedAt string`

    RFC 3339 timestamp when environment was archived, or null if not archived

  - `Config BetaEnvironmentConfigUnion`

    Environment configuration (either Anthropic Cloud or self-hosted)

    - `type BetaCloudConfig`

      `cloud` environment configuration.

      - `Type Cloud`

        Environment type

      - `Networking BetaCloudConfigNetworkingUnion`

        Network configuration policy.

        - `type BetaUnrestrictedNetwork`

          Unrestricted network access.

          - `Type Unrestricted`

            Network policy type

        - `type BetaLimitedNetwork`

          Limited network access.

          - `Type Limited`

            Network policy type

          - `AllowMCPServers bool`

            Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the `allowed_hosts` array.

          - `AllowPackageManagers bool`

            Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the `allowed_hosts` array.

          - `AllowedHosts []string`

            Specifies domains the container can reach.

      - `Packages BetaPackages`

        Package manager configuration.

        - `Type BetaPackagesType Optional`

          Package configuration type

          default: packages

        - `Apt []string`

          Ubuntu/Debian packages to install

        - `Cargo []string`

          Rust packages to install

        - `Gem []string`

          Ruby packages to install

        - `Go []string`

          Go packages to install

        - `Npm []string`

          Node.js packages to install

        - `Pip []string`

          Python packages to install

    - `type BetaSelfHostedConfig`

      Configuration for self-hosted environments.

      - `Type SelfHosted`

        Environment type

  - `CreatedAt string`

    RFC 3339 timestamp when environment was created

  - `Description string`

    User-provided description for the environment; null when unset

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs

  - `Name string`

    Human-readable name for the environment

  - `UpdatedAt string`

    RFC 3339 timestamp when environment was last updated

  - `Scope BetaEnvironmentScope Optional`

    The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

    - `const BetaEnvironmentScopeOrganization BetaEnvironmentScope = "organization"`

    - `const BetaEnvironmentScopeAccount BetaEnvironmentScope = "account"`

#### 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"),
	)
	betaEnvironment, err := client.Beta.Environments.Archive(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaEnvironment.ID)
}
```

##### Response (200)

```json
{
  "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "archived_at": null,
  "config": {
    "networking": {
      "allow_mcp_servers": false,
      "allow_package_managers": true,
      "allowed_hosts": [
        "api.example.com"
      ],
      "type": "limited"
    },
    "packages": {
      "apt": [
        "string"
      ],
      "cargo": [
        "string"
      ],
      "gem": [
        "string"
      ],
      "go": [
        "string"
      ],
      "npm": [
        "string"
      ],
      "pip": [
        "pandas",
        "numpy"
      ],
      "type": "packages"
    },
    "type": "cloud"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Python environment with data-analysis packages.",
  "metadata": {},
  "name": "python-data-analysis",
  "type": "environment",
  "updated_at": "2026-03-15T10:00:00Z",
  "scope": "organization"
}
```

## Beta › Environments › Work

### Get Work Item

`client.Beta.Environments.Work.Get(ctx, workID, params) (*BetaSelfHostedWork, error)`

**GET** `/v1/environments/{environment_id}/work/{work_id}`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Retrieve detailed information about a specific work item.

#### Parameters

- `workID string` (path parameter)

- `params BetaEnvironmentWorkGetParams`

  - `EnvironmentID string` (path parameter)

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

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

#### Returns

- `type BetaSelfHostedWork`

  Work resource representing a unit of work in a self-hosted environment.

  Work items are queued when sessions are created or when long-dormant sessions
  receive new messages. The environment worker polls for work to execute in a
  self-hosted sandbox.

  - `Type Work`

    The type of object (always 'work')

    default: work

  - `ID string`

    Work identifier (e.g., 'work_...')

  - `AcknowledgedAt string`

    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox

  - `CreatedAt string`

    RFC 3339 timestamp when work was created

  - `Data BetaSessionWorkData`

    The actual work to be performed

    - `Type Session`

      Type of work data

    - `ID string`

      Session identifier (e.g., 'session_...')

  - `EnvironmentID string`

    Environment identifier this work belongs to (e.g., `env_...`)

  - `LatestHeartbeatAt string`

    RFC 3339 timestamp of the most recent heartbeat

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs associated with this work item

  - `Secret string`

    Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.

  - `StartedAt string`

    RFC 3339 timestamp when work execution started

  - `State BetaSelfHostedWorkState`

    Current state of the work item

    - `const BetaSelfHostedWorkStateQueued BetaSelfHostedWorkState = "queued"`

    - `const BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"`

    - `const BetaSelfHostedWorkStateActive BetaSelfHostedWorkState = "active"`

    - `const BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"`

    - `const BetaSelfHostedWorkStateStopped BetaSelfHostedWorkState = "stopped"`

  - `StopRequestedAt string`

    RFC 3339 timestamp when stop was requested

  - `StoppedAt string`

    RFC 3339 timestamp when work execution stopped

#### 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"),
	)
	betaSelfHostedWork, err := client.Beta.Environments.Work.Get(
		context.TODO(),
		"work_id",
		anthropic.BetaEnvironmentWorkGetParams{
			EnvironmentID: "env_011CZkZ9X2dpNyB7HsEFoRfW",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWork.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "acknowledged_at": "acknowledged_at",
  "created_at": "created_at",
  "data": {
    "id": "id",
    "type": "session"
  },
  "environment_id": "environment_id",
  "latest_heartbeat_at": "latest_heartbeat_at",
  "metadata": {
    "foo": "string"
  },
  "secret": "secret",
  "started_at": "started_at",
  "state": "queued",
  "stop_requested_at": "stop_requested_at",
  "stopped_at": "stopped_at",
  "type": "work"
}
```

### Poll for Work

`client.Beta.Environments.Work.Poll(ctx, environmentID, params) (*BetaSelfHostedWork, error)`

**GET** `/v1/environments/{environment_id}/work/poll`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Long poll for work items in the queue.

#### Parameters

- `environmentID string` (path parameter)

- `params BetaEnvironmentWorkPollParams`

  - `BlockMs param.Opt[int64] Optional` (query parameter)

    How long to wait for work to arrive before returning. Must be 1-999 in milliseconds. Defaults to non-blocking (returns immediately if no work is available).

    minimum: 1

  - `ReclaimOlderThanMs param.Opt[int64] Optional` (query parameter)

    Reclaim unacknowledged work items older than this many milliseconds. If omitted, uses the default (5000ms).

    minimum: 1

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

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

    Unique identifier for the specific worker polling, used to track aggregated environment-level work metrics in Console

#### Returns

- `type BetaSelfHostedWork`

  Work resource representing a unit of work in a self-hosted environment.

  Work items are queued when sessions are created or when long-dormant sessions
  receive new messages. The environment worker polls for work to execute in a
  self-hosted sandbox.

  - `Type Work`

    The type of object (always 'work')

    default: work

  - `ID string`

    Work identifier (e.g., 'work_...')

  - `AcknowledgedAt string`

    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox

  - `CreatedAt string`

    RFC 3339 timestamp when work was created

  - `Data BetaSessionWorkData`

    The actual work to be performed

    - `Type Session`

      Type of work data

    - `ID string`

      Session identifier (e.g., 'session_...')

  - `EnvironmentID string`

    Environment identifier this work belongs to (e.g., `env_...`)

  - `LatestHeartbeatAt string`

    RFC 3339 timestamp of the most recent heartbeat

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs associated with this work item

  - `Secret string`

    Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.

  - `StartedAt string`

    RFC 3339 timestamp when work execution started

  - `State BetaSelfHostedWorkState`

    Current state of the work item

    - `const BetaSelfHostedWorkStateQueued BetaSelfHostedWorkState = "queued"`

    - `const BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"`

    - `const BetaSelfHostedWorkStateActive BetaSelfHostedWorkState = "active"`

    - `const BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"`

    - `const BetaSelfHostedWorkStateStopped BetaSelfHostedWorkState = "stopped"`

  - `StopRequestedAt string`

    RFC 3339 timestamp when stop was requested

  - `StoppedAt string`

    RFC 3339 timestamp when work execution stopped

#### 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"),
	)
	betaSelfHostedWork, err := client.Beta.Environments.Work.Poll(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentWorkPollParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWork.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "acknowledged_at": "acknowledged_at",
  "created_at": "created_at",
  "data": {
    "id": "id",
    "type": "session"
  },
  "environment_id": "environment_id",
  "latest_heartbeat_at": "latest_heartbeat_at",
  "metadata": {
    "foo": "string"
  },
  "secret": "secret",
  "started_at": "started_at",
  "state": "queued",
  "stop_requested_at": "stop_requested_at",
  "stopped_at": "stopped_at",
  "type": "work"
}
```

### Acknowledge Work

`client.Beta.Environments.Work.Ack(ctx, workID, params) (*BetaSelfHostedWork, error)`

**POST** `/v1/environments/{environment_id}/work/{work_id}/ack`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' and removing it from the queue.

#### Parameters

- `workID string` (path parameter)

- `params BetaEnvironmentWorkAckParams`

  - `EnvironmentID string` (path parameter)

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

#### Returns

- `type BetaSelfHostedWork`

  Work resource representing a unit of work in a self-hosted environment.

  Work items are queued when sessions are created or when long-dormant sessions
  receive new messages. The environment worker polls for work to execute in a
  self-hosted sandbox.

  - `Type Work`

    The type of object (always 'work')

    default: work

  - `ID string`

    Work identifier (e.g., 'work_...')

  - `AcknowledgedAt string`

    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox

  - `CreatedAt string`

    RFC 3339 timestamp when work was created

  - `Data BetaSessionWorkData`

    The actual work to be performed

    - `Type Session`

      Type of work data

    - `ID string`

      Session identifier (e.g., 'session_...')

  - `EnvironmentID string`

    Environment identifier this work belongs to (e.g., `env_...`)

  - `LatestHeartbeatAt string`

    RFC 3339 timestamp of the most recent heartbeat

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs associated with this work item

  - `Secret string`

    Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.

  - `StartedAt string`

    RFC 3339 timestamp when work execution started

  - `State BetaSelfHostedWorkState`

    Current state of the work item

    - `const BetaSelfHostedWorkStateQueued BetaSelfHostedWorkState = "queued"`

    - `const BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"`

    - `const BetaSelfHostedWorkStateActive BetaSelfHostedWorkState = "active"`

    - `const BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"`

    - `const BetaSelfHostedWorkStateStopped BetaSelfHostedWorkState = "stopped"`

  - `StopRequestedAt string`

    RFC 3339 timestamp when stop was requested

  - `StoppedAt string`

    RFC 3339 timestamp when work execution stopped

#### 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"),
	)
	betaSelfHostedWork, err := client.Beta.Environments.Work.Ack(
		context.TODO(),
		"work_id",
		anthropic.BetaEnvironmentWorkAckParams{
			EnvironmentID: "env_011CZkZ9X2dpNyB7HsEFoRfW",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWork.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "acknowledged_at": "acknowledged_at",
  "created_at": "created_at",
  "data": {
    "id": "id",
    "type": "session"
  },
  "environment_id": "environment_id",
  "latest_heartbeat_at": "latest_heartbeat_at",
  "metadata": {
    "foo": "string"
  },
  "secret": "secret",
  "started_at": "started_at",
  "state": "queued",
  "stop_requested_at": "stop_requested_at",
  "stopped_at": "stopped_at",
  "type": "work"
}
```

### Record Heartbeat

`client.Beta.Environments.Work.Heartbeat(ctx, workID, params) (*BetaSelfHostedWorkHeartbeatResponse, error)`

**POST** `/v1/environments/{environment_id}/work/{work_id}/heartbeat`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Record a heartbeat for a work item to maintain the lease.

#### Parameters

- `workID string` (path parameter)

- `params BetaEnvironmentWorkHeartbeatParams`

  - `EnvironmentID string` (path parameter)

  - `DesiredTTLSeconds param.Opt[int64] Optional` (query parameter)

    Desired TTL in seconds

  - `ExpectedLastHeartbeat param.Opt[string] Optional` (query parameter)

    Expected last_heartbeat for conditional update (optimistic concurrency). Use literal 'NO_HEARTBEAT' to claim an unclaimed lease (first heartbeat). For subsequent heartbeats, echo the server's previous last_heartbeat value exactly. Returns 412 Precondition Failed if the actual value doesn't match.

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

#### Returns

- `type BetaSelfHostedWorkHeartbeatResponse`

  Response after recording a heartbeat for a work item.

  - `Type WorkHeartbeat`

    The type of response

    default: work_heartbeat

  - `LastHeartbeat string`

    RFC 3339 timestamp of the actual heartbeat from DB

  - `LeaseExtended bool`

    Whether the heartbeat succeeded in extending the lease

  - `State BetaSelfHostedWorkHeartbeatResponseState`

    Current state of the work item (active/stopping/stopped)

    - `const BetaSelfHostedWorkHeartbeatResponseStateQueued BetaSelfHostedWorkHeartbeatResponseState = "queued"`

    - `const BetaSelfHostedWorkHeartbeatResponseStateStarting BetaSelfHostedWorkHeartbeatResponseState = "starting"`

    - `const BetaSelfHostedWorkHeartbeatResponseStateActive BetaSelfHostedWorkHeartbeatResponseState = "active"`

    - `const BetaSelfHostedWorkHeartbeatResponseStateStopping BetaSelfHostedWorkHeartbeatResponseState = "stopping"`

    - `const BetaSelfHostedWorkHeartbeatResponseStateStopped BetaSelfHostedWorkHeartbeatResponseState = "stopped"`

  - `TTLSeconds int64`

    Effective TTL applied to the lease

#### 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"),
	)
	betaSelfHostedWorkHeartbeatResponse, err := client.Beta.Environments.Work.Heartbeat(
		context.TODO(),
		"work_id",
		anthropic.BetaEnvironmentWorkHeartbeatParams{
			EnvironmentID: "env_011CZkZ9X2dpNyB7HsEFoRfW",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWorkHeartbeatResponse.LastHeartbeat)
}
```

##### Response (200)

```json
{
  "last_heartbeat": "last_heartbeat",
  "lease_extended": true,
  "state": "queued",
  "ttl_seconds": 0,
  "type": "work_heartbeat"
}
```

### Stop Work

`client.Beta.Environments.Work.Stop(ctx, workID, params) (*BetaSelfHostedWork, error)`

**POST** `/v1/environments/{environment_id}/work/{work_id}/stop`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Stop a work item, initiating graceful or forced shutdown.

#### Parameters

- `workID string` (path parameter)

- `params BetaEnvironmentWorkStopParams`

  - `EnvironmentID string` (path parameter)

  - `BetaSelfHostedWorkStopRequest BetaSelfHostedWorkStopRequestParam`

    Request to stop a work item.

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

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

#### Returns

- `type BetaSelfHostedWork`

  Work resource representing a unit of work in a self-hosted environment.

  Work items are queued when sessions are created or when long-dormant sessions
  receive new messages. The environment worker polls for work to execute in a
  self-hosted sandbox.

  - `Type Work`

    The type of object (always 'work')

    default: work

  - `ID string`

    Work identifier (e.g., 'work_...')

  - `AcknowledgedAt string`

    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox

  - `CreatedAt string`

    RFC 3339 timestamp when work was created

  - `Data BetaSessionWorkData`

    The actual work to be performed

    - `Type Session`

      Type of work data

    - `ID string`

      Session identifier (e.g., 'session_...')

  - `EnvironmentID string`

    Environment identifier this work belongs to (e.g., `env_...`)

  - `LatestHeartbeatAt string`

    RFC 3339 timestamp of the most recent heartbeat

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs associated with this work item

  - `Secret string`

    Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.

  - `StartedAt string`

    RFC 3339 timestamp when work execution started

  - `State BetaSelfHostedWorkState`

    Current state of the work item

    - `const BetaSelfHostedWorkStateQueued BetaSelfHostedWorkState = "queued"`

    - `const BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"`

    - `const BetaSelfHostedWorkStateActive BetaSelfHostedWorkState = "active"`

    - `const BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"`

    - `const BetaSelfHostedWorkStateStopped BetaSelfHostedWorkState = "stopped"`

  - `StopRequestedAt string`

    RFC 3339 timestamp when stop was requested

  - `StoppedAt string`

    RFC 3339 timestamp when work execution stopped

#### 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"),
	)
	betaSelfHostedWork, err := client.Beta.Environments.Work.Stop(
		context.TODO(),
		"work_id",
		anthropic.BetaEnvironmentWorkStopParams{
			EnvironmentID:                 "env_011CZkZ9X2dpNyB7HsEFoRfW",
			BetaSelfHostedWorkStopRequest: anthropic.BetaSelfHostedWorkStopRequestParam{},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWork.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "acknowledged_at": "acknowledged_at",
  "created_at": "created_at",
  "data": {
    "id": "id",
    "type": "session"
  },
  "environment_id": "environment_id",
  "latest_heartbeat_at": "latest_heartbeat_at",
  "metadata": {
    "foo": "string"
  },
  "secret": "secret",
  "started_at": "started_at",
  "state": "queued",
  "stop_requested_at": "stop_requested_at",
  "stopped_at": "stopped_at",
  "type": "work"
}
```

### List Work Items

`client.Beta.Environments.Work.List(ctx, environmentID, params) (*PageCursor[BetaSelfHostedWork], error)`

**GET** `/v1/environments/{environment_id}/work`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

List work items in an environment.

#### Parameters

- `environmentID string` (path parameter)

- `params BetaEnvironmentWorkListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of work items to return

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from previous response for pagination

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

#### Returns

- `type BetaSelfHostedWork`

  Work resource representing a unit of work in a self-hosted environment.

  Work items are queued when sessions are created or when long-dormant sessions
  receive new messages. The environment worker polls for work to execute in a
  self-hosted sandbox.

  - `Type Work`

    The type of object (always 'work')

    default: work

  - `ID string`

    Work identifier (e.g., 'work_...')

  - `AcknowledgedAt string`

    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox

  - `CreatedAt string`

    RFC 3339 timestamp when work was created

  - `Data BetaSessionWorkData`

    The actual work to be performed

    - `Type Session`

      Type of work data

    - `ID string`

      Session identifier (e.g., 'session_...')

  - `EnvironmentID string`

    Environment identifier this work belongs to (e.g., `env_...`)

  - `LatestHeartbeatAt string`

    RFC 3339 timestamp of the most recent heartbeat

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs associated with this work item

  - `Secret string`

    Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.

  - `StartedAt string`

    RFC 3339 timestamp when work execution started

  - `State BetaSelfHostedWorkState`

    Current state of the work item

    - `const BetaSelfHostedWorkStateQueued BetaSelfHostedWorkState = "queued"`

    - `const BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"`

    - `const BetaSelfHostedWorkStateActive BetaSelfHostedWorkState = "active"`

    - `const BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"`

    - `const BetaSelfHostedWorkStateStopped BetaSelfHostedWorkState = "stopped"`

  - `StopRequestedAt string`

    RFC 3339 timestamp when stop was requested

  - `StoppedAt string`

    RFC 3339 timestamp when work execution stopped

#### 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"),
	)
	page, err := client.Beta.Environments.Work.List(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentWorkListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "acknowledged_at": "acknowledged_at",
      "created_at": "created_at",
      "data": {
        "id": "id",
        "type": "session"
      },
      "environment_id": "environment_id",
      "latest_heartbeat_at": "latest_heartbeat_at",
      "metadata": {
        "foo": "string"
      },
      "secret": "secret",
      "started_at": "started_at",
      "state": "queued",
      "stop_requested_at": "stop_requested_at",
      "stopped_at": "stopped_at",
      "type": "work"
    }
  ],
  "next_page": "next_page"
}
```

### Update Work Item

`client.Beta.Environments.Work.Update(ctx, workID, params) (*BetaSelfHostedWork, error)`

**POST** `/v1/environments/{environment_id}/work/{work_id}`

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Update work item metadata with merge semantics.

#### Parameters

- `workID string` (path parameter)

- `params BetaEnvironmentWorkUpdateParams`

  - `EnvironmentID string` (path parameter)

  - `BetaSelfHostedWorkUpdateRequest BetaSelfHostedWorkUpdateRequestParam`

    Request to update work item metadata.

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

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

#### Returns

- `type BetaSelfHostedWork`

  Work resource representing a unit of work in a self-hosted environment.

  Work items are queued when sessions are created or when long-dormant sessions
  receive new messages. The environment worker polls for work to execute in a
  self-hosted sandbox.

  - `Type Work`

    The type of object (always 'work')

    default: work

  - `ID string`

    Work identifier (e.g., 'work_...')

  - `AcknowledgedAt string`

    RFC 3339 timestamp when the work item was acknowledged and assigned to a self-hosted sandbox

  - `CreatedAt string`

    RFC 3339 timestamp when work was created

  - `Data BetaSessionWorkData`

    The actual work to be performed

    - `Type Session`

      Type of work data

    - `ID string`

      Session identifier (e.g., 'session_...')

  - `EnvironmentID string`

    Environment identifier this work belongs to (e.g., `env_...`)

  - `LatestHeartbeatAt string`

    RFC 3339 timestamp of the most recent heartbeat

  - `Metadata map[string, string]`

    User-provided metadata key-value pairs associated with this work item

  - `Secret string`

    Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths.

  - `StartedAt string`

    RFC 3339 timestamp when work execution started

  - `State BetaSelfHostedWorkState`

    Current state of the work item

    - `const BetaSelfHostedWorkStateQueued BetaSelfHostedWorkState = "queued"`

    - `const BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"`

    - `const BetaSelfHostedWorkStateActive BetaSelfHostedWorkState = "active"`

    - `const BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"`

    - `const BetaSelfHostedWorkStateStopped BetaSelfHostedWorkState = "stopped"`

  - `StopRequestedAt string`

    RFC 3339 timestamp when stop was requested

  - `StoppedAt string`

    RFC 3339 timestamp when work execution stopped

#### 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"),
	)
	betaSelfHostedWork, err := client.Beta.Environments.Work.Update(
		context.TODO(),
		"work_id",
		anthropic.BetaEnvironmentWorkUpdateParams{
			EnvironmentID: "env_011CZkZ9X2dpNyB7HsEFoRfW",
			BetaSelfHostedWorkUpdateRequest: anthropic.BetaSelfHostedWorkUpdateRequestParam{
				Metadata: map[string]string{
					"foo": "string",
				},
			},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWork.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "acknowledged_at": "acknowledged_at",
  "created_at": "created_at",
  "data": {
    "id": "id",
    "type": "session"
  },
  "environment_id": "environment_id",
  "latest_heartbeat_at": "latest_heartbeat_at",
  "metadata": {
    "foo": "string"
  },
  "secret": "secret",
  "started_at": "started_at",
  "state": "queued",
  "stop_requested_at": "stop_requested_at",
  "stopped_at": "stopped_at",
  "type": "work"
}
```

### Get Queue Statistics

`client.Beta.Environments.Work.Stats(ctx, environmentID, query) (*BetaSelfHostedWorkQueueStats, error)`

**GET** `/v1/environments/{environment_id}/work/stats`

Get statistics about the work queue for an environment.

#### Parameters

- `environmentID string` (path parameter)

- `query BetaEnvironmentWorkStatsParams`

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

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

#### Returns

- `type BetaSelfHostedWorkQueueStats`

  Statistics about the work queue for an environment.

  Uses Redis Stream consumer group metrics for O(1) queries.

  - `Type WorkQueueStats`

    The type of object

    default: work_queue_stats

  - `Depth int64`

    Number of work items waiting to be picked up (lag from consumer group)

  - `OldestQueuedAt string`

    RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty

  - `Pending int64`

    Number of work items being processed (polled but not acknowledged)

    default: 0

  - `WorkersPolling int64`

    Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests.

#### 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"),
	)
	betaSelfHostedWorkQueueStats, err := client.Beta.Environments.Work.Stats(
		context.TODO(),
		"env_011CZkZ9X2dpNyB7HsEFoRfW",
		anthropic.BetaEnvironmentWorkStatsParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSelfHostedWorkQueueStats.Depth)
}
```

##### Response (200)

```json
{
  "depth": 0,
  "oldest_queued_at": "oldest_queued_at",
  "pending": 0,
  "type": "work_queue_stats",
  "workers_polling": 0
}
```

## Beta › Sessions

### Create Session

`client.Beta.Sessions.New(ctx, params) (*BetaManagedAgentsSession, error)`

**POST** `/v1/sessions`

Create Session

#### Parameters

- `params BetaSessionNewParams`

  - `Agent BetaSessionNewParamsAgentUnion`

    Agent identifier. Accepts the `agent` ID string, which pins the latest version for the session, or an `agent` object with both id and version specified.

    - `string`

    - `type BetaManagedAgentsAgentParams`

      Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version

      - `Type BetaManagedAgentsAgentParamsType`

      - `ID string`

        The `agent` ID.

        minLength: 1, maxLength: 128

      - `Version int64 Optional`

        The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.

        format: int32

    - `type BetaManagedAgentsAgentWithOverridesParams`

      Reference to an `agent` plus optional configuration overrides. Each provided field replaces the agent's value for the caller's use; the agent resource is unchanged.

      - `Type BetaManagedAgentsAgentWithOverridesParamsType`

      - `ID string`

        The `agent` ID.

        minLength: 1, maxLength: 128

      - `MCPServers []BetaManagedAgentsURLMCPServerParams Optional`

        Replacement MCP server list. Full replacement: the provided array becomes the MCP servers. Send an empty array to clear; omit to preserve the agent's servers.

        - `Type BetaManagedAgentsURLMCPServerParamsType`

        - `Name string`

          Unique name for this server, referenced by mcp_toolset configurations. 1-255 characters.

          minLength: 1, maxLength: 255

        - `URL string`

          Endpoint URL for the MCP server.

          maxLength: 2048

      - `Model BetaManagedAgentsModelConfigParams Optional`

        Replacement model. Accepts the model string, e.g. `claude-opus-5-5`, or a `model_config` object. Omit to use the agent's model.

        - `type BetaManagedAgentsModelConfigParams`

          An object that defines additional configuration control over model use

          - `ID BetaManagedAgentsModel`

            The model that will power your agent.

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

            - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

              Fastest model for high-volume, real-time tasks

            - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

              Efficient model for coding and agents

            - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

            - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

            - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

              Efficient model for coding and agents

            - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

            - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

              Powerful intelligence for long-running agents and coding

            - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

              Powerful intelligence for long-running agents and coding

            - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

              Powerful intelligence for long-running agents and coding

            - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

              Powerful intelligence for long-running agents and coding

            - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

              Best combination of speed and intelligence

            - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

            - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

            - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

              Powerful intelligence for long-running agents and coding

            - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

              Powerful intelligence for long-running agents and coding

            - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

          - `Effort BetaManagedAgentsModelConfigParamsEffortUnion Optional`

            How hard Claude works on each inference call. Accepts a bare level string (`"high"`) or `{"type": "high"}`. On create, omitting it resolves the per-model default; on update, omitting it leaves the stored value unchanged.

            - `type BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel string`

              How hard Claude works on each turn. Higher levels favor reasoning depth over latency. Not all models accept every level; invalid combinations are rejected at create time.

              - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelLow BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "low"`

                Low effort. Favors latency over reasoning depth.

              - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMedium BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "medium"`

                Medium effort. Balances latency and reasoning depth.

              - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelHigh BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "high"`

                High effort. Favors reasoning depth.

              - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelXhigh BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "xhigh"`

                Extra-high effort. Not all models accept this level.

              - `const BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMax BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "max"`

                Maximum effort. Favors reasoning depth over latency.

            - `type BetaManagedAgentsEffortLow`

              Low effort. Favors latency over reasoning depth.

              - `Type BetaManagedAgentsEffortLowType`

            - `type BetaManagedAgentsEffortMedium`

              Medium effort. Balances latency and reasoning depth.

              - `Type BetaManagedAgentsEffortMediumType`

            - `type BetaManagedAgentsEffortHigh`

              High effort. Favors reasoning depth.

              - `Type BetaManagedAgentsEffortHighType`

            - `type BetaManagedAgentsEffortXhigh`

              Extra-high effort. Not all models accept this level.

              - `Type BetaManagedAgentsEffortXhighType`

            - `type BetaManagedAgentsEffortMax`

              Maximum effort. Favors reasoning depth over latency.

              - `Type BetaManagedAgentsEffortMaxType`

          - `InferenceGeo string Optional`

            Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. On update, `model` is whole-object replacement — omitting inference_geo clears it.

          - `Speed BetaManagedAgentsModelConfigParamsSpeed Optional`

            Inference speed mode. Defaults to `standard`.

            - `const BetaManagedAgentsModelConfigParamsSpeedStandard BetaManagedAgentsModelConfigParamsSpeed = "standard"`

            - `const BetaManagedAgentsModelConfigParamsSpeedFast BetaManagedAgentsModelConfigParamsSpeed = "fast"`

      - `Skills []BetaManagedAgentsSkillParamsUnion Optional`

        Replacement skill list. Full replacement: the provided array becomes the skills. Send an empty array to clear; omit to preserve the agent's skills.

        - `type BetaManagedAgentsAnthropicSkillParams`

          An Anthropic-managed skill.

          - `Type BetaManagedAgentsAnthropicSkillParamsType`

          - `SkillID string`

            Identifier of the Anthropic skill (e.g., "xlsx").

            minLength: 1, maxLength: 64

          - `Version string Optional`

            Version to pin. Defaults to latest if omitted.

            minLength: 1, maxLength: 64

        - `type BetaManagedAgentsCustomSkillParams`

          A user-created custom skill.

          - `Type BetaManagedAgentsCustomSkillParamsType`

          - `SkillID string`

            Tagged ID of the custom skill (e.g., "skill_01XJ5...").

            minLength: 1, maxLength: 64

          - `Version string Optional`

            Version to pin. Defaults to latest if omitted.

            minLength: 1, maxLength: 64

      - `System string Optional`

        Replacement system prompt. Up to 100,000 characters. Set to null to clear the agent's system prompt; omit to preserve it.

        maxLength: 100000

      - `Tools []BetaManagedAgentsAgentWithOverridesParamsToolUnion Optional`

        Replacement tool list. Full replacement: the provided array becomes the tool configuration. Send an empty array to clear; omit to preserve the agent's tools.

        - `type BetaManagedAgentsAgentToolset20260401Params`

          Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.

          - `Type BetaManagedAgentsAgentToolset20260401ParamsType`

          - `Configs []BetaManagedAgentsAgentToolConfigParamsUnion Optional`

            Per-tool configuration overrides.

            - `type BetaManagedAgentsBashToolConfigParams`

              Configuration override for the bash tool.

              - `Type BetaManagedAgentsBashToolConfigParamsType Optional`

              - `Name Bash`

                Must be "bash".

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsBashToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                  - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                  - `Type BetaManagedAgentsAlwaysAskPolicyType`

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `Type Auto`

            - `type BetaManagedAgentsEditToolConfigParams`

              Configuration override for the edit tool.

              - `Type BetaManagedAgentsEditToolConfigParamsType Optional`

              - `Name Edit`

                Must be "edit".

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsEditToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsReadToolConfigParams`

              Configuration override for the read tool.

              - `Type BetaManagedAgentsReadToolConfigParamsType Optional`

              - `Name Read`

                Must be "read".

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsReadToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWriteToolConfigParams`

              Configuration override for the write tool.

              - `Type BetaManagedAgentsWriteToolConfigParamsType Optional`

              - `Name Write`

                Must be "write".

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsWriteToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGlobToolConfigParams`

              Configuration override for the glob tool.

              - `Type BetaManagedAgentsGlobToolConfigParamsType Optional`

              - `Name Glob`

                Must be "glob".

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsGlobToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGrepToolConfigParams`

              Configuration override for the grep tool.

              - `Type BetaManagedAgentsGrepToolConfigParamsType Optional`

              - `Name Grep`

                Must be "grep".

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsGrepToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWebFetchToolConfigParams`

              Configuration override for the web_fetch tool.

              - `Type BetaManagedAgentsWebFetchToolConfigParamsType Optional`

              - `Name WebFetch`

                Must be "web_fetch".

              - `AllowedDomains []string Optional`

                Only fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.

              - `BlockedDomains []string Optional`

                Never fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `MaxContentTokens int64 Optional`

                Maximum number of tokens of fetched text content to include in context per call. Does not apply to binary content such as PDFs.

                format: int32

              - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `URLSources BetaManagedAgentsWebFetchURLSourcesParams Optional`

                Which sources contribute URLs the tool may fetch. Omit to allow every source.

                - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion Optional`

                  Which custom tools' results contribute URLs that may be fetched: "all" (the default), "none", or an only or except list. Each name in a list must be a custom tool in the same tools array.

                  - `type BetaManagedAgentsWebFetchURLSourceShorthand string`

                    String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

                    - `const BetaManagedAgentsWebFetchURLSourceShorthandAll BetaManagedAgentsWebFetchURLSourceShorthand = "all"`

                    - `const BetaManagedAgentsWebFetchURLSourceShorthandNone BetaManagedAgentsWebFetchURLSourceShorthand = "none"`

                  - `type BetaManagedAgentsWebFetchURLSourceToolFilterUnion interface{…}`

                    Which tools' results contribute URLs that may be fetched.

                    - `type BetaManagedAgentsWebFetchURLSourceAll`

                      Every URL from this source may be fetched. This is the default.

                      - `Type All`

                    - `type BetaManagedAgentsWebFetchURLSourceNone`

                      This source contributes no URLs that may be fetched.

                      - `Type None`

                    - `type BetaManagedAgentsWebFetchURLSourceOnly`

                      Only the named tools' results contribute URLs that may be fetched.

                      - `Type Only`

                      - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                        The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                        - `Type ToolReference`

                          Must be "tool_reference".

                        - `Name string`

                          Name of the tool. Compared exactly, so upper and lower case letters are different.

                          minLength: 1, maxLength: 128

                    - `type BetaManagedAgentsWebFetchURLSourceExcept`

                      Every tool's results contribute URLs that may be fetched, except the named tools' results.

                      - `Type Except`

                      - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                        The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                        - `Type ToolReference`

                          Must be "tool_reference".

                        - `Name string`

                          Name of the tool. Compared exactly, so upper and lower case letters are different.

                          minLength: 1, maxLength: 128

                - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterParamsUnion Optional`

                  Which of the web_search and web_fetch tools' results contribute URLs that may be fetched: "all" (the default), "none", or an only or except list. Each name in a list must be "web_search" or "web_fetch".

                - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputParamsUnion Optional`

                  Whether URLs in the text of user messages may be fetched: "all" (the default) or "none".

                  - `type BetaManagedAgentsWebFetchURLSourceShorthand string`

                    String form of a url_sources value that has no field other than its type: "all" means {"type": "all"} and "none" means {"type": "none"}.

                  - `type BetaManagedAgentsWebFetchURLSourceUserInputUnion interface{…}`

                    Whether URLs in the text of user messages may be fetched.

                    - `type BetaManagedAgentsWebFetchURLSourceAll`

                      Every URL from this source may be fetched. This is the default.

                    - `type BetaManagedAgentsWebFetchURLSourceNone`

                      This source contributes no URLs that may be fetched.

            - `type BetaManagedAgentsWebSearchToolConfigParams`

              Configuration override for the web_search tool.

              - `Type BetaManagedAgentsWebSearchToolConfigParamsType Optional`

              - `Name WebSearch`

                Must be "web_search".

              - `AllowedDomains []string Optional`

                Only return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains.

              - `BlockedDomains []string Optional`

                Never return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains.

              - `Enabled bool Optional`

                Whether this tool is enabled and available to Claude. Overrides the default_config setting.

              - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigParamsPermissionPolicyUnion Optional`

                Permission policy for this tool. Controls whether tool calls are auto-approved or require confirmation.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `UserLocation BetaManagedAgentsUserLocationParam Optional`

                Approximate user location for search result localization.

                - `Type Approximate`

                  Location precision. Only "approximate" is supported.

                - `City string Optional`

                  City name.

                  minLength: 1, maxLength: 255

                - `Country string Optional`

                  Two-letter ISO 3166-1 country code, uppercase.

                - `Region string Optional`

                  Region or state name.

                  minLength: 1, maxLength: 255

                - `Timezone string Optional`

                  IANA timezone identifier, e.g. "America/Los_Angeles".

                  minLength: 1, maxLength: 255

          - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfigParams Optional`

            Default configuration applied to all tools in this set.

            - `Enabled bool Optional`

              Whether tools are enabled and available to Claude by default. Defaults to true if not specified.

            - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion Optional`

              Default permission policy for tools. Controls whether tool calls are auto-approved or require confirmation.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsMCPToolsetParams`

          Configuration for tools from an MCP server defined in `mcp_servers`.

          - `Type BetaManagedAgentsMCPToolsetParamsType`

          - `MCPServerName string`

            Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters.

            minLength: 1, maxLength: 255

          - `Configs []BetaManagedAgentsMCPToolConfigParams Optional`

            Per-tool configuration overrides.

            - `Name string`

              Name of the MCP tool to configure. 1-128 characters.

              minLength: 1, maxLength: 128

            - `Enabled bool Optional`

              Whether this tool is enabled. Overrides the `default_config` setting.

            - `PermissionPolicy BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion Optional`

              Permission policy for this tool. Overrides the `default_config` setting.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfigParams Optional`

            Default configuration for all tools from this server.

            - `Enabled bool Optional`

              Whether tools are enabled by default. Defaults to true if not specified.

            - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion Optional`

              Default permission policy for tools from this server.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsCustomToolParams`

          A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.

          - `Type BetaManagedAgentsCustomToolParamsType`

          - `Description string`

            Description of what the tool does, shown to the agent to help it decide when to use the tool.

            minLength: 1

          - `InputSchema BetaManagedAgentsCustomToolInputSchemaParam`

            JSON Schema defining the expected input parameters for the tool.

            - `Type Object`

            - `Properties map[string, any] Optional`

            - `Required []string Optional`

          - `Name string`

            Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens.

            minLength: 1, maxLength: 128

      - `Version int64 Optional`

        The specific `agent` version to use. Omit to use the latest version.

        format: int32

  - `EnvironmentID string`

    ID of the `environment` defining the container configuration for this session.

    minLength: 1, maxLength: 128

  - `Budget BetaManagedAgentsBudgetLimitParam Optional`

    Enforced spend ceiling for the session. Omit to create an uncapped session. Every model the session can run — the agent's model and each callable agent's model — must have a public list price, or the request is rejected with reason `model_not_budgetable`.

  - `InitialEvents []BetaSessionNewParamsInitialEventUnion Optional`

    Initial events to send to the `session` at creation, processed in order. Supports `user.message` and `user.define_outcome` events. Maximum 50 events.

    - `type BetaManagedAgentsUserMessageEventParams`

      Parameters for sending a user message to the session.

      - `Type BetaManagedAgentsUserMessageEventParamsType`

      - `Content []BetaManagedAgentsUserMessageEventParamsContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsUserDefineOutcomeEventParams`

      Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsUserDefineOutcomeEventParamsType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubricParams`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricParamsType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubricParams`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricParamsType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

            maxLength: 262144

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

  - `Metadata map[string, string] Optional`

    Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `Resources []BetaSessionNewParamsResourceUnion Optional`

    Resources (e.g. repositories, files) to mount into the session's container.

    - `type BetaManagedAgentsGitHubRepositoryResourceParams`

      Mount a GitHub repository into the session's container.

      - `Type BetaManagedAgentsGitHubRepositoryResourceParamsType`

      - `URL string`

        Github URL of the repository

        minLength: 1, maxLength: 2048

      - `AuthorizationToken string Optional`

        GitHub authorization token used to clone the repository. Required for private repositories; optional for public ones.

        minLength: 1, maxLength: 4096

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

        minLength: 1, maxLength: 4096

    - `type BetaManagedAgentsFileResourceParams`

      Mount a file uploaded via the Files API into the session.

      - `Type BetaManagedAgentsFileResourceParamsType`

      - `FileID string`

        ID of a previously uploaded file.

        minLength: 1, maxLength: 128

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

        minLength: 1, maxLength: 4096

    - `type BetaManagedAgentsMemoryStoreResourceParam`

      Parameters for attaching a memory store to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceParamType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceParamAccess Optional`

        Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceParamAccessReadWrite BetaManagedAgentsMemoryStoreResourceParamAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceParamAccessReadOnly BetaManagedAgentsMemoryStoreResourceParamAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

  - `Title param.Opt[string] Optional`

    Human-readable session title.

    maxLength: 500

  - `VaultIDs []string Optional`

    Vault IDs for stored credentials the agent can use during the session.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSession`

  A Managed Agents `session`.

  - `Type BetaManagedAgentsSessionType`

  - `ID string`

  - `Agent BetaManagedAgentsSessionAgent`

    Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.

    - `Type BetaManagedAgentsSessionAgentType`

    - `ID string`

    - `Description string`

    - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

      Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

      - `type BetaManagedAgentsAWSRoleExecutionIdentity`

        An AWS IAM role principal as returned in API responses.

        - `Type AWSRole`

        - `RoleARN string`

          The IAM role's ARN.

      - `type BetaManagedAgentsServiceAccountExecutionIdentity`

        The Anthropic-managed service account as returned in API responses.

        - `Type ServiceAccount`

    - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

      - `Type BetaManagedAgentsMCPServerURLDefinitionType`

      - `Name string`

      - `URL string`

    - `Model BetaManagedAgentsModelConfig`

      Model identifier and configuration.

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

        How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

      - `Speed BetaManagedAgentsModelConfigSpeed Optional`

        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

        - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

    - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

      Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

      - `type BetaManagedAgentsSessionMultiagentCoordinator`

        Resolved coordinator topology with full agent definitions for each roster member.

        - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

        - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

          Full `agent` definitions the coordinator may spawn as session threads.

          - `type BetaManagedAgentsSessionThreadAgent`

            Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

            - `Type BetaManagedAgentsSessionThreadAgentType`

            - `ID string`

            - `Description string`

            - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

              Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

            - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Type BetaManagedAgentsMCPServerURLDefinitionType`

              - `Name string`

              - `URL string`

            - `Model BetaManagedAgentsModelConfig`

              Model identifier and configuration.

            - `Name string`

            - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `type BetaManagedAgentsAnthropicSkill`

                A resolved Anthropic-managed skill.

                - `Type BetaManagedAgentsAnthropicSkillType`

                - `SkillID string`

                - `Version string`

              - `type BetaManagedAgentsCustomSkill`

                A resolved user-created custom skill.

                - `Type BetaManagedAgentsCustomSkillType`

                - `SkillID string`

                - `Version string`

            - `System string`

            - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `type BetaManagedAgentsAgentToolset20260401`

                - `Type BetaManagedAgentsAgentToolset20260401Type`

                - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                  - `type BetaManagedAgentsBashToolConfig`

                    Configuration for the bash tool.

                    - `Type Bash`

                    - `Enabled bool`

                    - `Name Bash`

                    - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                        - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                        - `Type BetaManagedAgentsAlwaysAskPolicyType`

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                        - `Type Auto`

                  - `type BetaManagedAgentsEditToolConfig`

                    Configuration for the edit tool.

                    - `Type Edit`

                    - `Enabled bool`

                    - `Name Edit`

                    - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsReadToolConfig`

                    Configuration for the read tool.

                    - `Type Read`

                    - `Enabled bool`

                    - `Name Read`

                    - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWriteToolConfig`

                    Configuration for the write tool.

                    - `Type Write`

                    - `Enabled bool`

                    - `Name Write`

                    - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGlobToolConfig`

                    Configuration for the glob tool.

                    - `Type Glob`

                    - `Enabled bool`

                    - `Name Glob`

                    - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGrepToolConfig`

                    Configuration for the grep tool.

                    - `Type Grep`

                    - `Enabled bool`

                    - `Name Grep`

                    - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWebFetchToolConfig`

                    Configuration for the web_fetch tool.

                    - `Type WebFetch`

                    - `Enabled bool`

                    - `Name WebFetch`

                    - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `URLSources BetaManagedAgentsWebFetchURLSources`

                      Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                      - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                          - `Type All`

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                          - `Type None`

                        - `type BetaManagedAgentsWebFetchURLSourceOnly`

                          Only the named tools' results contribute URLs that may be fetched.

                          - `Type Only`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                        - `type BetaManagedAgentsWebFetchURLSourceExcept`

                          Every tool's results contribute URLs that may be fetched, except the named tools' results.

                          - `Type Except`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                      - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                      - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                        Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `MaxContentTokens int64 Optional`

                      format: int32

                  - `type BetaManagedAgentsWebSearchToolConfig`

                    Configuration for the web_search tool.

                    - `Type WebSearch`

                    - `Enabled bool`

                    - `Name WebSearch`

                    - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `UserLocation BetaManagedAgentsUserLocation Optional`

                      Approximate user location for search result localization.

                      - `Type Approximate`

                        Location precision. Only "approximate" is supported.

                      - `City string Optional`

                        City name.

                        minLength: 1, maxLength: 255

                      - `Country string Optional`

                        Two-letter ISO 3166-1 country code, uppercase.

                      - `Region string Optional`

                        Region or state name.

                        minLength: 1, maxLength: 255

                      - `Timezone string Optional`

                        IANA timezone identifier, e.g. "America/Los_Angeles".

                        minLength: 1, maxLength: 255

                - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                  Resolved default configuration for agent tools.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `type BetaManagedAgentsMCPToolset`

                - `Type BetaManagedAgentsMCPToolsetType`

                - `Configs []BetaManagedAgentsMCPToolConfig`

                  - `Enabled bool`

                  - `Name string`

                  - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                  Resolved default configuration for all tools from an MCP server.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `MCPServerName string`

              - `type BetaManagedAgentsCustomTool`

                A custom tool as returned in API responses.

                - `Type BetaManagedAgentsCustomToolType`

                - `Description string`

                - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                  JSON Schema for custom tool input parameters.

                  - `Type Object`

                  - `Properties map[string, any] Optional`

                  - `Required []string Optional`

                - `Name string`

            - `Version int64`

              format: int32

          - `type BetaManagedAgentsAdvisor`

            Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

            - `Type BetaManagedAgentsAdvisorType`

            - `Model string`

              The advisor model id.

      - `type BetaManagedAgentsSessionMultiagent20261001`

        Resolved multiagent configuration with three members, as copied to the `session` at creation.

        - `Type Multiagent20261001`

        - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

          Whether the session's primary thread can consult an advisor model.

          - `type BetaManagedAgentsMultiagentAdvisorEnabled`

            The session's primary thread can consult `model` mid-turn.

            - `Type Enabled`

            - `Model string`

              The advisor model id.

          - `type BetaManagedAgentsMultiagentAdvisorDisabled`

            The agent has no advisor.

            - `Type Disabled`

        - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

          Whether the agent can spawn session threads.

          - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

            The agent can spawn session threads.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether the agent can define inline agents, which are not saved, when it spawns session threads.

              - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                The agent can define inline agents.

                - `Type Enabled`

              - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                The agent cannot define inline agents.

                - `Type Disabled`

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentSubagentsDisabled`

            The agent cannot spawn session threads.

            - `Type Disabled`

        - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

          Whether the agent can start workflow runs.

          - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

            The agent can start workflow runs.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether a run's plan can define inline agents, which are not saved.

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

            The agent cannot start workflow runs.

            - `Type Disabled`

    - `Name string`

    - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

      - `type BetaManagedAgentsAnthropicSkill`

        A resolved Anthropic-managed skill.

      - `type BetaManagedAgentsCustomSkill`

        A resolved user-created custom skill.

    - `System string`

    - `Tools []BetaManagedAgentsSessionAgentToolUnion`

      - `type BetaManagedAgentsAgentToolset20260401`

      - `type BetaManagedAgentsMCPToolset`

      - `type BetaManagedAgentsCustomTool`

        A custom tool as returned in API responses.

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    When the session was archived. Null if not archived.

    format: date-time

  - `Budget BetaManagedAgentsBudgetLimit`

    The session's enforced spend ceiling, or null when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `EnvironmentID string`

  - `Metadata map[string, string]`

  - `OutcomeEvaluations []BetaManagedAgentsOutcomeEvaluationResource`

    Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.

    - `Type BetaManagedAgentsOutcomeEvaluationResourceType`

    - `CompletedAt Time`

      When the outcome reached a terminal result. Null while `pending`/`running`/`evaluating`.

      format: date-time

    - `Description string`

      What the agent should produce.

    - `Explanation string`

      Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable.

    - `Iteration int64`

      0-indexed revision cycle the outcome is currently on.

      format: int32

    - `OutcomeID string`

      Server-generated outc_ ID for this outcome.

    - `Result string`

      Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.

  - `Resources []BetaManagedAgentsSessionResourceUnion`

    - `type BetaManagedAgentsGitHubRepositoryResource`

      - `Type BetaManagedAgentsGitHubRepositoryResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `URL string`

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

    - `type BetaManagedAgentsFileResource`

      - `Type BetaManagedAgentsFileResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `FileID string`

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

    - `type BetaManagedAgentsMemoryStoreResource`

      A memory store attached to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

      - `Description string Optional`

        Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

      - `MountPath string Optional`

        Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

      - `Name string Optional`

        Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

  - `Stats BetaManagedAgentsSessionStats`

    Timing statistics for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the session spent in `running` status. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

      format: double

  - `Status BetaManagedAgentsSessionStatus`

    - `const BetaManagedAgentsSessionStatusRescheduling BetaManagedAgentsSessionStatus = "rescheduling"`

      Transient error occurred, retrying automatically.

    - `const BetaManagedAgentsSessionStatusRunning BetaManagedAgentsSessionStatus = "running"`

      Agent is actively executing.

    - `const BetaManagedAgentsSessionStatusIdle BetaManagedAgentsSessionStatus = "idle"`

      Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle.

    - `const BetaManagedAgentsSessionStatusTerminated BetaManagedAgentsSessionStatus = "terminated"`

      Session has ended, either due to an error or completion.

  - `Title string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Usage BetaManagedAgentsSessionUsage`

    Cumulative token usage for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of the session across all turns, priced at public list rates. Absent until cost tracking is available for the session.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns. Absent until server-tool tracking is available for the session.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `VaultIDs []string`

    Vault IDs attached to the session at creation. Empty when no vaults were supplied.

  - `DeploymentID string Optional`

    Deployment ID when the session was created from a deployment reference. Null otherwise.

#### 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"),
	)
	betaManagedAgentsSession, err := client.Beta.Sessions.New(context.TODO(), anthropic.BetaSessionNewParams{
		Agent: anthropic.BetaSessionNewParamsAgentUnion{
			OfString: anthropic.String("agent_011CZkYpogX7uDKUyvBTophP"),
		},
		EnvironmentID: "env_011CZkZ9X2dpNyB7HsEFoRfW",
		InitialEvents: []anthropic.BetaSessionNewParamsInitialEventUnion{anthropic.BetaSessionNewParamsInitialEventUnion{
			OfUserMessage: &anthropic.BetaManagedAgentsUserMessageEventParams{
				Type: anthropic.BetaManagedAgentsUserMessageEventParamsTypeUserMessage,
				Content: []anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{
					OfText: &anthropic.BetaManagedAgentsTextBlockParam{
						Type: anthropic.BetaManagedAgentsTextBlockTypeText,
						Text: "Where is my order #1234?",
					},
				}},
			},
		}},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSession.ID)
}
```

##### Response (200)

```json
{
  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "description": "A general-purpose starter agent.",
    "execution_identity": {
      "type": "service_account"
    },
    "mcp_servers": [
      {
        "name": "example-mcp",
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse"
      }
    ],
    "model": {
      "id": "claude-opus-5-5",
      "effort": {
        "type": "low"
      },
      "inference_geo": "inference_geo",
      "speed": "standard"
    },
    "multiagent": {
      "agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "description": "A focused research subagent.",
          "execution_identity": {
            "type": "service_account"
          },
          "mcp_servers": [
            {
              "name": "example-mcp",
              "type": "url",
              "url": "https://example-server.modelcontextprotocol.io/sse"
            }
          ],
          "model": {
            "id": "claude-opus-5-5",
            "effort": {
              "type": "low"
            },
            "inference_geo": "inference_geo",
            "speed": "standard"
          },
          "name": "Researcher",
          "skills": [
            {
              "skill_id": "xlsx",
              "type": "anthropic",
              "version": "1"
            }
          ],
          "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
          "tools": [
            {
              "configs": [
                {
                  "enabled": true,
                  "name": "bash",
                  "permission_policy": {
                    "type": "always_allow"
                  },
                  "type": "bash"
                }
              ],
              "default_config": {
                "enabled": true,
                "permission_policy": {
                  "type": "always_ask"
                }
              },
              "type": "agent_toolset_20260401"
            }
          ],
          "type": "agent",
          "version": 1
        }
      ],
      "type": "coordinator"
    },
    "name": "My First Agent",
    "skills": [
      {
        "skill_id": "xlsx",
        "type": "anthropic",
        "version": "1"
      },
      {
        "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
        "type": "custom",
        "version": "2"
      }
    ],
    "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
    "tools": [
      {
        "configs": [
          {
            "enabled": true,
            "name": "bash",
            "permission_policy": {
              "type": "always_allow"
            },
            "type": "bash"
          }
        ],
        "default_config": {
          "enabled": true,
          "permission_policy": {
            "type": "always_ask"
          }
        },
        "type": "agent_toolset_20260401"
      }
    ],
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "metadata": {},
  "outcome_evaluations": [
    {
      "completed_at": "2026-03-15T10:02:31Z",
      "description": "Produce a 2-page summary as summary.md",
      "explanation": "All five sections present with inline citations.",
      "iteration": 0,
      "outcome_id": "outc_011CZkZRSw2kEfs6ncTVmjxP",
      "result": "satisfied",
      "type": "outcome_evaluation"
    }
  ],
  "resources": [
    {
      "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
      "created_at": "2026-03-15T10:00:00Z",
      "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "mount_path": "/uploads/receipt.pdf",
      "type": "file",
      "updated_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
      "created_at": "2026-03-15T10:00:00Z",
      "mount_path": "/workspace/example-repo",
      "type": "github_repository",
      "updated_at": "2026-03-15T10:00:00Z",
      "url": "https://github.com/example-org/example-repo",
      "checkout": {
        "name": "main",
        "type": "branch"
      }
    }
  ],
  "stats": {
    "active_seconds": 0,
    "duration_seconds": 0
  },
  "status": "idle",
  "title": "Order #1234 inquiry",
  "type": "session",
  "updated_at": "2026-03-15T10:00:00Z",
  "usage": {
    "active_seconds": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "output_tokens": 0,
    "server_tool_use": {
      "web_fetch_requests": 0,
      "web_search_requests": 3
    }
  },
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "deployment_id": "deployment_id"
}
```

### List Sessions

`client.Beta.Sessions.List(ctx, params) (*BidirectionalPageCursor[BetaManagedAgentsSession], error)`

**GET** `/v1/sessions`

List Sessions

#### Parameters

- `params BetaSessionListParams`

  - `AgentID param.Opt[string] Optional` (query parameter)

    Filter sessions created with this agent ID.

  - `AgentVersion param.Opt[int64] Optional` (query parameter)

    Filter by agent version. Only applies when `agent_id` is also set.

    format: int32

  - `CreatedAtGt param.Opt[Time] Optional` (query parameter)

    Return sessions created after this time (exclusive).

    format: date-time

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return sessions created at or after this time (inclusive).

    format: date-time

  - `CreatedAtLt param.Opt[Time] Optional` (query parameter)

    Return sessions created before this time (exclusive).

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return sessions created at or before this time (inclusive).

    format: date-time

  - `DeploymentID param.Opt[string] Optional` (query parameter)

    Filter sessions created by this deployment ID.

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    When true, includes archived sessions. Default: false (exclude archived).

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of results to return.

    format: int32

  - `MemoryStoreID param.Opt[string] Optional` (query parameter)

    Filter sessions whose resources contain a `memory_store` with this memory store ID.

  - `Order BetaSessionListParamsOrder Optional` (query parameter)

    Sort direction for results, ordered by `created_at`. Defaults to `desc` (newest first).

    - `const BetaSessionListParamsOrderAsc BetaSessionListParamsOrder = "asc"`

    - `const BetaSessionListParamsOrderDesc BetaSessionListParamsOrder = "desc"`

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor from a previous response.

  - `Statuses []string Optional` (query parameter)

    Filter by session status. Repeat the parameter to match any of multiple statuses.

    - `const BetaSessionListParamsStatusRescheduling BetaSessionListParamsStatus = "rescheduling"`

      Transient error occurred, retrying automatically.

    - `const BetaSessionListParamsStatusRunning BetaSessionListParamsStatus = "running"`

      Agent is actively executing.

    - `const BetaSessionListParamsStatusIdle BetaSessionListParamsStatus = "idle"`

      Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle.

    - `const BetaSessionListParamsStatusTerminated BetaSessionListParamsStatus = "terminated"`

      Session has ended, either due to an error or completion.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSession`

  A Managed Agents `session`.

  - `Type BetaManagedAgentsSessionType`

  - `ID string`

  - `Agent BetaManagedAgentsSessionAgent`

    Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.

    - `Type BetaManagedAgentsSessionAgentType`

    - `ID string`

    - `Description string`

    - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

      Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

      - `type BetaManagedAgentsAWSRoleExecutionIdentity`

        An AWS IAM role principal as returned in API responses.

        - `Type AWSRole`

        - `RoleARN string`

          The IAM role's ARN.

      - `type BetaManagedAgentsServiceAccountExecutionIdentity`

        The Anthropic-managed service account as returned in API responses.

        - `Type ServiceAccount`

    - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

      - `Type BetaManagedAgentsMCPServerURLDefinitionType`

      - `Name string`

      - `URL string`

    - `Model BetaManagedAgentsModelConfig`

      Model identifier and configuration.

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

        How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

      - `Speed BetaManagedAgentsModelConfigSpeed Optional`

        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

        - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

    - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

      Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

      - `type BetaManagedAgentsSessionMultiagentCoordinator`

        Resolved coordinator topology with full agent definitions for each roster member.

        - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

        - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

          Full `agent` definitions the coordinator may spawn as session threads.

          - `type BetaManagedAgentsSessionThreadAgent`

            Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

            - `Type BetaManagedAgentsSessionThreadAgentType`

            - `ID string`

            - `Description string`

            - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

              Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

            - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Type BetaManagedAgentsMCPServerURLDefinitionType`

              - `Name string`

              - `URL string`

            - `Model BetaManagedAgentsModelConfig`

              Model identifier and configuration.

            - `Name string`

            - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `type BetaManagedAgentsAnthropicSkill`

                A resolved Anthropic-managed skill.

                - `Type BetaManagedAgentsAnthropicSkillType`

                - `SkillID string`

                - `Version string`

              - `type BetaManagedAgentsCustomSkill`

                A resolved user-created custom skill.

                - `Type BetaManagedAgentsCustomSkillType`

                - `SkillID string`

                - `Version string`

            - `System string`

            - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `type BetaManagedAgentsAgentToolset20260401`

                - `Type BetaManagedAgentsAgentToolset20260401Type`

                - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                  - `type BetaManagedAgentsBashToolConfig`

                    Configuration for the bash tool.

                    - `Type Bash`

                    - `Enabled bool`

                    - `Name Bash`

                    - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                        - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                        - `Type BetaManagedAgentsAlwaysAskPolicyType`

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                        - `Type Auto`

                  - `type BetaManagedAgentsEditToolConfig`

                    Configuration for the edit tool.

                    - `Type Edit`

                    - `Enabled bool`

                    - `Name Edit`

                    - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsReadToolConfig`

                    Configuration for the read tool.

                    - `Type Read`

                    - `Enabled bool`

                    - `Name Read`

                    - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWriteToolConfig`

                    Configuration for the write tool.

                    - `Type Write`

                    - `Enabled bool`

                    - `Name Write`

                    - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGlobToolConfig`

                    Configuration for the glob tool.

                    - `Type Glob`

                    - `Enabled bool`

                    - `Name Glob`

                    - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGrepToolConfig`

                    Configuration for the grep tool.

                    - `Type Grep`

                    - `Enabled bool`

                    - `Name Grep`

                    - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWebFetchToolConfig`

                    Configuration for the web_fetch tool.

                    - `Type WebFetch`

                    - `Enabled bool`

                    - `Name WebFetch`

                    - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `URLSources BetaManagedAgentsWebFetchURLSources`

                      Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                      - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                          - `Type All`

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                          - `Type None`

                        - `type BetaManagedAgentsWebFetchURLSourceOnly`

                          Only the named tools' results contribute URLs that may be fetched.

                          - `Type Only`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                        - `type BetaManagedAgentsWebFetchURLSourceExcept`

                          Every tool's results contribute URLs that may be fetched, except the named tools' results.

                          - `Type Except`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                      - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                      - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                        Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `MaxContentTokens int64 Optional`

                      format: int32

                  - `type BetaManagedAgentsWebSearchToolConfig`

                    Configuration for the web_search tool.

                    - `Type WebSearch`

                    - `Enabled bool`

                    - `Name WebSearch`

                    - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `UserLocation BetaManagedAgentsUserLocation Optional`

                      Approximate user location for search result localization.

                      - `Type Approximate`

                        Location precision. Only "approximate" is supported.

                      - `City string Optional`

                        City name.

                        minLength: 1, maxLength: 255

                      - `Country string Optional`

                        Two-letter ISO 3166-1 country code, uppercase.

                      - `Region string Optional`

                        Region or state name.

                        minLength: 1, maxLength: 255

                      - `Timezone string Optional`

                        IANA timezone identifier, e.g. "America/Los_Angeles".

                        minLength: 1, maxLength: 255

                - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                  Resolved default configuration for agent tools.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `type BetaManagedAgentsMCPToolset`

                - `Type BetaManagedAgentsMCPToolsetType`

                - `Configs []BetaManagedAgentsMCPToolConfig`

                  - `Enabled bool`

                  - `Name string`

                  - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                  Resolved default configuration for all tools from an MCP server.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `MCPServerName string`

              - `type BetaManagedAgentsCustomTool`

                A custom tool as returned in API responses.

                - `Type BetaManagedAgentsCustomToolType`

                - `Description string`

                - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                  JSON Schema for custom tool input parameters.

                  - `Type Object`

                  - `Properties map[string, any] Optional`

                  - `Required []string Optional`

                - `Name string`

            - `Version int64`

              format: int32

          - `type BetaManagedAgentsAdvisor`

            Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

            - `Type BetaManagedAgentsAdvisorType`

            - `Model string`

              The advisor model id.

      - `type BetaManagedAgentsSessionMultiagent20261001`

        Resolved multiagent configuration with three members, as copied to the `session` at creation.

        - `Type Multiagent20261001`

        - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

          Whether the session's primary thread can consult an advisor model.

          - `type BetaManagedAgentsMultiagentAdvisorEnabled`

            The session's primary thread can consult `model` mid-turn.

            - `Type Enabled`

            - `Model string`

              The advisor model id.

          - `type BetaManagedAgentsMultiagentAdvisorDisabled`

            The agent has no advisor.

            - `Type Disabled`

        - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

          Whether the agent can spawn session threads.

          - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

            The agent can spawn session threads.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether the agent can define inline agents, which are not saved, when it spawns session threads.

              - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                The agent can define inline agents.

                - `Type Enabled`

              - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                The agent cannot define inline agents.

                - `Type Disabled`

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentSubagentsDisabled`

            The agent cannot spawn session threads.

            - `Type Disabled`

        - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

          Whether the agent can start workflow runs.

          - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

            The agent can start workflow runs.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether a run's plan can define inline agents, which are not saved.

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

            The agent cannot start workflow runs.

            - `Type Disabled`

    - `Name string`

    - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

      - `type BetaManagedAgentsAnthropicSkill`

        A resolved Anthropic-managed skill.

      - `type BetaManagedAgentsCustomSkill`

        A resolved user-created custom skill.

    - `System string`

    - `Tools []BetaManagedAgentsSessionAgentToolUnion`

      - `type BetaManagedAgentsAgentToolset20260401`

      - `type BetaManagedAgentsMCPToolset`

      - `type BetaManagedAgentsCustomTool`

        A custom tool as returned in API responses.

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    When the session was archived. Null if not archived.

    format: date-time

  - `Budget BetaManagedAgentsBudgetLimit`

    The session's enforced spend ceiling, or null when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `EnvironmentID string`

  - `Metadata map[string, string]`

  - `OutcomeEvaluations []BetaManagedAgentsOutcomeEvaluationResource`

    Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.

    - `Type BetaManagedAgentsOutcomeEvaluationResourceType`

    - `CompletedAt Time`

      When the outcome reached a terminal result. Null while `pending`/`running`/`evaluating`.

      format: date-time

    - `Description string`

      What the agent should produce.

    - `Explanation string`

      Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable.

    - `Iteration int64`

      0-indexed revision cycle the outcome is currently on.

      format: int32

    - `OutcomeID string`

      Server-generated outc_ ID for this outcome.

    - `Result string`

      Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.

  - `Resources []BetaManagedAgentsSessionResourceUnion`

    - `type BetaManagedAgentsGitHubRepositoryResource`

      - `Type BetaManagedAgentsGitHubRepositoryResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `URL string`

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

    - `type BetaManagedAgentsFileResource`

      - `Type BetaManagedAgentsFileResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `FileID string`

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

    - `type BetaManagedAgentsMemoryStoreResource`

      A memory store attached to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

      - `Description string Optional`

        Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

      - `MountPath string Optional`

        Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

      - `Name string Optional`

        Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

  - `Stats BetaManagedAgentsSessionStats`

    Timing statistics for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the session spent in `running` status. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

      format: double

  - `Status BetaManagedAgentsSessionStatus`

    - `const BetaManagedAgentsSessionStatusRescheduling BetaManagedAgentsSessionStatus = "rescheduling"`

      Transient error occurred, retrying automatically.

    - `const BetaManagedAgentsSessionStatusRunning BetaManagedAgentsSessionStatus = "running"`

      Agent is actively executing.

    - `const BetaManagedAgentsSessionStatusIdle BetaManagedAgentsSessionStatus = "idle"`

      Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle.

    - `const BetaManagedAgentsSessionStatusTerminated BetaManagedAgentsSessionStatus = "terminated"`

      Session has ended, either due to an error or completion.

  - `Title string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Usage BetaManagedAgentsSessionUsage`

    Cumulative token usage for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of the session across all turns, priced at public list rates. Absent until cost tracking is available for the session.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns. Absent until server-tool tracking is available for the session.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `VaultIDs []string`

    Vault IDs attached to the session at creation. Empty when no vaults were supplied.

  - `DeploymentID string Optional`

    Deployment ID when the session was created from a deployment reference. Null otherwise.

#### 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"),
	)
	page, err := client.Beta.Sessions.List(context.TODO(), anthropic.BetaSessionListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
      "agent": {
        "id": "agent_011CZkYpogX7uDKUyvBTophP",
        "description": "A general-purpose starter agent.",
        "execution_identity": {
          "type": "service_account"
        },
        "mcp_servers": [
          {
            "name": "example-mcp",
            "type": "url",
            "url": "https://example-server.modelcontextprotocol.io/sse"
          }
        ],
        "model": {
          "id": "claude-opus-5-5",
          "effort": {
            "type": "low"
          },
          "inference_geo": "inference_geo",
          "speed": "standard"
        },
        "multiagent": {
          "agents": [
            {
              "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
              "description": "A focused research subagent.",
              "execution_identity": {
                "type": "service_account"
              },
              "mcp_servers": [
                {
                  "name": "example-mcp",
                  "type": "url",
                  "url": "https://example-server.modelcontextprotocol.io/sse"
                }
              ],
              "model": {
                "id": "claude-opus-5-5",
                "effort": {
                  "type": "low"
                },
                "inference_geo": "inference_geo",
                "speed": "standard"
              },
              "name": "Researcher",
              "skills": [
                {
                  "skill_id": "xlsx",
                  "type": "anthropic",
                  "version": "1"
                }
              ],
              "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
              "tools": [
                {
                  "configs": [
                    {
                      "enabled": true,
                      "name": "bash",
                      "permission_policy": {
                        "type": "always_allow"
                      },
                      "type": "bash"
                    }
                  ],
                  "default_config": {
                    "enabled": true,
                    "permission_policy": {
                      "type": "always_ask"
                    }
                  },
                  "type": "agent_toolset_20260401"
                }
              ],
              "type": "agent",
              "version": 1
            }
          ],
          "type": "coordinator"
        },
        "name": "My First Agent",
        "skills": [
          {
            "skill_id": "xlsx",
            "type": "anthropic",
            "version": "1"
          },
          {
            "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
            "type": "custom",
            "version": "2"
          }
        ],
        "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
        "tools": [
          {
            "configs": [
              {
                "enabled": true,
                "name": "bash",
                "permission_policy": {
                  "type": "always_allow"
                },
                "type": "bash"
              }
            ],
            "default_config": {
              "enabled": true,
              "permission_policy": {
                "type": "always_ask"
              }
            },
            "type": "agent_toolset_20260401"
          }
        ],
        "type": "agent",
        "version": 1
      },
      "archived_at": null,
      "budget": {
        "max_list_cost": {
          "amount": "2500",
          "currency": "USD"
        },
        "type": "limit"
      },
      "created_at": "2026-03-15T10:00:00Z",
      "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
      "metadata": {},
      "outcome_evaluations": [
        {
          "completed_at": "2026-03-15T10:02:31Z",
          "description": "Produce a 2-page summary as summary.md",
          "explanation": "All five sections present with inline citations.",
          "iteration": 0,
          "outcome_id": "outc_011CZkZRSw2kEfs6ncTVmjxP",
          "result": "satisfied",
          "type": "outcome_evaluation"
        }
      ],
      "resources": [
        {
          "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
          "created_at": "2026-03-15T10:00:00Z",
          "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
          "mount_path": "/uploads/receipt.pdf",
          "type": "file",
          "updated_at": "2026-03-15T10:00:00Z"
        },
        {
          "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
          "created_at": "2026-03-15T10:00:00Z",
          "mount_path": "/workspace/example-repo",
          "type": "github_repository",
          "updated_at": "2026-03-15T10:00:00Z",
          "url": "https://github.com/example-org/example-repo",
          "checkout": {
            "name": "main",
            "type": "branch"
          }
        }
      ],
      "stats": {
        "active_seconds": 0,
        "duration_seconds": 0
      },
      "status": "idle",
      "title": "Order #1234 inquiry",
      "type": "session",
      "updated_at": "2026-03-15T10:00:00Z",
      "usage": {
        "active_seconds": 0,
        "cache_creation": {
          "ephemeral_1h_input_tokens": 0,
          "ephemeral_5m_input_tokens": 0
        },
        "cache_read_input_tokens": 0,
        "input_tokens": 0,
        "list_cost": {
          "amount": "2500",
          "currency": "USD"
        },
        "output_tokens": 0,
        "server_tool_use": {
          "web_fetch_requests": 0,
          "web_search_requests": 3
        }
      },
      "vault_ids": [
        "vlt_011CZkZDLs7fYzm1hXNPeRjv"
      ],
      "deployment_id": "deployment_id"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo=",
  "prev_page": "page_MjAyNS0wNS0xM1QwMDowMDowMFo="
}
```

### Get Session

`client.Beta.Sessions.Get(ctx, sessionID, query) (*BetaManagedAgentsSession, error)`

**GET** `/v1/sessions/{session_id}`

Get Session

#### Parameters

- `sessionID string` (path parameter)

- `query BetaSessionGetParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSession`

  A Managed Agents `session`.

  - `Type BetaManagedAgentsSessionType`

  - `ID string`

  - `Agent BetaManagedAgentsSessionAgent`

    Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.

    - `Type BetaManagedAgentsSessionAgentType`

    - `ID string`

    - `Description string`

    - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

      Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

      - `type BetaManagedAgentsAWSRoleExecutionIdentity`

        An AWS IAM role principal as returned in API responses.

        - `Type AWSRole`

        - `RoleARN string`

          The IAM role's ARN.

      - `type BetaManagedAgentsServiceAccountExecutionIdentity`

        The Anthropic-managed service account as returned in API responses.

        - `Type ServiceAccount`

    - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

      - `Type BetaManagedAgentsMCPServerURLDefinitionType`

      - `Name string`

      - `URL string`

    - `Model BetaManagedAgentsModelConfig`

      Model identifier and configuration.

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

        How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

      - `Speed BetaManagedAgentsModelConfigSpeed Optional`

        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

        - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

    - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

      Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

      - `type BetaManagedAgentsSessionMultiagentCoordinator`

        Resolved coordinator topology with full agent definitions for each roster member.

        - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

        - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

          Full `agent` definitions the coordinator may spawn as session threads.

          - `type BetaManagedAgentsSessionThreadAgent`

            Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

            - `Type BetaManagedAgentsSessionThreadAgentType`

            - `ID string`

            - `Description string`

            - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

              Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

            - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Type BetaManagedAgentsMCPServerURLDefinitionType`

              - `Name string`

              - `URL string`

            - `Model BetaManagedAgentsModelConfig`

              Model identifier and configuration.

            - `Name string`

            - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `type BetaManagedAgentsAnthropicSkill`

                A resolved Anthropic-managed skill.

                - `Type BetaManagedAgentsAnthropicSkillType`

                - `SkillID string`

                - `Version string`

              - `type BetaManagedAgentsCustomSkill`

                A resolved user-created custom skill.

                - `Type BetaManagedAgentsCustomSkillType`

                - `SkillID string`

                - `Version string`

            - `System string`

            - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `type BetaManagedAgentsAgentToolset20260401`

                - `Type BetaManagedAgentsAgentToolset20260401Type`

                - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                  - `type BetaManagedAgentsBashToolConfig`

                    Configuration for the bash tool.

                    - `Type Bash`

                    - `Enabled bool`

                    - `Name Bash`

                    - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                        - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                        - `Type BetaManagedAgentsAlwaysAskPolicyType`

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                        - `Type Auto`

                  - `type BetaManagedAgentsEditToolConfig`

                    Configuration for the edit tool.

                    - `Type Edit`

                    - `Enabled bool`

                    - `Name Edit`

                    - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsReadToolConfig`

                    Configuration for the read tool.

                    - `Type Read`

                    - `Enabled bool`

                    - `Name Read`

                    - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWriteToolConfig`

                    Configuration for the write tool.

                    - `Type Write`

                    - `Enabled bool`

                    - `Name Write`

                    - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGlobToolConfig`

                    Configuration for the glob tool.

                    - `Type Glob`

                    - `Enabled bool`

                    - `Name Glob`

                    - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGrepToolConfig`

                    Configuration for the grep tool.

                    - `Type Grep`

                    - `Enabled bool`

                    - `Name Grep`

                    - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWebFetchToolConfig`

                    Configuration for the web_fetch tool.

                    - `Type WebFetch`

                    - `Enabled bool`

                    - `Name WebFetch`

                    - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `URLSources BetaManagedAgentsWebFetchURLSources`

                      Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                      - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                          - `Type All`

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                          - `Type None`

                        - `type BetaManagedAgentsWebFetchURLSourceOnly`

                          Only the named tools' results contribute URLs that may be fetched.

                          - `Type Only`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                        - `type BetaManagedAgentsWebFetchURLSourceExcept`

                          Every tool's results contribute URLs that may be fetched, except the named tools' results.

                          - `Type Except`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                      - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                      - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                        Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `MaxContentTokens int64 Optional`

                      format: int32

                  - `type BetaManagedAgentsWebSearchToolConfig`

                    Configuration for the web_search tool.

                    - `Type WebSearch`

                    - `Enabled bool`

                    - `Name WebSearch`

                    - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `UserLocation BetaManagedAgentsUserLocation Optional`

                      Approximate user location for search result localization.

                      - `Type Approximate`

                        Location precision. Only "approximate" is supported.

                      - `City string Optional`

                        City name.

                        minLength: 1, maxLength: 255

                      - `Country string Optional`

                        Two-letter ISO 3166-1 country code, uppercase.

                      - `Region string Optional`

                        Region or state name.

                        minLength: 1, maxLength: 255

                      - `Timezone string Optional`

                        IANA timezone identifier, e.g. "America/Los_Angeles".

                        minLength: 1, maxLength: 255

                - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                  Resolved default configuration for agent tools.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `type BetaManagedAgentsMCPToolset`

                - `Type BetaManagedAgentsMCPToolsetType`

                - `Configs []BetaManagedAgentsMCPToolConfig`

                  - `Enabled bool`

                  - `Name string`

                  - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                  Resolved default configuration for all tools from an MCP server.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `MCPServerName string`

              - `type BetaManagedAgentsCustomTool`

                A custom tool as returned in API responses.

                - `Type BetaManagedAgentsCustomToolType`

                - `Description string`

                - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                  JSON Schema for custom tool input parameters.

                  - `Type Object`

                  - `Properties map[string, any] Optional`

                  - `Required []string Optional`

                - `Name string`

            - `Version int64`

              format: int32

          - `type BetaManagedAgentsAdvisor`

            Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

            - `Type BetaManagedAgentsAdvisorType`

            - `Model string`

              The advisor model id.

      - `type BetaManagedAgentsSessionMultiagent20261001`

        Resolved multiagent configuration with three members, as copied to the `session` at creation.

        - `Type Multiagent20261001`

        - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

          Whether the session's primary thread can consult an advisor model.

          - `type BetaManagedAgentsMultiagentAdvisorEnabled`

            The session's primary thread can consult `model` mid-turn.

            - `Type Enabled`

            - `Model string`

              The advisor model id.

          - `type BetaManagedAgentsMultiagentAdvisorDisabled`

            The agent has no advisor.

            - `Type Disabled`

        - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

          Whether the agent can spawn session threads.

          - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

            The agent can spawn session threads.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether the agent can define inline agents, which are not saved, when it spawns session threads.

              - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                The agent can define inline agents.

                - `Type Enabled`

              - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                The agent cannot define inline agents.

                - `Type Disabled`

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentSubagentsDisabled`

            The agent cannot spawn session threads.

            - `Type Disabled`

        - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

          Whether the agent can start workflow runs.

          - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

            The agent can start workflow runs.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether a run's plan can define inline agents, which are not saved.

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

            The agent cannot start workflow runs.

            - `Type Disabled`

    - `Name string`

    - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

      - `type BetaManagedAgentsAnthropicSkill`

        A resolved Anthropic-managed skill.

      - `type BetaManagedAgentsCustomSkill`

        A resolved user-created custom skill.

    - `System string`

    - `Tools []BetaManagedAgentsSessionAgentToolUnion`

      - `type BetaManagedAgentsAgentToolset20260401`

      - `type BetaManagedAgentsMCPToolset`

      - `type BetaManagedAgentsCustomTool`

        A custom tool as returned in API responses.

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    When the session was archived. Null if not archived.

    format: date-time

  - `Budget BetaManagedAgentsBudgetLimit`

    The session's enforced spend ceiling, or null when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `EnvironmentID string`

  - `Metadata map[string, string]`

  - `OutcomeEvaluations []BetaManagedAgentsOutcomeEvaluationResource`

    Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.

    - `Type BetaManagedAgentsOutcomeEvaluationResourceType`

    - `CompletedAt Time`

      When the outcome reached a terminal result. Null while `pending`/`running`/`evaluating`.

      format: date-time

    - `Description string`

      What the agent should produce.

    - `Explanation string`

      Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable.

    - `Iteration int64`

      0-indexed revision cycle the outcome is currently on.

      format: int32

    - `OutcomeID string`

      Server-generated outc_ ID for this outcome.

    - `Result string`

      Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.

  - `Resources []BetaManagedAgentsSessionResourceUnion`

    - `type BetaManagedAgentsGitHubRepositoryResource`

      - `Type BetaManagedAgentsGitHubRepositoryResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `URL string`

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

    - `type BetaManagedAgentsFileResource`

      - `Type BetaManagedAgentsFileResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `FileID string`

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

    - `type BetaManagedAgentsMemoryStoreResource`

      A memory store attached to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

      - `Description string Optional`

        Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

      - `MountPath string Optional`

        Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

      - `Name string Optional`

        Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

  - `Stats BetaManagedAgentsSessionStats`

    Timing statistics for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the session spent in `running` status. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

      format: double

  - `Status BetaManagedAgentsSessionStatus`

    - `const BetaManagedAgentsSessionStatusRescheduling BetaManagedAgentsSessionStatus = "rescheduling"`

      Transient error occurred, retrying automatically.

    - `const BetaManagedAgentsSessionStatusRunning BetaManagedAgentsSessionStatus = "running"`

      Agent is actively executing.

    - `const BetaManagedAgentsSessionStatusIdle BetaManagedAgentsSessionStatus = "idle"`

      Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle.

    - `const BetaManagedAgentsSessionStatusTerminated BetaManagedAgentsSessionStatus = "terminated"`

      Session has ended, either due to an error or completion.

  - `Title string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Usage BetaManagedAgentsSessionUsage`

    Cumulative token usage for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of the session across all turns, priced at public list rates. Absent until cost tracking is available for the session.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns. Absent until server-tool tracking is available for the session.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `VaultIDs []string`

    Vault IDs attached to the session at creation. Empty when no vaults were supplied.

  - `DeploymentID string Optional`

    Deployment ID when the session was created from a deployment reference. Null otherwise.

#### 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"),
	)
	betaManagedAgentsSession, err := client.Beta.Sessions.Get(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSession.ID)
}
```

##### Response (200)

```json
{
  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "description": "A general-purpose starter agent.",
    "execution_identity": {
      "type": "service_account"
    },
    "mcp_servers": [
      {
        "name": "example-mcp",
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse"
      }
    ],
    "model": {
      "id": "claude-opus-5-5",
      "effort": {
        "type": "low"
      },
      "inference_geo": "inference_geo",
      "speed": "standard"
    },
    "multiagent": {
      "agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "description": "A focused research subagent.",
          "execution_identity": {
            "type": "service_account"
          },
          "mcp_servers": [
            {
              "name": "example-mcp",
              "type": "url",
              "url": "https://example-server.modelcontextprotocol.io/sse"
            }
          ],
          "model": {
            "id": "claude-opus-5-5",
            "effort": {
              "type": "low"
            },
            "inference_geo": "inference_geo",
            "speed": "standard"
          },
          "name": "Researcher",
          "skills": [
            {
              "skill_id": "xlsx",
              "type": "anthropic",
              "version": "1"
            }
          ],
          "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
          "tools": [
            {
              "configs": [
                {
                  "enabled": true,
                  "name": "bash",
                  "permission_policy": {
                    "type": "always_allow"
                  },
                  "type": "bash"
                }
              ],
              "default_config": {
                "enabled": true,
                "permission_policy": {
                  "type": "always_ask"
                }
              },
              "type": "agent_toolset_20260401"
            }
          ],
          "type": "agent",
          "version": 1
        }
      ],
      "type": "coordinator"
    },
    "name": "My First Agent",
    "skills": [
      {
        "skill_id": "xlsx",
        "type": "anthropic",
        "version": "1"
      },
      {
        "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
        "type": "custom",
        "version": "2"
      }
    ],
    "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
    "tools": [
      {
        "configs": [
          {
            "enabled": true,
            "name": "bash",
            "permission_policy": {
              "type": "always_allow"
            },
            "type": "bash"
          }
        ],
        "default_config": {
          "enabled": true,
          "permission_policy": {
            "type": "always_ask"
          }
        },
        "type": "agent_toolset_20260401"
      }
    ],
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "metadata": {},
  "outcome_evaluations": [
    {
      "completed_at": "2026-03-15T10:02:31Z",
      "description": "Produce a 2-page summary as summary.md",
      "explanation": "All five sections present with inline citations.",
      "iteration": 0,
      "outcome_id": "outc_011CZkZRSw2kEfs6ncTVmjxP",
      "result": "satisfied",
      "type": "outcome_evaluation"
    }
  ],
  "resources": [
    {
      "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
      "created_at": "2026-03-15T10:00:00Z",
      "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "mount_path": "/uploads/receipt.pdf",
      "type": "file",
      "updated_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
      "created_at": "2026-03-15T10:00:00Z",
      "mount_path": "/workspace/example-repo",
      "type": "github_repository",
      "updated_at": "2026-03-15T10:00:00Z",
      "url": "https://github.com/example-org/example-repo",
      "checkout": {
        "name": "main",
        "type": "branch"
      }
    }
  ],
  "stats": {
    "active_seconds": 0,
    "duration_seconds": 0
  },
  "status": "idle",
  "title": "Order #1234 inquiry",
  "type": "session",
  "updated_at": "2026-03-15T10:00:00Z",
  "usage": {
    "active_seconds": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "output_tokens": 0,
    "server_tool_use": {
      "web_fetch_requests": 0,
      "web_search_requests": 3
    }
  },
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "deployment_id": "deployment_id"
}
```

### Update Session

`client.Beta.Sessions.Update(ctx, sessionID, params) (*BetaManagedAgentsSession, error)`

**POST** `/v1/sessions/{session_id}`

Update Session

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionUpdateParams`

  - `Agent BetaManagedAgentsSessionAgentUpdateParam Optional`

    Agent configuration update. Only `tools` and `mcp_servers` are updatable mid-session. Only valid for sessions created from an agent or deployment reference. The session must not be running.

  - `Budget BetaManagedAgentsBudgetLimitParam Optional`

    Enforced spend ceiling for the session. Set an object to replace the budget of a session that was created with one, or `null` to remove it; omit to preserve. A budget cannot be added to a session created without one (rejected with reason `budget_create_only`), and a removed budget cannot be re-added. Allowed in any non-terminated status. Lowering `max_list_cost` to at or below the session's consumed list cost is rejected with reason `budget_not_raised`, and every model the session can run must have a public list price or the request is rejected with reason `model_not_budgetable`.

  - `Metadata map[string, string] Optional`

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.

  - `Title param.Opt[string] Optional`

    Human-readable session title.

    minLength: 1, maxLength: 500

  - `VaultIDs []string Optional`

    Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSession`

  A Managed Agents `session`.

  - `Type BetaManagedAgentsSessionType`

  - `ID string`

  - `Agent BetaManagedAgentsSessionAgent`

    Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.

    - `Type BetaManagedAgentsSessionAgentType`

    - `ID string`

    - `Description string`

    - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

      Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

      - `type BetaManagedAgentsAWSRoleExecutionIdentity`

        An AWS IAM role principal as returned in API responses.

        - `Type AWSRole`

        - `RoleARN string`

          The IAM role's ARN.

      - `type BetaManagedAgentsServiceAccountExecutionIdentity`

        The Anthropic-managed service account as returned in API responses.

        - `Type ServiceAccount`

    - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

      - `Type BetaManagedAgentsMCPServerURLDefinitionType`

      - `Name string`

      - `URL string`

    - `Model BetaManagedAgentsModelConfig`

      Model identifier and configuration.

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

        How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

      - `Speed BetaManagedAgentsModelConfigSpeed Optional`

        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

        - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

    - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

      Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

      - `type BetaManagedAgentsSessionMultiagentCoordinator`

        Resolved coordinator topology with full agent definitions for each roster member.

        - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

        - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

          Full `agent` definitions the coordinator may spawn as session threads.

          - `type BetaManagedAgentsSessionThreadAgent`

            Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

            - `Type BetaManagedAgentsSessionThreadAgentType`

            - `ID string`

            - `Description string`

            - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

              Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

            - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Type BetaManagedAgentsMCPServerURLDefinitionType`

              - `Name string`

              - `URL string`

            - `Model BetaManagedAgentsModelConfig`

              Model identifier and configuration.

            - `Name string`

            - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `type BetaManagedAgentsAnthropicSkill`

                A resolved Anthropic-managed skill.

                - `Type BetaManagedAgentsAnthropicSkillType`

                - `SkillID string`

                - `Version string`

              - `type BetaManagedAgentsCustomSkill`

                A resolved user-created custom skill.

                - `Type BetaManagedAgentsCustomSkillType`

                - `SkillID string`

                - `Version string`

            - `System string`

            - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `type BetaManagedAgentsAgentToolset20260401`

                - `Type BetaManagedAgentsAgentToolset20260401Type`

                - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                  - `type BetaManagedAgentsBashToolConfig`

                    Configuration for the bash tool.

                    - `Type Bash`

                    - `Enabled bool`

                    - `Name Bash`

                    - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                        - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                        - `Type BetaManagedAgentsAlwaysAskPolicyType`

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                        - `Type Auto`

                  - `type BetaManagedAgentsEditToolConfig`

                    Configuration for the edit tool.

                    - `Type Edit`

                    - `Enabled bool`

                    - `Name Edit`

                    - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsReadToolConfig`

                    Configuration for the read tool.

                    - `Type Read`

                    - `Enabled bool`

                    - `Name Read`

                    - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWriteToolConfig`

                    Configuration for the write tool.

                    - `Type Write`

                    - `Enabled bool`

                    - `Name Write`

                    - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGlobToolConfig`

                    Configuration for the glob tool.

                    - `Type Glob`

                    - `Enabled bool`

                    - `Name Glob`

                    - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGrepToolConfig`

                    Configuration for the grep tool.

                    - `Type Grep`

                    - `Enabled bool`

                    - `Name Grep`

                    - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWebFetchToolConfig`

                    Configuration for the web_fetch tool.

                    - `Type WebFetch`

                    - `Enabled bool`

                    - `Name WebFetch`

                    - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `URLSources BetaManagedAgentsWebFetchURLSources`

                      Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                      - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                          - `Type All`

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                          - `Type None`

                        - `type BetaManagedAgentsWebFetchURLSourceOnly`

                          Only the named tools' results contribute URLs that may be fetched.

                          - `Type Only`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                        - `type BetaManagedAgentsWebFetchURLSourceExcept`

                          Every tool's results contribute URLs that may be fetched, except the named tools' results.

                          - `Type Except`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                      - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                      - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                        Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `MaxContentTokens int64 Optional`

                      format: int32

                  - `type BetaManagedAgentsWebSearchToolConfig`

                    Configuration for the web_search tool.

                    - `Type WebSearch`

                    - `Enabled bool`

                    - `Name WebSearch`

                    - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `UserLocation BetaManagedAgentsUserLocation Optional`

                      Approximate user location for search result localization.

                      - `Type Approximate`

                        Location precision. Only "approximate" is supported.

                      - `City string Optional`

                        City name.

                        minLength: 1, maxLength: 255

                      - `Country string Optional`

                        Two-letter ISO 3166-1 country code, uppercase.

                      - `Region string Optional`

                        Region or state name.

                        minLength: 1, maxLength: 255

                      - `Timezone string Optional`

                        IANA timezone identifier, e.g. "America/Los_Angeles".

                        minLength: 1, maxLength: 255

                - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                  Resolved default configuration for agent tools.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `type BetaManagedAgentsMCPToolset`

                - `Type BetaManagedAgentsMCPToolsetType`

                - `Configs []BetaManagedAgentsMCPToolConfig`

                  - `Enabled bool`

                  - `Name string`

                  - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                  Resolved default configuration for all tools from an MCP server.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `MCPServerName string`

              - `type BetaManagedAgentsCustomTool`

                A custom tool as returned in API responses.

                - `Type BetaManagedAgentsCustomToolType`

                - `Description string`

                - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                  JSON Schema for custom tool input parameters.

                  - `Type Object`

                  - `Properties map[string, any] Optional`

                  - `Required []string Optional`

                - `Name string`

            - `Version int64`

              format: int32

          - `type BetaManagedAgentsAdvisor`

            Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

            - `Type BetaManagedAgentsAdvisorType`

            - `Model string`

              The advisor model id.

      - `type BetaManagedAgentsSessionMultiagent20261001`

        Resolved multiagent configuration with three members, as copied to the `session` at creation.

        - `Type Multiagent20261001`

        - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

          Whether the session's primary thread can consult an advisor model.

          - `type BetaManagedAgentsMultiagentAdvisorEnabled`

            The session's primary thread can consult `model` mid-turn.

            - `Type Enabled`

            - `Model string`

              The advisor model id.

          - `type BetaManagedAgentsMultiagentAdvisorDisabled`

            The agent has no advisor.

            - `Type Disabled`

        - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

          Whether the agent can spawn session threads.

          - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

            The agent can spawn session threads.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether the agent can define inline agents, which are not saved, when it spawns session threads.

              - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                The agent can define inline agents.

                - `Type Enabled`

              - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                The agent cannot define inline agents.

                - `Type Disabled`

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentSubagentsDisabled`

            The agent cannot spawn session threads.

            - `Type Disabled`

        - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

          Whether the agent can start workflow runs.

          - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

            The agent can start workflow runs.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether a run's plan can define inline agents, which are not saved.

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

            The agent cannot start workflow runs.

            - `Type Disabled`

    - `Name string`

    - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

      - `type BetaManagedAgentsAnthropicSkill`

        A resolved Anthropic-managed skill.

      - `type BetaManagedAgentsCustomSkill`

        A resolved user-created custom skill.

    - `System string`

    - `Tools []BetaManagedAgentsSessionAgentToolUnion`

      - `type BetaManagedAgentsAgentToolset20260401`

      - `type BetaManagedAgentsMCPToolset`

      - `type BetaManagedAgentsCustomTool`

        A custom tool as returned in API responses.

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    When the session was archived. Null if not archived.

    format: date-time

  - `Budget BetaManagedAgentsBudgetLimit`

    The session's enforced spend ceiling, or null when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `EnvironmentID string`

  - `Metadata map[string, string]`

  - `OutcomeEvaluations []BetaManagedAgentsOutcomeEvaluationResource`

    Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.

    - `Type BetaManagedAgentsOutcomeEvaluationResourceType`

    - `CompletedAt Time`

      When the outcome reached a terminal result. Null while `pending`/`running`/`evaluating`.

      format: date-time

    - `Description string`

      What the agent should produce.

    - `Explanation string`

      Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable.

    - `Iteration int64`

      0-indexed revision cycle the outcome is currently on.

      format: int32

    - `OutcomeID string`

      Server-generated outc_ ID for this outcome.

    - `Result string`

      Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.

  - `Resources []BetaManagedAgentsSessionResourceUnion`

    - `type BetaManagedAgentsGitHubRepositoryResource`

      - `Type BetaManagedAgentsGitHubRepositoryResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `URL string`

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

    - `type BetaManagedAgentsFileResource`

      - `Type BetaManagedAgentsFileResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `FileID string`

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

    - `type BetaManagedAgentsMemoryStoreResource`

      A memory store attached to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

      - `Description string Optional`

        Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

      - `MountPath string Optional`

        Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

      - `Name string Optional`

        Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

  - `Stats BetaManagedAgentsSessionStats`

    Timing statistics for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the session spent in `running` status. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

      format: double

  - `Status BetaManagedAgentsSessionStatus`

    - `const BetaManagedAgentsSessionStatusRescheduling BetaManagedAgentsSessionStatus = "rescheduling"`

      Transient error occurred, retrying automatically.

    - `const BetaManagedAgentsSessionStatusRunning BetaManagedAgentsSessionStatus = "running"`

      Agent is actively executing.

    - `const BetaManagedAgentsSessionStatusIdle BetaManagedAgentsSessionStatus = "idle"`

      Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle.

    - `const BetaManagedAgentsSessionStatusTerminated BetaManagedAgentsSessionStatus = "terminated"`

      Session has ended, either due to an error or completion.

  - `Title string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Usage BetaManagedAgentsSessionUsage`

    Cumulative token usage for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of the session across all turns, priced at public list rates. Absent until cost tracking is available for the session.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns. Absent until server-tool tracking is available for the session.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `VaultIDs []string`

    Vault IDs attached to the session at creation. Empty when no vaults were supplied.

  - `DeploymentID string Optional`

    Deployment ID when the session was created from a deployment reference. Null otherwise.

#### 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"),
	)
	betaManagedAgentsSession, err := client.Beta.Sessions.Update(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSession.ID)
}
```

##### Response (200)

```json
{
  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "description": "A general-purpose starter agent.",
    "execution_identity": {
      "type": "service_account"
    },
    "mcp_servers": [
      {
        "name": "example-mcp",
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse"
      }
    ],
    "model": {
      "id": "claude-opus-5-5",
      "effort": {
        "type": "low"
      },
      "inference_geo": "inference_geo",
      "speed": "standard"
    },
    "multiagent": {
      "agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "description": "A focused research subagent.",
          "execution_identity": {
            "type": "service_account"
          },
          "mcp_servers": [
            {
              "name": "example-mcp",
              "type": "url",
              "url": "https://example-server.modelcontextprotocol.io/sse"
            }
          ],
          "model": {
            "id": "claude-opus-5-5",
            "effort": {
              "type": "low"
            },
            "inference_geo": "inference_geo",
            "speed": "standard"
          },
          "name": "Researcher",
          "skills": [
            {
              "skill_id": "xlsx",
              "type": "anthropic",
              "version": "1"
            }
          ],
          "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
          "tools": [
            {
              "configs": [
                {
                  "enabled": true,
                  "name": "bash",
                  "permission_policy": {
                    "type": "always_allow"
                  },
                  "type": "bash"
                }
              ],
              "default_config": {
                "enabled": true,
                "permission_policy": {
                  "type": "always_ask"
                }
              },
              "type": "agent_toolset_20260401"
            }
          ],
          "type": "agent",
          "version": 1
        }
      ],
      "type": "coordinator"
    },
    "name": "My First Agent",
    "skills": [
      {
        "skill_id": "xlsx",
        "type": "anthropic",
        "version": "1"
      },
      {
        "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
        "type": "custom",
        "version": "2"
      }
    ],
    "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
    "tools": [
      {
        "configs": [
          {
            "enabled": true,
            "name": "bash",
            "permission_policy": {
              "type": "always_allow"
            },
            "type": "bash"
          }
        ],
        "default_config": {
          "enabled": true,
          "permission_policy": {
            "type": "always_ask"
          }
        },
        "type": "agent_toolset_20260401"
      }
    ],
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "metadata": {},
  "outcome_evaluations": [
    {
      "completed_at": "2026-03-15T10:02:31Z",
      "description": "Produce a 2-page summary as summary.md",
      "explanation": "All five sections present with inline citations.",
      "iteration": 0,
      "outcome_id": "outc_011CZkZRSw2kEfs6ncTVmjxP",
      "result": "satisfied",
      "type": "outcome_evaluation"
    }
  ],
  "resources": [
    {
      "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
      "created_at": "2026-03-15T10:00:00Z",
      "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "mount_path": "/uploads/receipt.pdf",
      "type": "file",
      "updated_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
      "created_at": "2026-03-15T10:00:00Z",
      "mount_path": "/workspace/example-repo",
      "type": "github_repository",
      "updated_at": "2026-03-15T10:00:00Z",
      "url": "https://github.com/example-org/example-repo",
      "checkout": {
        "name": "main",
        "type": "branch"
      }
    }
  ],
  "stats": {
    "active_seconds": 0,
    "duration_seconds": 0
  },
  "status": "idle",
  "title": "Order #1234 inquiry",
  "type": "session",
  "updated_at": "2026-03-15T10:00:00Z",
  "usage": {
    "active_seconds": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "output_tokens": 0,
    "server_tool_use": {
      "web_fetch_requests": 0,
      "web_search_requests": 3
    }
  },
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "deployment_id": "deployment_id"
}
```

### Delete Session

`client.Beta.Sessions.Delete(ctx, sessionID, body) (*BetaManagedAgentsDeletedSession, error)`

**DELETE** `/v1/sessions/{session_id}`

Delete Session

#### Parameters

- `sessionID string` (path parameter)

- `body BetaSessionDeleteParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeletedSession`

  Confirmation that a `session` has been permanently deleted.

  - `Type BetaManagedAgentsDeletedSessionType`

  - `ID string`

#### 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"),
	)
	betaManagedAgentsDeletedSession, err := client.Beta.Sessions.Delete(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeletedSession.ID)
}
```

##### Response (200)

```json
{
  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "type": "session_deleted"
}
```

### Archive Session

`client.Beta.Sessions.Archive(ctx, sessionID, body) (*BetaManagedAgentsSession, error)`

**POST** `/v1/sessions/{session_id}/archive`

Archive Session

#### Parameters

- `sessionID string` (path parameter)

- `body BetaSessionArchiveParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSession`

  A Managed Agents `session`.

  - `Type BetaManagedAgentsSessionType`

  - `ID string`

  - `Agent BetaManagedAgentsSessionAgent`

    Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.

    - `Type BetaManagedAgentsSessionAgentType`

    - `ID string`

    - `Description string`

    - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

      Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

      - `type BetaManagedAgentsAWSRoleExecutionIdentity`

        An AWS IAM role principal as returned in API responses.

        - `Type AWSRole`

        - `RoleARN string`

          The IAM role's ARN.

      - `type BetaManagedAgentsServiceAccountExecutionIdentity`

        The Anthropic-managed service account as returned in API responses.

        - `Type ServiceAccount`

    - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

      - `Type BetaManagedAgentsMCPServerURLDefinitionType`

      - `Name string`

      - `URL string`

    - `Model BetaManagedAgentsModelConfig`

      Model identifier and configuration.

      - `ID BetaManagedAgentsModel`

        The model that will power your agent.

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

        - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

          Fastest model for high-volume, real-time tasks

        - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

        - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

        - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

          Efficient model for coding and agents

        - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

        - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

          Best combination of speed and intelligence

        - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

        - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

        - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

          Powerful intelligence for long-running agents and coding

        - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

      - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

        How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

        - `type BetaManagedAgentsEffortLow`

          Low effort. Favors latency over reasoning depth.

          - `Type BetaManagedAgentsEffortLowType`

        - `type BetaManagedAgentsEffortMedium`

          Medium effort. Balances latency and reasoning depth.

          - `Type BetaManagedAgentsEffortMediumType`

        - `type BetaManagedAgentsEffortHigh`

          High effort. Favors reasoning depth.

          - `Type BetaManagedAgentsEffortHighType`

        - `type BetaManagedAgentsEffortXhigh`

          Extra-high effort. Not all models accept this level.

          - `Type BetaManagedAgentsEffortXhighType`

        - `type BetaManagedAgentsEffortMax`

          Maximum effort. Favors reasoning depth over latency.

          - `Type BetaManagedAgentsEffortMaxType`

      - `InferenceGeo string Optional`

        Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

      - `Speed BetaManagedAgentsModelConfigSpeed Optional`

        Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

        - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

        - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

    - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

      Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

      - `type BetaManagedAgentsSessionMultiagentCoordinator`

        Resolved coordinator topology with full agent definitions for each roster member.

        - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

        - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

          Full `agent` definitions the coordinator may spawn as session threads.

          - `type BetaManagedAgentsSessionThreadAgent`

            Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

            - `Type BetaManagedAgentsSessionThreadAgentType`

            - `ID string`

            - `Description string`

            - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

              Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

            - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Type BetaManagedAgentsMCPServerURLDefinitionType`

              - `Name string`

              - `URL string`

            - `Model BetaManagedAgentsModelConfig`

              Model identifier and configuration.

            - `Name string`

            - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `type BetaManagedAgentsAnthropicSkill`

                A resolved Anthropic-managed skill.

                - `Type BetaManagedAgentsAnthropicSkillType`

                - `SkillID string`

                - `Version string`

              - `type BetaManagedAgentsCustomSkill`

                A resolved user-created custom skill.

                - `Type BetaManagedAgentsCustomSkillType`

                - `SkillID string`

                - `Version string`

            - `System string`

            - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `type BetaManagedAgentsAgentToolset20260401`

                - `Type BetaManagedAgentsAgentToolset20260401Type`

                - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                  - `type BetaManagedAgentsBashToolConfig`

                    Configuration for the bash tool.

                    - `Type Bash`

                    - `Enabled bool`

                    - `Name Bash`

                    - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                        - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                        - `Type BetaManagedAgentsAlwaysAskPolicyType`

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                        - `Type Auto`

                  - `type BetaManagedAgentsEditToolConfig`

                    Configuration for the edit tool.

                    - `Type Edit`

                    - `Enabled bool`

                    - `Name Edit`

                    - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsReadToolConfig`

                    Configuration for the read tool.

                    - `Type Read`

                    - `Enabled bool`

                    - `Name Read`

                    - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWriteToolConfig`

                    Configuration for the write tool.

                    - `Type Write`

                    - `Enabled bool`

                    - `Name Write`

                    - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGlobToolConfig`

                    Configuration for the glob tool.

                    - `Type Glob`

                    - `Enabled bool`

                    - `Name Glob`

                    - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsGrepToolConfig`

                    Configuration for the grep tool.

                    - `Type Grep`

                    - `Enabled bool`

                    - `Name Grep`

                    - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `type BetaManagedAgentsWebFetchToolConfig`

                    Configuration for the web_fetch tool.

                    - `Type WebFetch`

                    - `Enabled bool`

                    - `Name WebFetch`

                    - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `URLSources BetaManagedAgentsWebFetchURLSources`

                      Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                      - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                          - `Type All`

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                          - `Type None`

                        - `type BetaManagedAgentsWebFetchURLSourceOnly`

                          Only the named tools' results contribute URLs that may be fetched.

                          - `Type Only`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                        - `type BetaManagedAgentsWebFetchURLSourceExcept`

                          Every tool's results contribute URLs that may be fetched, except the named tools' results.

                          - `Type Except`

                          - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                            The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                            - `Type ToolReference`

                              Must be "tool_reference".

                            - `Name string`

                              Name of the tool. Compared exactly, so upper and lower case letters are different.

                              minLength: 1, maxLength: 128

                      - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                        Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                      - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                        Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                        - `type BetaManagedAgentsWebFetchURLSourceAll`

                          Every URL from this source may be fetched. This is the default.

                        - `type BetaManagedAgentsWebFetchURLSourceNone`

                          This source contributes no URLs that may be fetched.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `MaxContentTokens int64 Optional`

                      format: int32

                  - `type BetaManagedAgentsWebSearchToolConfig`

                    Configuration for the web_search tool.

                    - `Type WebSearch`

                    - `Enabled bool`

                    - `Name WebSearch`

                    - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `AllowedDomains []string Optional`

                    - `BlockedDomains []string Optional`

                    - `UserLocation BetaManagedAgentsUserLocation Optional`

                      Approximate user location for search result localization.

                      - `Type Approximate`

                        Location precision. Only "approximate" is supported.

                      - `City string Optional`

                        City name.

                        minLength: 1, maxLength: 255

                      - `Country string Optional`

                        Two-letter ISO 3166-1 country code, uppercase.

                      - `Region string Optional`

                        Region or state name.

                        minLength: 1, maxLength: 255

                      - `Timezone string Optional`

                        IANA timezone identifier, e.g. "America/Los_Angeles".

                        minLength: 1, maxLength: 255

                - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                  Resolved default configuration for agent tools.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `type BetaManagedAgentsMCPToolset`

                - `Type BetaManagedAgentsMCPToolsetType`

                - `Configs []BetaManagedAgentsMCPToolConfig`

                  - `Enabled bool`

                  - `Name string`

                  - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                  Resolved default configuration for all tools from an MCP server.

                  - `Enabled bool`

                  - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                    Permission policy for tool execution.

                    - `type BetaManagedAgentsAlwaysAllowPolicy`

                      Tool calls are automatically approved without user confirmation.

                    - `type BetaManagedAgentsAlwaysAskPolicy`

                      Tool calls require user confirmation before execution.

                    - `type BetaManagedAgentsAutoPolicy`

                      The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `MCPServerName string`

              - `type BetaManagedAgentsCustomTool`

                A custom tool as returned in API responses.

                - `Type BetaManagedAgentsCustomToolType`

                - `Description string`

                - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                  JSON Schema for custom tool input parameters.

                  - `Type Object`

                  - `Properties map[string, any] Optional`

                  - `Required []string Optional`

                - `Name string`

            - `Version int64`

              format: int32

          - `type BetaManagedAgentsAdvisor`

            Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

            - `Type BetaManagedAgentsAdvisorType`

            - `Model string`

              The advisor model id.

      - `type BetaManagedAgentsSessionMultiagent20261001`

        Resolved multiagent configuration with three members, as copied to the `session` at creation.

        - `Type Multiagent20261001`

        - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

          Whether the session's primary thread can consult an advisor model.

          - `type BetaManagedAgentsMultiagentAdvisorEnabled`

            The session's primary thread can consult `model` mid-turn.

            - `Type Enabled`

            - `Model string`

              The advisor model id.

          - `type BetaManagedAgentsMultiagentAdvisorDisabled`

            The agent has no advisor.

            - `Type Disabled`

        - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

          Whether the agent can spawn session threads.

          - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

            The agent can spawn session threads.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether the agent can define inline agents, which are not saved, when it spawns session threads.

              - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                The agent can define inline agents.

                - `Type Enabled`

              - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                The agent cannot define inline agents.

                - `Type Disabled`

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentSubagentsDisabled`

            The agent cannot spawn session threads.

            - `Type Disabled`

        - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

          Whether the agent can start workflow runs.

          - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

            The agent can start workflow runs.

            - `Type Enabled`

            - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

              Whether a run's plan can define inline agents, which are not saved.

            - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

              Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

              - `Version int64`

                format: int32

          - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

            The agent cannot start workflow runs.

            - `Type Disabled`

    - `Name string`

    - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

      - `type BetaManagedAgentsAnthropicSkill`

        A resolved Anthropic-managed skill.

      - `type BetaManagedAgentsCustomSkill`

        A resolved user-created custom skill.

    - `System string`

    - `Tools []BetaManagedAgentsSessionAgentToolUnion`

      - `type BetaManagedAgentsAgentToolset20260401`

      - `type BetaManagedAgentsMCPToolset`

      - `type BetaManagedAgentsCustomTool`

        A custom tool as returned in API responses.

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    When the session was archived. Null if not archived.

    format: date-time

  - `Budget BetaManagedAgentsBudgetLimit`

    The session's enforced spend ceiling, or null when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `EnvironmentID string`

  - `Metadata map[string, string]`

  - `OutcomeEvaluations []BetaManagedAgentsOutcomeEvaluationResource`

    Per-outcome evaluation state. One entry per `define_outcome` event sent to the session.

    - `Type BetaManagedAgentsOutcomeEvaluationResourceType`

    - `CompletedAt Time`

      When the outcome reached a terminal result. Null while `pending`/`running`/`evaluating`.

      format: date-time

    - `Description string`

      What the agent should produce.

    - `Explanation string`

      Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable.

    - `Iteration int64`

      0-indexed revision cycle the outcome is currently on.

      format: int32

    - `OutcomeID string`

      Server-generated outc_ ID for this outcome.

    - `Result string`

      Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.

  - `Resources []BetaManagedAgentsSessionResourceUnion`

    - `type BetaManagedAgentsGitHubRepositoryResource`

      - `Type BetaManagedAgentsGitHubRepositoryResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `URL string`

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

    - `type BetaManagedAgentsFileResource`

      - `Type BetaManagedAgentsFileResourceType`

      - `ID string`

      - `CreatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

      - `FileID string`

      - `MountPath string`

      - `UpdatedAt Time`

        A timestamp in RFC 3339 format

        format: date-time

    - `type BetaManagedAgentsMemoryStoreResource`

      A memory store attached to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

      - `Description string Optional`

        Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

      - `MountPath string Optional`

        Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

      - `Name string Optional`

        Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

  - `Stats BetaManagedAgentsSessionStats`

    Timing statistics for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the session spent in `running` status. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

      format: double

  - `Status BetaManagedAgentsSessionStatus`

    - `const BetaManagedAgentsSessionStatusRescheduling BetaManagedAgentsSessionStatus = "rescheduling"`

      Transient error occurred, retrying automatically.

    - `const BetaManagedAgentsSessionStatusRunning BetaManagedAgentsSessionStatus = "running"`

      Agent is actively executing.

    - `const BetaManagedAgentsSessionStatusIdle BetaManagedAgentsSessionStatus = "idle"`

      Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle.

    - `const BetaManagedAgentsSessionStatusTerminated BetaManagedAgentsSessionStatus = "terminated"`

      Session has ended, either due to an error or completion.

  - `Title string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Usage BetaManagedAgentsSessionUsage`

    Cumulative token usage for the session.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of the session across all turns, priced at public list rates. Absent until cost tracking is available for the session.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns. Absent until server-tool tracking is available for the session.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `VaultIDs []string`

    Vault IDs attached to the session at creation. Empty when no vaults were supplied.

  - `DeploymentID string Optional`

    Deployment ID when the session was created from a deployment reference. Null otherwise.

#### 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"),
	)
	betaManagedAgentsSession, err := client.Beta.Sessions.Archive(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSession.ID)
}
```

##### Response (200)

```json
{
  "id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "description": "A general-purpose starter agent.",
    "execution_identity": {
      "type": "service_account"
    },
    "mcp_servers": [
      {
        "name": "example-mcp",
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse"
      }
    ],
    "model": {
      "id": "claude-opus-5-5",
      "effort": {
        "type": "low"
      },
      "inference_geo": "inference_geo",
      "speed": "standard"
    },
    "multiagent": {
      "agents": [
        {
          "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
          "description": "A focused research subagent.",
          "execution_identity": {
            "type": "service_account"
          },
          "mcp_servers": [
            {
              "name": "example-mcp",
              "type": "url",
              "url": "https://example-server.modelcontextprotocol.io/sse"
            }
          ],
          "model": {
            "id": "claude-opus-5-5",
            "effort": {
              "type": "low"
            },
            "inference_geo": "inference_geo",
            "speed": "standard"
          },
          "name": "Researcher",
          "skills": [
            {
              "skill_id": "xlsx",
              "type": "anthropic",
              "version": "1"
            }
          ],
          "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
          "tools": [
            {
              "configs": [
                {
                  "enabled": true,
                  "name": "bash",
                  "permission_policy": {
                    "type": "always_allow"
                  },
                  "type": "bash"
                }
              ],
              "default_config": {
                "enabled": true,
                "permission_policy": {
                  "type": "always_ask"
                }
              },
              "type": "agent_toolset_20260401"
            }
          ],
          "type": "agent",
          "version": 1
        }
      ],
      "type": "coordinator"
    },
    "name": "My First Agent",
    "skills": [
      {
        "skill_id": "xlsx",
        "type": "anthropic",
        "version": "1"
      },
      {
        "skill_id": "skill_011CZkZFNu9hAbo3jZPRgTmx",
        "type": "custom",
        "version": "2"
      }
    ],
    "system": "You are a general-purpose agent that can research, write code, run commands, and use connected tools to complete the user's task end to end.",
    "tools": [
      {
        "configs": [
          {
            "enabled": true,
            "name": "bash",
            "permission_policy": {
              "type": "always_allow"
            },
            "type": "bash"
          }
        ],
        "default_config": {
          "enabled": true,
          "permission_policy": {
            "type": "always_ask"
          }
        },
        "type": "agent_toolset_20260401"
      }
    ],
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "metadata": {},
  "outcome_evaluations": [
    {
      "completed_at": "2026-03-15T10:02:31Z",
      "description": "Produce a 2-page summary as summary.md",
      "explanation": "All five sections present with inline citations.",
      "iteration": 0,
      "outcome_id": "outc_011CZkZRSw2kEfs6ncTVmjxP",
      "result": "satisfied",
      "type": "outcome_evaluation"
    }
  ],
  "resources": [
    {
      "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
      "created_at": "2026-03-15T10:00:00Z",
      "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "mount_path": "/uploads/receipt.pdf",
      "type": "file",
      "updated_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
      "created_at": "2026-03-15T10:00:00Z",
      "mount_path": "/workspace/example-repo",
      "type": "github_repository",
      "updated_at": "2026-03-15T10:00:00Z",
      "url": "https://github.com/example-org/example-repo",
      "checkout": {
        "name": "main",
        "type": "branch"
      }
    }
  ],
  "stats": {
    "active_seconds": 0,
    "duration_seconds": 0
  },
  "status": "idle",
  "title": "Order #1234 inquiry",
  "type": "session",
  "updated_at": "2026-03-15T10:00:00Z",
  "usage": {
    "active_seconds": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "output_tokens": 0,
    "server_tool_use": {
      "web_fetch_requests": 0,
      "web_search_requests": 3
    }
  },
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "deployment_id": "deployment_id"
}
```

## Beta › Sessions › Events

### List Events

`client.Beta.Sessions.Events.List(ctx, sessionID, params) (*PageCursor[BetaManagedAgentsSessionEventUnion], error)`

**GET** `/v1/sessions/{session_id}/events`

List Events

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionEventListParams`

  - `CreatedAtGt param.Opt[Time] Optional` (query parameter)

    Return events created after this time (exclusive). Compared against the event's `processed_at` value.

    format: date-time

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return events created at or after this time (inclusive). Compared against the event's `processed_at` value.

    format: date-time

  - `CreatedAtLt param.Opt[Time] Optional` (query parameter)

    Return events created before this time (exclusive). Compared against the event's `processed_at` value.

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return events created at or before this time (inclusive). Compared against the event's `processed_at` value.

    format: date-time

  - `Limit param.Opt[int64] Optional` (query parameter)

    format: int32

  - `Order BetaSessionEventListParamsOrder Optional` (query parameter)

    Sort direction for results, ordered by the event's `processed_at`. Defaults to `asc` (chronological).

    - `const BetaSessionEventListParamsOrderAsc BetaSessionEventListParamsOrder = "asc"`

    - `const BetaSessionEventListParamsOrderDesc BetaSessionEventListParamsOrder = "desc"`

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor from a previous response's `next_page`.

  - `Types []BetaManagedAgentsSessionEventType Optional` (query parameter)

    Filter by event type. Values match the `type` field on returned events (for example, `user.message` or `agent.tool_use`). Omit to return all event types.

    - `const BetaManagedAgentsSessionEventTypeUserMessage BetaManagedAgentsSessionEventType = "user.message"`

    - `const BetaManagedAgentsSessionEventTypeUserInterrupt BetaManagedAgentsSessionEventType = "user.interrupt"`

    - `const BetaManagedAgentsSessionEventTypeUserToolConfirmation BetaManagedAgentsSessionEventType = "user.tool_confirmation"`

    - `const BetaManagedAgentsSessionEventTypeUserCustomToolResult BetaManagedAgentsSessionEventType = "user.custom_tool_result"`

    - `const BetaManagedAgentsSessionEventTypeAgentCustomToolUse BetaManagedAgentsSessionEventType = "agent.custom_tool_use"`

    - `const BetaManagedAgentsSessionEventTypeAgentMessage BetaManagedAgentsSessionEventType = "agent.message"`

    - `const BetaManagedAgentsSessionEventTypeAgentThinking BetaManagedAgentsSessionEventType = "agent.thinking"`

    - `const BetaManagedAgentsSessionEventTypeAgentMCPToolUse BetaManagedAgentsSessionEventType = "agent.mcp_tool_use"`

    - `const BetaManagedAgentsSessionEventTypeAgentMCPToolResult BetaManagedAgentsSessionEventType = "agent.mcp_tool_result"`

    - `const BetaManagedAgentsSessionEventTypeAgentToolUse BetaManagedAgentsSessionEventType = "agent.tool_use"`

    - `const BetaManagedAgentsSessionEventTypeAgentToolResult BetaManagedAgentsSessionEventType = "agent.tool_result"`

    - `const BetaManagedAgentsSessionEventTypeAgentThreadMessageReceived BetaManagedAgentsSessionEventType = "agent.thread_message_received"`

    - `const BetaManagedAgentsSessionEventTypeAgentThreadMessageSent BetaManagedAgentsSessionEventType = "agent.thread_message_sent"`

    - `const BetaManagedAgentsSessionEventTypeAgentThreadContextCompacted BetaManagedAgentsSessionEventType = "agent.thread_context_compacted"`

    - `const BetaManagedAgentsSessionEventTypeSessionError BetaManagedAgentsSessionEventType = "session.error"`

    - `const BetaManagedAgentsSessionEventTypeSessionStatusRescheduled BetaManagedAgentsSessionEventType = "session.status_rescheduled"`

    - `const BetaManagedAgentsSessionEventTypeSessionStatusRunning BetaManagedAgentsSessionEventType = "session.status_running"`

    - `const BetaManagedAgentsSessionEventTypeSessionStatusIdle BetaManagedAgentsSessionEventType = "session.status_idle"`

    - `const BetaManagedAgentsSessionEventTypeSessionStatusTerminated BetaManagedAgentsSessionEventType = "session.status_terminated"`

    - `const BetaManagedAgentsSessionEventTypeSessionThreadCreated BetaManagedAgentsSessionEventType = "session.thread_created"`

    - `const BetaManagedAgentsSessionEventTypeSpanOutcomeEvaluationStart BetaManagedAgentsSessionEventType = "span.outcome_evaluation_start"`

    - `const BetaManagedAgentsSessionEventTypeSpanOutcomeEvaluationEnd BetaManagedAgentsSessionEventType = "span.outcome_evaluation_end"`

    - `const BetaManagedAgentsSessionEventTypeSpanModelRequestStart BetaManagedAgentsSessionEventType = "span.model_request_start"`

    - `const BetaManagedAgentsSessionEventTypeSpanModelRequestEnd BetaManagedAgentsSessionEventType = "span.model_request_end"`

    - `const BetaManagedAgentsSessionEventTypeSpanOutcomeEvaluationOngoing BetaManagedAgentsSessionEventType = "span.outcome_evaluation_ongoing"`

    - `const BetaManagedAgentsSessionEventTypeUserDefineOutcome BetaManagedAgentsSessionEventType = "user.define_outcome"`

    - `const BetaManagedAgentsSessionEventTypeSessionThreadStatusRunning BetaManagedAgentsSessionEventType = "session.thread_status_running"`

    - `const BetaManagedAgentsSessionEventTypeSessionThreadStatusIdle BetaManagedAgentsSessionEventType = "session.thread_status_idle"`

    - `const BetaManagedAgentsSessionEventTypeSessionThreadStatusTerminated BetaManagedAgentsSessionEventType = "session.thread_status_terminated"`

    - `const BetaManagedAgentsSessionEventTypeUserToolResult BetaManagedAgentsSessionEventType = "user.tool_result"`

    - `const BetaManagedAgentsSessionEventTypeSessionThreadStatusRescheduled BetaManagedAgentsSessionEventType = "session.thread_status_rescheduled"`

    - `const BetaManagedAgentsSessionEventTypeSessionUpdated BetaManagedAgentsSessionEventType = "session.updated"`

    - `const BetaManagedAgentsSessionEventTypeSystemMessage BetaManagedAgentsSessionEventType = "system.message"`

    - `const BetaManagedAgentsSessionEventTypeSessionUsage BetaManagedAgentsSessionEventType = "session.usage"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunCreated BetaManagedAgentsSessionEventType = "workflow_run.created"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunStatusRunning BetaManagedAgentsSessionEventType = "workflow_run.status_running"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunStatusIdle BetaManagedAgentsSessionEventType = "workflow_run.status_idle"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunStatusEnded BetaManagedAgentsSessionEventType = "workflow_run.status_ended"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunError BetaManagedAgentsSessionEventType = "workflow_run.error"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunPhaseStarted BetaManagedAgentsSessionEventType = "workflow_run.phase_started"`

    - `const BetaManagedAgentsSessionEventTypeWorkflowRunPhaseEnded BetaManagedAgentsSessionEventType = "workflow_run.phase_ended"`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSessionEventUnion interface{…}`

  Union type for all event types in a session.

  - `type BetaManagedAgentsUserMessageEvent`

    A user message event in the session conversation.

    - `Type BetaManagedAgentsUserMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsUserMessageEventContentUnion`

      Array of content blocks comprising the user message.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

        - `Type BetaManagedAgentsTextBlockType`

        - `Text string`

          The text content.

          minLength: 1

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

        - `Type BetaManagedAgentsImageBlockType`

        - `Source BetaManagedAgentsImageBlockSourceUnion`

          The source of the image data.

          - `type BetaManagedAgentsBase64ImageSource`

            Base64-encoded image data.

            - `Type BetaManagedAgentsBase64ImageSourceType`

            - `Data string`

              Base64-encoded image data.

              minLength: 1

            - `MediaType string`

              MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

              minLength: 1

          - `type BetaManagedAgentsURLImageSource`

            Image referenced by URL.

            - `Type BetaManagedAgentsURLImageSourceType`

            - `URL string`

              URL of the image to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileImageSource`

            Image referenced by file ID.

            - `Type BetaManagedAgentsFileImageSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `Type BetaManagedAgentsDocumentBlockType`

        - `Source BetaManagedAgentsDocumentBlockSourceUnion`

          The source of the document data.

          - `type BetaManagedAgentsBase64DocumentSource`

            Base64-encoded document data.

            - `Type BetaManagedAgentsBase64DocumentSourceType`

            - `Data string`

              Base64-encoded document data.

              minLength: 1

            - `MediaType string`

              MIME type of the document (e.g., "application/pdf").

              minLength: 1

          - `type BetaManagedAgentsPlainTextDocumentSource`

            Plain text document content.

            - `Type BetaManagedAgentsPlainTextDocumentSourceType`

            - `Data string`

              The plain text content.

              minLength: 1

            - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

              MIME type of the text content. Must be "text/plain".

          - `type BetaManagedAgentsURLDocumentSource`

            Document referenced by URL.

            - `Type BetaManagedAgentsURLDocumentSourceType`

            - `URL string`

              URL of the document to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileDocumentSource`

            Document referenced by file ID.

            - `Type BetaManagedAgentsFileDocumentSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

        - `Context string Optional`

          Additional context about the document for the model.

        - `Title string Optional`

          The title of the document.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

        - `Type BetaManagedAgentsRedactedBlockType`

    - `ProcessedAt Time Optional`

      Timestamp when the agent finished processing this message.

      format: date-time

  - `type BetaManagedAgentsUserInterruptEvent`

    An interrupt event that pauses agent execution and returns control to the user.

    - `Type BetaManagedAgentsUserInterruptEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time Optional`

      Timestamp when the interrupt was processed.

      format: date-time

    - `SessionThreadID string Optional`

      If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

  - `type BetaManagedAgentsUserToolConfirmationEvent`

    A tool confirmation event that approves or denies a pending tool execution.

    - `Type BetaManagedAgentsUserToolConfirmationEventType`

    - `ID string`

      Unique identifier for this event.

    - `Result BetaManagedAgentsUserToolConfirmationEventResult`

      The confirmation result: 'allow' or 'deny'.

      - `const BetaManagedAgentsUserToolConfirmationEventResultAllow BetaManagedAgentsUserToolConfirmationEventResult = "allow"`

      - `const BetaManagedAgentsUserToolConfirmationEventResultDeny BetaManagedAgentsUserToolConfirmationEventResult = "deny"`

    - `ToolUseID string`

      The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `DenyMessage string Optional`

      Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

      maxLength: 10000

    - `ProcessedAt Time Optional`

      Timestamp when the confirmation was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsUserCustomToolResultEvent`

    Event sent by the client providing the result of a custom tool execution.

    - `Type BetaManagedAgentsUserCustomToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `CustomToolUseID string`

      The id of the `agent.custom_tool_use` event this result corresponds to. It is also listed in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserCustomToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

        - `Type BetaManagedAgentsSearchResultBlockType`

        - `Citations BetaManagedAgentsSearchResultCitations`

          Citation settings for this search result.

          - `Enabled bool`

            Whether citations are enabled for this search result.

        - `Content []BetaManagedAgentsSearchResultContent`

          Array of text content blocks from the search result.

          - `Type BetaManagedAgentsSearchResultContentType`

          - `Text string`

            The text content.

            minLength: 1

        - `Source string`

          The URL source of the search result.

          minLength: 1

        - `Title string`

          The title of the search result.

          minLength: 1

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsAgentCustomToolUseEvent`

    Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result. The client can send it as soon as this event arrives, without waiting for `session.status_idle`.

    - `Type BetaManagedAgentsAgentCustomToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the custom tool being called.

    - `ProcessedAt Time`

      Timestamp when this tool use was processed.

      format: date-time

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMessageEvent`

    An agent response event in the session conversation.

    - `Type BetaManagedAgentsAgentMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentMessageEventContentUnion`

      Array of text blocks comprising the agent response.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when this response was generated.

      format: date-time

  - `type BetaManagedAgentsAgentThinkingEvent`

    Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.

    - `Type BetaManagedAgentsAgentThinkingEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this thinking was produced.

      format: date-time

  - `type BetaManagedAgentsAgentMCPToolUseEvent`

    Event emitted when the agent invokes a tool provided by an MCP server.

    - `Type BetaManagedAgentsAgentMCPToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `MCPServerName string`

      Name of the MCP server providing the tool.

    - `Name string`

      Name of the MCP tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

      - `const BetaManagedAgentsAgentEvaluatedPermissionAllow BetaManagedAgentsAgentEvaluatedPermission = "allow"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionAsk BetaManagedAgentsAgentEvaluatedPermission = "ask"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionDeny BetaManagedAgentsAgentEvaluatedPermission = "deny"`

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAllow`

        The resolved permission_policy was always_allow; accompanies evaluated_permission "allow".

        - `Type AlwaysAllow`

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAsk`

        The resolved permission_policy was always_ask; accompanies evaluated_permission "ask".

        - `Type AlwaysAsk`

      - `type BetaManagedAgentsAgentToolEvaluationAuto`

        The resolved permission_policy was auto: the server judged this invocation individually.

        - `Type Auto`

        - `EvaluatedPermission BetaManagedAgentsAgentAutoEvaluatedPermissionUnion`

          The server's judgement for this invocation.

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAllow`

            The server judged the invocation safe to execute without client approval.

            - `Type Allow`

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAsk`

            The server reached no judgement; the invocation is held for client approval.

            - `Type Ask`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.

              maxLength: 64

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionDeny`

            The server judged the invocation high-risk; it does not execute and a synthetic error tool result is appended.

            - `Type Deny`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.

              maxLength: 64

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMCPToolResultEvent`

    Event representing the result of an MCP tool execution.

    - `Type BetaManagedAgentsAgentMCPToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `MCPToolUseID string`

      The id of the `agent.mcp_tool_use` event this result corresponds to.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Content []BetaManagedAgentsAgentMCPToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentToolUseEvent`

    Event emitted when the agent invokes a built-in agent tool.

    - `Type BetaManagedAgentsAgentToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the agent tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentToolResultEvent`

    Event representing the result of an agent tool execution.

    - `Type BetaManagedAgentsAgentToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to.

    - `Content []BetaManagedAgentsAgentToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentThreadMessageReceivedEvent`

    Delivery event written to the target thread's input stream when an agent-to-agent message arrives.

    - `Type BetaManagedAgentsAgentThreadMessageReceivedEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `FromSessionThreadID string`

      Public `sthr_` ID of the thread that sent the message.

    - `ProcessedAt Time`

      Timestamp when the message was received.

      format: date-time

    - `FromAgentName string Optional`

      Name of the callable agent this message came from. Absent when received from the primary agent.

  - `type BetaManagedAgentsAgentThreadMessageSentEvent`

    Observability event emitted to the sender's output stream when an agent-to-agent message is sent.

    - `Type BetaManagedAgentsAgentThreadMessageSentEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageSentEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when the message was sent.

      format: date-time

    - `ToSessionThreadID string`

      Public `sthr_` ID of the thread the message was sent to.

    - `ToAgentName string Optional`

      Name of the callable agent this message was sent to. Absent when sent to the primary agent.

  - `type BetaManagedAgentsAgentThreadContextCompactedEvent`

    Indicates that context compaction (summarization) occurred during the session.

    - `Type BetaManagedAgentsAgentThreadContextCompactedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when compaction was processed.

      format: date-time

  - `type BetaManagedAgentsSessionErrorEvent`

    An error event indicating a problem occurred during session execution.

    - `Type BetaManagedAgentsSessionErrorEventType`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsSessionErrorEventErrorUnion`

      - `type BetaManagedAgentsUnknownError`

        An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.

        - `Type BetaManagedAgentsUnknownErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsUnknownErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

            - `Type BetaManagedAgentsRetryStatusRetryingType`

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

            - `Type BetaManagedAgentsRetryStatusExhaustedType`

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

            - `Type BetaManagedAgentsRetryStatusTerminalType`

      - `type BetaManagedAgentsModelOverloadedError`

        The model is currently overloaded. Emitted after automatic retries are exhausted.

        - `Type BetaManagedAgentsModelOverloadedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelOverloadedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRateLimitedError`

        The model request was rate-limited.

        - `Type BetaManagedAgentsModelRateLimitedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRequestFailedError`

        A model request failed for a reason other than overload or rate-limiting.

        - `Type BetaManagedAgentsModelRequestFailedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPConnectionFailedError`

        Failed to connect to an MCP server.

        - `Type BetaManagedAgentsMCPConnectionFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed to connect.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPAuthenticationFailedError`

        Authentication to an MCP server failed.

        - `Type BetaManagedAgentsMCPAuthenticationFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed authentication.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsBillingError`

        The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.

        - `Type BetaManagedAgentsBillingErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsBillingErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsCredentialHostUnreachableError`

        An `environment_variable` credential's `auth.networking.allowed_hosts` includes a host the environment's network policy does not permit.

        - `Type BetaManagedAgentsCredentialHostUnreachableErrorType`

        - `CredentialID string`

          ID of the affected credential.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

        - `VaultID string`

          ID of the vault containing the affected credential.

      - `type BetaManagedAgentsRepositoryAuthenticationError`

        The repository host rejected the credentials, or required credentials and received none.

        - `Type RepositoryAuthenticationError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryAuthenticationErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryForbiddenError`

        The repository host refused access to the repository.

        - `Type RepositoryForbiddenError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryForbiddenErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryNotFoundError`

        The repository host reported the repository as not found.

        - `Type RepositoryNotFoundError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryNotFoundErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCheckoutError`

        The requested branch or commit does not exist in the repository.

        - `Type RepositoryCheckoutError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCheckoutErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCloneError`

        The repository could not be cloned.

        - `Type RepositoryCloneError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCloneErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

    - `ProcessedAt Time`

      Timestamp when the error occurred.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRescheduledEvent`

    Indicates the session is recovering from an error state and is rescheduled for execution.

    - `Type BetaManagedAgentsSessionStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRunningEvent`

    Indicates the session is actively running and the agent is working.

    - `Type BetaManagedAgentsSessionStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusIdleEvent`

    Indicates the agent has paused and is awaiting user input.

    - `Type BetaManagedAgentsSessionStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the session stopped. `null` when there is nothing more to report.

      - `Type Refusal`

      - `Category BetaManagedAgentsSessionRefusalStopDetailsCategory`

        The policy category that triggered the refusal, or `null` when there is no named category. New values can be added over time.

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryCyber BetaManagedAgentsSessionRefusalStopDetailsCategory = "cyber"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryBio BetaManagedAgentsSessionRefusalStopDetailsCategory = "bio"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryFrontierLLM BetaManagedAgentsSessionRefusalStopDetailsCategory = "frontier_llm"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryReasoningExtraction BetaManagedAgentsSessionRefusalStopDetailsCategory = "reasoning_extraction"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryGeneralHarms BetaManagedAgentsSessionRefusalStopDetailsCategory = "general_harms"`

      - `Explanation string`

        Human-readable explanation of the refusal, or `null` when none is available. The wording can change, so do not parse it.

    - `StopReason BetaManagedAgentsSessionStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

        - `Type BetaManagedAgentsSessionEndTurnType`

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

        - `Type BetaManagedAgentsSessionRequiresActionType`

        - `EventIDs []string`

          The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

        - `Type BetaManagedAgentsSessionRetriesExhaustedType`

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

        - `Type BetaManagedAgentsSessionBudgetReachedType`

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

        - `Type Refusal`

  - `type BetaManagedAgentsSessionStatusTerminatedEvent`

    Indicates the session has terminated, either due to an error or completion.

    - `Type BetaManagedAgentsSessionStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionThreadCreatedEvent`

    Emitted when a child thread is created. Written to the parent thread's output stream so clients observing the session see child creation.

    - `Type BetaManagedAgentsSessionThreadCreatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the callable agent the thread runs.

    - `ProcessedAt Time`

      Timestamp when the thread was created.

      format: date-time

    - `SessionThreadID string`

      Public `sthr_` ID of the newly created thread.

    - `WorkflowRunID string`

      Identifier of the workflow run that created the thread, or `null` for any other thread.

  - `type BetaManagedAgentsSpanOutcomeEvaluationStartEvent`

    Emitted when an outcome evaluation cycle begins.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation started.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationEndEvent`

    Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of `needs_revision` means another evaluation cycle follows; `satisfied`, `max_iterations_reached`, `failed`, or `interrupted` are terminal — no further evaluation cycles follow.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `Explanation string`

      Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeEvaluationStartID string`

      The id of the corresponding `span.outcome_evaluation_start` event.

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation ended.

      format: date-time

    - `Result string`

      Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.

    - `Usage BetaManagedAgentsSpanModelUsage`

      Aggregate token usage for this evaluation cycle. Sums across all grader model requests within the cycle.

      - `CacheCreationInputTokens int64`

        Tokens used to create prompt cache in this request.

        format: int32

      - `CacheReadInputTokens int64`

        Tokens read from prompt cache in this request.

        format: int32

      - `InputTokens int64`

        Input tokens consumed by this request.

        format: int32

      - `OutputTokens int64`

        Output tokens generated by this request.

        format: int32

      - `Speed BetaManagedAgentsSpanModelUsageSpeed Optional`

        Inference speed tier this request actually ran at. Mirrors `usage.speed` on /v1/messages. Only present when the fast-mode beta is active.

        - `const BetaManagedAgentsSpanModelUsageSpeedStandard BetaManagedAgentsSpanModelUsageSpeed = "standard"`

        - `const BetaManagedAgentsSpanModelUsageSpeedFast BetaManagedAgentsSpanModelUsageSpeed = "fast"`

  - `type BetaManagedAgentsSpanModelRequestStartEvent`

    Emitted when a model request is initiated by the agent.

    - `Type BetaManagedAgentsSpanModelRequestStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the model request started.

      format: date-time

  - `type BetaManagedAgentsSpanModelRequestEndEvent`

    Emitted when a model request completes.

    - `Type BetaManagedAgentsSpanModelRequestEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `IsError bool`

      Whether the model request resulted in an error.

    - `ModelRequestStartID string`

      The id of the corresponding `span.model_request_start` event.

    - `ModelUsage BetaManagedAgentsSpanModelUsage`

      Token usage for this model request.

    - `ProcessedAt Time`

      Timestamp when the model request completed.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding `span.outcome_evaluation_start` and `span.outcome_evaluation_end` events.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when this heartbeat was emitted.

      format: date-time

  - `type BetaManagedAgentsUserDefineOutcomeEvent`

    Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.

    - `Type BetaManagedAgentsUserDefineOutcomeEventType`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      What the agent should produce. Copied from the input event.

    - `MaxIterations int64`

      Evaluate-then-revise cycles before giving up. Default 3, max 20.

      format: int32

    - `OutcomeID string`

      Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.

    - `ProcessedAt Time`

      Timestamp when the outcome was accepted.

      format: date-time

    - `Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion`

      How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.

      - `type BetaManagedAgentsFileRubric`

        Rubric referenced by a file uploaded via the Files API.

        - `Type BetaManagedAgentsFileRubricType`

        - `FileID string`

          ID of the rubric file.

      - `type BetaManagedAgentsTextRubric`

        Rubric content provided inline as text.

        - `Type BetaManagedAgentsTextRubricType`

        - `Content string`

          Rubric content. Plain text or markdown — the grader treats it as freeform text.

  - `type BetaManagedAgentsSessionDeletedEvent`

    Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.

    - `Type BetaManagedAgentsSessionDeletedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the session was deleted.

      format: date-time

  - `type BetaManagedAgentsSessionThreadStatusRunningEvent`

    A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that started running.

  - `type BetaManagedAgentsSessionThreadStatusIdleEvent`

    A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that went idle.

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the thread stopped. `null` when there is nothing more to report.

    - `StopReason BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

  - `type BetaManagedAgentsSessionThreadStatusTerminatedEvent`

    A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that terminated.

  - `type BetaManagedAgentsUserToolResultEvent`

    Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

    - `Type BetaManagedAgentsUserToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsSessionThreadStatusRescheduledEvent`

    A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that is retrying.

  - `type BetaManagedAgentsSessionUpdatedEvent`

    Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.

    - `Type BetaManagedAgentsSessionUpdatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the update was applied.

      format: date-time

    - `Agent BetaManagedAgentsSessionAgent Optional`

      The session's effective agent configuration after the update. Present only when the update changed `agent` (tools or mcp_servers); when present it is the full materialised snapshot, not a diff.

      - `Type BetaManagedAgentsSessionAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

        Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

        - `type BetaManagedAgentsSessionMultiagentCoordinator`

          Resolved coordinator topology with full agent definitions for each roster member.

          - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

          - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

            Full `agent` definitions the coordinator may spawn as session threads.

            - `type BetaManagedAgentsSessionThreadAgent`

              Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Type BetaManagedAgentsMCPServerURLDefinitionType`

                - `Name string`

                - `URL string`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `type BetaManagedAgentsAnthropicSkill`

                  A resolved Anthropic-managed skill.

                  - `Type BetaManagedAgentsAnthropicSkillType`

                  - `SkillID string`

                  - `Version string`

                - `type BetaManagedAgentsCustomSkill`

                  A resolved user-created custom skill.

                  - `Type BetaManagedAgentsCustomSkillType`

                  - `SkillID string`

                  - `Version string`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `type BetaManagedAgentsAgentToolset20260401`

                  - `Type BetaManagedAgentsAgentToolset20260401Type`

                  - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                    - `type BetaManagedAgentsBashToolConfig`

                      Configuration for the bash tool.

                      - `Type Bash`

                      - `Enabled bool`

                      - `Name Bash`

                      - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                          - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                          - `Type BetaManagedAgentsAlwaysAskPolicyType`

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                          - `Type Auto`

                    - `type BetaManagedAgentsEditToolConfig`

                      Configuration for the edit tool.

                      - `Type Edit`

                      - `Enabled bool`

                      - `Name Edit`

                      - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsReadToolConfig`

                      Configuration for the read tool.

                      - `Type Read`

                      - `Enabled bool`

                      - `Name Read`

                      - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWriteToolConfig`

                      Configuration for the write tool.

                      - `Type Write`

                      - `Enabled bool`

                      - `Name Write`

                      - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGlobToolConfig`

                      Configuration for the glob tool.

                      - `Type Glob`

                      - `Enabled bool`

                      - `Name Glob`

                      - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGrepToolConfig`

                      Configuration for the grep tool.

                      - `Type Grep`

                      - `Enabled bool`

                      - `Name Grep`

                      - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWebFetchToolConfig`

                      Configuration for the web_fetch tool.

                      - `Type WebFetch`

                      - `Enabled bool`

                      - `Name WebFetch`

                      - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `URLSources BetaManagedAgentsWebFetchURLSources`

                        Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                        - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                            - `Type All`

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                            - `Type None`

                          - `type BetaManagedAgentsWebFetchURLSourceOnly`

                            Only the named tools' results contribute URLs that may be fetched.

                            - `Type Only`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                          - `type BetaManagedAgentsWebFetchURLSourceExcept`

                            Every tool's results contribute URLs that may be fetched, except the named tools' results.

                            - `Type Except`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                        - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                        - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                          Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `MaxContentTokens int64 Optional`

                        format: int32

                    - `type BetaManagedAgentsWebSearchToolConfig`

                      Configuration for the web_search tool.

                      - `Type WebSearch`

                      - `Enabled bool`

                      - `Name WebSearch`

                      - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `UserLocation BetaManagedAgentsUserLocation Optional`

                        Approximate user location for search result localization.

                        - `Type Approximate`

                          Location precision. Only "approximate" is supported.

                        - `City string Optional`

                          City name.

                          minLength: 1, maxLength: 255

                        - `Country string Optional`

                          Two-letter ISO 3166-1 country code, uppercase.

                        - `Region string Optional`

                          Region or state name.

                          minLength: 1, maxLength: 255

                        - `Timezone string Optional`

                          IANA timezone identifier, e.g. "America/Los_Angeles".

                          minLength: 1, maxLength: 255

                  - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                    Resolved default configuration for agent tools.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `type BetaManagedAgentsMCPToolset`

                  - `Type BetaManagedAgentsMCPToolsetType`

                  - `Configs []BetaManagedAgentsMCPToolConfig`

                    - `Enabled bool`

                    - `Name string`

                    - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                    Resolved default configuration for all tools from an MCP server.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `MCPServerName string`

                - `type BetaManagedAgentsCustomTool`

                  A custom tool as returned in API responses.

                  - `Type BetaManagedAgentsCustomToolType`

                  - `Description string`

                  - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                    JSON Schema for custom tool input parameters.

                    - `Type Object`

                    - `Properties map[string, any] Optional`

                    - `Required []string Optional`

                  - `Name string`

              - `Version int64`

                format: int32

            - `type BetaManagedAgentsAdvisor`

              Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

              - `Type BetaManagedAgentsAdvisorType`

              - `Model string`

                The advisor model id.

        - `type BetaManagedAgentsSessionMultiagent20261001`

          Resolved multiagent configuration with three members, as copied to the `session` at creation.

          - `Type Multiagent20261001`

          - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

            Whether the session's primary thread can consult an advisor model.

            - `type BetaManagedAgentsMultiagentAdvisorEnabled`

              The session's primary thread can consult `model` mid-turn.

              - `Type Enabled`

              - `Model string`

                The advisor model id.

            - `type BetaManagedAgentsMultiagentAdvisorDisabled`

              The agent has no advisor.

              - `Type Disabled`

          - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

            Whether the agent can spawn session threads.

            - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

              The agent can spawn session threads.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether the agent can define inline agents, which are not saved, when it spawns session threads.

                - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                  The agent can define inline agents.

                  - `Type Enabled`

                - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                  The agent cannot define inline agents.

                  - `Type Disabled`

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentSubagentsDisabled`

              The agent cannot spawn session threads.

              - `Type Disabled`

          - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

            Whether the agent can start workflow runs.

            - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

              The agent can start workflow runs.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether a run's plan can define inline agents, which are not saved.

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

              The agent cannot start workflow runs.

              - `Type Disabled`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsSessionAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

      - `Version int64`

        format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's budget after the update: the new budget when set or replaced, or null when the update removed it. Present only when the update changed the budget.

      - `Type BetaManagedAgentsBudgetLimitType`

      - `MaxListCost BetaMonetaryAmount`

        Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

        - `Amount string`

          Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

        - `Currency BetaCurrency`

          Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `Metadata map[string, string] Optional`

      The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.

    - `Title string Optional`

      The session's new title. Present only when the update changed it.

  - `type BetaManagedAgentsSystemMessageEvent`

    A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.

    - `Type BetaManagedAgentsSystemMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsSystemContentBlock`

      System content blocks. Text-only.

      - `Type BetaManagedAgentsSystemContentBlockType`

      - `Text string`

        The text content.

        minLength: 1

    - `ProcessedAt Time Optional`

      Timestamp when this system message was processed.

      format: date-time

  - `type BetaManagedAgentsSessionUsageEvent`

    Periodic snapshot of the session's cumulative usage and tracked list cost.

    - `Type BetaManagedAgentsSessionUsageEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the snapshot was taken.

      format: date-time

    - `Usage BetaManagedAgentsSessionUsageSnapshot`

      The session's cumulative usage at the snapshot time.

      - `ActiveSeconds float64 Optional`

        Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once. This is the duration the session's runtime cost is priced on.

        format: double

      - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

        Tokens used to create prompt cache entries, broken down by cache TTL.

        - `Ephemeral1hInputTokens int64 Optional`

          Tokens used to create 1-hour ephemeral cache entries.

          format: int32

        - `Ephemeral5mInputTokens int64 Optional`

          Tokens used to create 5-minute ephemeral cache entries.

          format: int32

      - `CacheReadInputTokens int64 Optional`

        Total tokens read from prompt cache.

        format: int32

      - `InputTokens int64 Optional`

        Total input tokens consumed across all turns.

        format: int32

      - `ListCost BetaMonetaryAmount Optional`

        Cumulative list cost of the session across all turns, priced at public list rates.

      - `OutputTokens int64 Optional`

        Total output tokens generated across all turns.

        format: int32

      - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

        Cumulative server-executed tool usage across all turns.

        - `WebFetchRequests int64 Optional`

          Number of server-executed web fetch requests.

          format: int32

        - `WebSearchRequests int64 Optional`

          Number of server-executed web search requests.

          format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's configured budget at the snapshot time, or null when the session has no budget.

  - `type BetaManagedAgentsWorkflowRunCreatedEvent`

    A workflow run was created. A workflow run is background work that the session's agent starts. Emitted once per run, before the run's other `workflow_run.*` events.

    - `Type WorkflowRunCreated`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      Description that the agent gave the run, passed on as written, or `null` if it gave none.

    - `Name string`

      Name that the agent gave the run, passed on as written, or a name that the server assigned.

    - `Phases []BetaManagedAgentsWorkflowRunPhase`

      The phases that the run's plan declares, in the plan's order. Can be empty.

      - `ID string`

        Unique identifier for the phase.

      - `Description string`

        Description that the agent gave the phase, passed on as written, or `null` if it gave none.

      - `Name string`

        Name that the agent gave the phase, passed on as written.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusEndedEvent`

    A workflow run ended. Emitted once per run, as the last of the run's `workflow_run.*` events.

    - `Type WorkflowRunStatusEnded`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Result BetaManagedAgentsWorkflowRunResultUnion`

      How the run ended.

      - `type BetaManagedAgentsWorkflowRunResultCompleted`

        The run's plan, a program that the agent wrote, finished. This does not say whether the work succeeded.

        - `Type Completed`

      - `type BetaManagedAgentsWorkflowRunResultError`

        The run failed or reached its time limit.

        - `Type Error`

        - `Error BetaManagedAgentsWorkflowRunErrorUnion`

          Why the run did not finish.

          - `type BetaManagedAgentsTimeoutWorkflowRunError`

            The run reached its time limit.

            - `Type TimeoutError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsProgramWorkflowRunError`

            The plan, a program that the agent wrote, failed, or the server refused it.

            - `Type ProgramError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsUnknownWorkflowRunError`

            A failure that has no type of its own.

            - `Type UnknownError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsThreadLimitWorkflowRunError`

            The run exceeded the limit on the number of threads that a run can create.

            - `Type ThreadLimitError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsMaxWorkflowRunsWorkflowRunError`

            No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only `workflow_run.error` carries this type.

            - `Type MaxWorkflowRunsError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

      - `type BetaManagedAgentsWorkflowRunResultStopped`

        The agent stopped the run.

        - `Type Stopped`

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunPhaseStartedEvent`

    A workflow run's plan entered a phase.

    - `Type WorkflowRunPhaseStarted`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunPhaseEndedEvent`

    A workflow run's plan left a phase, or the run's end closed it. Emitted once for every `workflow_run.phase_started` event, before the run's `workflow_run.status_ended` event. The event does not say whether the plan finished the phase's work, or why it left.

    - `Type WorkflowRunPhaseEnded`

    - `ID string`

      Unique identifier for this event.

    - `PhaseStartedID string`

      Identifier of the `workflow_run.phase_started` event that opened the phase.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunStatusRunningEvent`

    A workflow run is running. Emitted when the run starts to execute, and each time it resumes after being idle. A run that starts idle emits `workflow_run.status_idle` first.

    - `Type WorkflowRunStatusRunning`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusIdleEvent`

    A workflow run is idle. Emitted each time the run goes idle, whatever the cause. If the run ends while idle, no `workflow_run.status_running` comes between this event and its `workflow_run.status_ended`.

    - `Type WorkflowRunStatusIdle`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunErrorEvent`

    A workflow run met an error, or an error kept a run from being created. A run that ends with a `result.type` of `error` emits this event before its `workflow_run.status_ended`, with the same `error`.

    - `Type WorkflowRunError`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsWorkflowRunErrorUnion`

      Why the run did not finish, or was not created.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run that met the error, or `null` when the error kept a run from being created.

#### 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"),
	)
	page, err := client.Beta.Sessions.Events.List(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionEventListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
      "content": [
        {
          "text": "Where is my order #1234?",
          "type": "text"
        }
      ],
      "type": "user.message",
      "processed_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sevt_011CZkZHPq1jCdq5mbRTjiVn",
      "content": [
        {
          "text": "Let me look up order #1234 for you.",
          "type": "text"
        }
      ],
      "processed_at": "2026-03-15T10:00:00Z",
      "type": "agent.message"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Send Events

`client.Beta.Sessions.Events.Send(ctx, sessionID, params) (*BetaManagedAgentsSendSessionEvents, error)`

**POST** `/v1/sessions/{session_id}/events`

Send Events

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionEventSendParams`

  - `Events []BetaManagedAgentsEventParamsUnion`

    Events to send to the `session`.

    - `type BetaManagedAgentsUserMessageEventParams`

      Parameters for sending a user message to the session.

      - `Type BetaManagedAgentsUserMessageEventParamsType`

      - `Content []BetaManagedAgentsUserMessageEventParamsContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsUserInterruptEventParams`

      Parameters for sending an interrupt to pause the agent.

      - `Type BetaManagedAgentsUserInterruptEventParamsType`

      - `SessionThreadID string Optional`

        If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

    - `type BetaManagedAgentsUserToolConfirmationEventParams`

      Parameters for confirming or denying a tool execution request.

      - `Type BetaManagedAgentsUserToolConfirmationEventParamsType`

      - `Result BetaManagedAgentsUserToolConfirmationEventParamsResult`

        The confirmation result: 'allow' or 'deny'.

        - `const BetaManagedAgentsUserToolConfirmationEventParamsResultAllow BetaManagedAgentsUserToolConfirmationEventParamsResult = "allow"`

        - `const BetaManagedAgentsUserToolConfirmationEventParamsResultDeny BetaManagedAgentsUserToolConfirmationEventParamsResult = "deny"`

      - `ToolUseID string`

        The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

        minLength: 1, maxLength: 128

      - `DenyMessage string Optional`

        Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

        maxLength: 10000

    - `type BetaManagedAgentsUserCustomToolResultEventParams`

      Parameters for providing the result of a custom tool execution.

      - `Type BetaManagedAgentsUserCustomToolResultEventParamsType`

      - `CustomToolUseID string`

        The id of the `agent.custom_tool_use` event this result corresponds to. It is also listed in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

        minLength: 1, maxLength: 128

      - `Content []BetaManagedAgentsUserCustomToolResultEventParamsContentUnion Optional`

        The result content returned by the tool.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `type BetaManagedAgentsSearchResultBlock`

          A block containing a web search result.

          - `Type BetaManagedAgentsSearchResultBlockType`

          - `Citations BetaManagedAgentsSearchResultCitations`

            Citation settings for this search result.

            - `Enabled bool`

              Whether citations are enabled for this search result.

          - `Content []BetaManagedAgentsSearchResultContent`

            Array of text content blocks from the search result.

            - `Type BetaManagedAgentsSearchResultContentType`

            - `Text string`

              The text content.

              minLength: 1

          - `Source string`

            The URL source of the search result.

            minLength: 1

          - `Title string`

            The title of the search result.

            minLength: 1

      - `IsError bool Optional`

        Whether the tool execution resulted in an error.

    - `type BetaManagedAgentsUserDefineOutcomeEventParams`

      Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsUserDefineOutcomeEventParamsType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubricParams`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricParamsType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubricParams`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricParamsType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

            maxLength: 262144

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsUserToolResultEventParams`

      Parameters for providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

      - `Type BetaManagedAgentsUserToolResultEventParamsType`

      - `ToolUseID string`

        The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

        minLength: 1, maxLength: 128

      - `Content []BetaManagedAgentsUserToolResultEventParamsContentUnion Optional`

        The result content returned by the tool.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `type BetaManagedAgentsSearchResultBlock`

          A block containing a web search result.

      - `IsError bool Optional`

        Whether the tool execution resulted in an error.

    - `type BetaManagedAgentsSystemMessageEventParams`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the `user.message`, `user.tool_result`, or `user.custom_tool_result` it accompanies. Only supported on models that accept mid-conversation system messages.

      - `Type BetaManagedAgentsSystemMessageEventParamsType`

      - `Content []BetaManagedAgentsSystemContentBlockParam`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSendSessionEvents`

  Events that were successfully sent to the session.

  - `Data []BetaManagedAgentsSendSessionEventsDataUnion Optional`

    Sent events

    - `type BetaManagedAgentsUserMessageEvent`

      A user message event in the session conversation.

      - `Type BetaManagedAgentsUserMessageEventType`

      - `ID string`

        Unique identifier for this event.

      - `Content []BetaManagedAgentsUserMessageEventContentUnion`

        Array of content blocks comprising the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

      - `ProcessedAt Time Optional`

        Timestamp when the agent finished processing this message.

        format: date-time

    - `type BetaManagedAgentsUserInterruptEvent`

      An interrupt event that pauses agent execution and returns control to the user.

      - `Type BetaManagedAgentsUserInterruptEventType`

      - `ID string`

        Unique identifier for this event.

      - `ProcessedAt Time Optional`

        Timestamp when the interrupt was processed.

        format: date-time

      - `SessionThreadID string Optional`

        If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

    - `type BetaManagedAgentsUserToolConfirmationEvent`

      A tool confirmation event that approves or denies a pending tool execution.

      - `Type BetaManagedAgentsUserToolConfirmationEventType`

      - `ID string`

        Unique identifier for this event.

      - `Result BetaManagedAgentsUserToolConfirmationEventResult`

        The confirmation result: 'allow' or 'deny'.

        - `const BetaManagedAgentsUserToolConfirmationEventResultAllow BetaManagedAgentsUserToolConfirmationEventResult = "allow"`

        - `const BetaManagedAgentsUserToolConfirmationEventResultDeny BetaManagedAgentsUserToolConfirmationEventResult = "deny"`

      - `ToolUseID string`

        The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

      - `DenyMessage string Optional`

        Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

        maxLength: 10000

      - `ProcessedAt Time Optional`

        Timestamp when the confirmation was processed.

        format: date-time

      - `SessionThreadID string Optional`

        Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread.

    - `type BetaManagedAgentsUserCustomToolResultEvent`

      Event sent by the client providing the result of a custom tool execution.

      - `Type BetaManagedAgentsUserCustomToolResultEventType`

      - `ID string`

        Unique identifier for this event.

      - `CustomToolUseID string`

        The id of the `agent.custom_tool_use` event this result corresponds to. It is also listed in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

      - `Content []BetaManagedAgentsUserCustomToolResultEventContentUnion Optional`

        The result content returned by the tool.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `type BetaManagedAgentsSearchResultBlock`

          A block containing a web search result.

          - `Type BetaManagedAgentsSearchResultBlockType`

          - `Citations BetaManagedAgentsSearchResultCitations`

            Citation settings for this search result.

            - `Enabled bool`

              Whether citations are enabled for this search result.

          - `Content []BetaManagedAgentsSearchResultContent`

            Array of text content blocks from the search result.

            - `Type BetaManagedAgentsSearchResultContentType`

            - `Text string`

              The text content.

              minLength: 1

          - `Source string`

            The URL source of the search result.

            minLength: 1

          - `Title string`

            The title of the search result.

            minLength: 1

      - `IsError bool Optional`

        Whether the tool execution resulted in an error.

      - `ProcessedAt Time Optional`

        Timestamp when this result was processed.

        format: date-time

      - `SessionThreadID string Optional`

        Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

    - `type BetaManagedAgentsUserDefineOutcomeEvent`

      Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.

      - `Type BetaManagedAgentsUserDefineOutcomeEventType`

      - `ID string`

        Unique identifier for this event.

      - `Description string`

        What the agent should produce. Copied from the input event.

      - `MaxIterations int64`

        Evaluate-then-revise cycles before giving up. Default 3, max 20.

        format: int32

      - `OutcomeID string`

        Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.

      - `ProcessedAt Time`

        Timestamp when the outcome was accepted.

        format: date-time

      - `Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

    - `type BetaManagedAgentsUserToolResultEvent`

      Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

      - `Type BetaManagedAgentsUserToolResultEventType`

      - `ID string`

        Unique identifier for this event.

      - `ToolUseID string`

        The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

      - `Content []BetaManagedAgentsUserToolResultEventContentUnion Optional`

        The result content returned by the tool.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `type BetaManagedAgentsSearchResultBlock`

          A block containing a web search result.

      - `IsError bool Optional`

        Whether the tool execution resulted in an error.

      - `ProcessedAt Time Optional`

        Timestamp when this result was processed.

        format: date-time

      - `SessionThreadID string Optional`

        Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

    - `type BetaManagedAgentsSystemMessageEvent`

      A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.

      - `Type BetaManagedAgentsSystemMessageEventType`

      - `ID string`

        Unique identifier for this event.

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

      - `ProcessedAt Time Optional`

        Timestamp when this system message was processed.

        format: date-time

#### 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"),
	)
	betaManagedAgentsSendSessionEvents, err := client.Beta.Sessions.Events.Send(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionEventSendParams{
			Events: []anthropic.BetaManagedAgentsEventParamsUnion{anthropic.BetaManagedAgentsEventParamsUnion{
				OfUserMessage: &anthropic.BetaManagedAgentsUserMessageEventParams{
					Content: []anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{
						OfText: &anthropic.BetaManagedAgentsTextBlockParam{
							Text: "Where is my order #1234?",
							Type: anthropic.BetaManagedAgentsTextBlockTypeText,
						},
					}},
					Type: anthropic.BetaManagedAgentsUserMessageEventParamsTypeUserMessage,
				},
			}},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSendSessionEvents.Data)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
      "content": [
        {
          "text": "Where is my order #1234?",
          "type": "text"
        }
      ],
      "type": "user.message",
      "processed_at": "2026-03-15T10:00:00Z"
    }
  ]
}
```

### Stream Events

`client.Beta.Sessions.Events.StreamEvents(ctx, sessionID, params) *ssestream.Stream[BetaManagedAgentsStreamSessionEventsUnion]`

**GET** `/v1/sessions/{session_id}/events/stream`

Stream Events

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionEventStreamParams`

  - `EventDeltas []BetaManagedAgentsDeltaType Optional` (query parameter)

    When set, this connection also receives streaming deltas (`event_start`, `event_delta`) while an event is being produced, before the event itself arrives. Deltas are best-effort; when the final event is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no final event — its terminal `span.model_request_end` closes the preview. Accepts one or more event types to preview and may be repeated: `agent.message` streams `content_delta` fragments; `agent.thinking` is start-only — a signal that the agent has begun extended thinking, concluded by the `agent.thinking` event itself. Only previews of the requested event types are sent.

    - `const BetaManagedAgentsDeltaTypeAgentMessage BetaManagedAgentsDeltaType = "agent.message"`

    - `const BetaManagedAgentsDeltaTypeAgentThinking BetaManagedAgentsDeltaType = "agent.thinking"`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsStreamSessionEventsUnion interface{…}`

  Server-sent event in the session stream.

  - `type BetaManagedAgentsUserMessageEvent`

    A user message event in the session conversation.

    - `Type BetaManagedAgentsUserMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsUserMessageEventContentUnion`

      Array of content blocks comprising the user message.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

        - `Type BetaManagedAgentsTextBlockType`

        - `Text string`

          The text content.

          minLength: 1

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

        - `Type BetaManagedAgentsImageBlockType`

        - `Source BetaManagedAgentsImageBlockSourceUnion`

          The source of the image data.

          - `type BetaManagedAgentsBase64ImageSource`

            Base64-encoded image data.

            - `Type BetaManagedAgentsBase64ImageSourceType`

            - `Data string`

              Base64-encoded image data.

              minLength: 1

            - `MediaType string`

              MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

              minLength: 1

          - `type BetaManagedAgentsURLImageSource`

            Image referenced by URL.

            - `Type BetaManagedAgentsURLImageSourceType`

            - `URL string`

              URL of the image to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileImageSource`

            Image referenced by file ID.

            - `Type BetaManagedAgentsFileImageSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `Type BetaManagedAgentsDocumentBlockType`

        - `Source BetaManagedAgentsDocumentBlockSourceUnion`

          The source of the document data.

          - `type BetaManagedAgentsBase64DocumentSource`

            Base64-encoded document data.

            - `Type BetaManagedAgentsBase64DocumentSourceType`

            - `Data string`

              Base64-encoded document data.

              minLength: 1

            - `MediaType string`

              MIME type of the document (e.g., "application/pdf").

              minLength: 1

          - `type BetaManagedAgentsPlainTextDocumentSource`

            Plain text document content.

            - `Type BetaManagedAgentsPlainTextDocumentSourceType`

            - `Data string`

              The plain text content.

              minLength: 1

            - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

              MIME type of the text content. Must be "text/plain".

          - `type BetaManagedAgentsURLDocumentSource`

            Document referenced by URL.

            - `Type BetaManagedAgentsURLDocumentSourceType`

            - `URL string`

              URL of the document to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileDocumentSource`

            Document referenced by file ID.

            - `Type BetaManagedAgentsFileDocumentSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

        - `Context string Optional`

          Additional context about the document for the model.

        - `Title string Optional`

          The title of the document.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

        - `Type BetaManagedAgentsRedactedBlockType`

    - `ProcessedAt Time Optional`

      Timestamp when the agent finished processing this message.

      format: date-time

  - `type BetaManagedAgentsUserInterruptEvent`

    An interrupt event that pauses agent execution and returns control to the user.

    - `Type BetaManagedAgentsUserInterruptEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time Optional`

      Timestamp when the interrupt was processed.

      format: date-time

    - `SessionThreadID string Optional`

      If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

  - `type BetaManagedAgentsUserToolConfirmationEvent`

    A tool confirmation event that approves or denies a pending tool execution.

    - `Type BetaManagedAgentsUserToolConfirmationEventType`

    - `ID string`

      Unique identifier for this event.

    - `Result BetaManagedAgentsUserToolConfirmationEventResult`

      The confirmation result: 'allow' or 'deny'.

      - `const BetaManagedAgentsUserToolConfirmationEventResultAllow BetaManagedAgentsUserToolConfirmationEventResult = "allow"`

      - `const BetaManagedAgentsUserToolConfirmationEventResultDeny BetaManagedAgentsUserToolConfirmationEventResult = "deny"`

    - `ToolUseID string`

      The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `DenyMessage string Optional`

      Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

      maxLength: 10000

    - `ProcessedAt Time Optional`

      Timestamp when the confirmation was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsUserCustomToolResultEvent`

    Event sent by the client providing the result of a custom tool execution.

    - `Type BetaManagedAgentsUserCustomToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `CustomToolUseID string`

      The id of the `agent.custom_tool_use` event this result corresponds to. It is also listed in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserCustomToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

        - `Type BetaManagedAgentsSearchResultBlockType`

        - `Citations BetaManagedAgentsSearchResultCitations`

          Citation settings for this search result.

          - `Enabled bool`

            Whether citations are enabled for this search result.

        - `Content []BetaManagedAgentsSearchResultContent`

          Array of text content blocks from the search result.

          - `Type BetaManagedAgentsSearchResultContentType`

          - `Text string`

            The text content.

            minLength: 1

        - `Source string`

          The URL source of the search result.

          minLength: 1

        - `Title string`

          The title of the search result.

          minLength: 1

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsAgentCustomToolUseEvent`

    Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result. The client can send it as soon as this event arrives, without waiting for `session.status_idle`.

    - `Type BetaManagedAgentsAgentCustomToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the custom tool being called.

    - `ProcessedAt Time`

      Timestamp when this tool use was processed.

      format: date-time

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMessageEvent`

    An agent response event in the session conversation.

    - `Type BetaManagedAgentsAgentMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentMessageEventContentUnion`

      Array of text blocks comprising the agent response.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when this response was generated.

      format: date-time

  - `type BetaManagedAgentsAgentThinkingEvent`

    Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.

    - `Type BetaManagedAgentsAgentThinkingEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this thinking was produced.

      format: date-time

  - `type BetaManagedAgentsAgentMCPToolUseEvent`

    Event emitted when the agent invokes a tool provided by an MCP server.

    - `Type BetaManagedAgentsAgentMCPToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `MCPServerName string`

      Name of the MCP server providing the tool.

    - `Name string`

      Name of the MCP tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

      - `const BetaManagedAgentsAgentEvaluatedPermissionAllow BetaManagedAgentsAgentEvaluatedPermission = "allow"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionAsk BetaManagedAgentsAgentEvaluatedPermission = "ask"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionDeny BetaManagedAgentsAgentEvaluatedPermission = "deny"`

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAllow`

        The resolved permission_policy was always_allow; accompanies evaluated_permission "allow".

        - `Type AlwaysAllow`

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAsk`

        The resolved permission_policy was always_ask; accompanies evaluated_permission "ask".

        - `Type AlwaysAsk`

      - `type BetaManagedAgentsAgentToolEvaluationAuto`

        The resolved permission_policy was auto: the server judged this invocation individually.

        - `Type Auto`

        - `EvaluatedPermission BetaManagedAgentsAgentAutoEvaluatedPermissionUnion`

          The server's judgement for this invocation.

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAllow`

            The server judged the invocation safe to execute without client approval.

            - `Type Allow`

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAsk`

            The server reached no judgement; the invocation is held for client approval.

            - `Type Ask`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.

              maxLength: 64

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionDeny`

            The server judged the invocation high-risk; it does not execute and a synthetic error tool result is appended.

            - `Type Deny`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.

              maxLength: 64

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMCPToolResultEvent`

    Event representing the result of an MCP tool execution.

    - `Type BetaManagedAgentsAgentMCPToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `MCPToolUseID string`

      The id of the `agent.mcp_tool_use` event this result corresponds to.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Content []BetaManagedAgentsAgentMCPToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentToolUseEvent`

    Event emitted when the agent invokes a built-in agent tool.

    - `Type BetaManagedAgentsAgentToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the agent tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentToolResultEvent`

    Event representing the result of an agent tool execution.

    - `Type BetaManagedAgentsAgentToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to.

    - `Content []BetaManagedAgentsAgentToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentThreadMessageReceivedEvent`

    Delivery event written to the target thread's input stream when an agent-to-agent message arrives.

    - `Type BetaManagedAgentsAgentThreadMessageReceivedEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `FromSessionThreadID string`

      Public `sthr_` ID of the thread that sent the message.

    - `ProcessedAt Time`

      Timestamp when the message was received.

      format: date-time

    - `FromAgentName string Optional`

      Name of the callable agent this message came from. Absent when received from the primary agent.

  - `type BetaManagedAgentsAgentThreadMessageSentEvent`

    Observability event emitted to the sender's output stream when an agent-to-agent message is sent.

    - `Type BetaManagedAgentsAgentThreadMessageSentEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageSentEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when the message was sent.

      format: date-time

    - `ToSessionThreadID string`

      Public `sthr_` ID of the thread the message was sent to.

    - `ToAgentName string Optional`

      Name of the callable agent this message was sent to. Absent when sent to the primary agent.

  - `type BetaManagedAgentsAgentThreadContextCompactedEvent`

    Indicates that context compaction (summarization) occurred during the session.

    - `Type BetaManagedAgentsAgentThreadContextCompactedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when compaction was processed.

      format: date-time

  - `type BetaManagedAgentsSessionErrorEvent`

    An error event indicating a problem occurred during session execution.

    - `Type BetaManagedAgentsSessionErrorEventType`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsSessionErrorEventErrorUnion`

      - `type BetaManagedAgentsUnknownError`

        An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.

        - `Type BetaManagedAgentsUnknownErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsUnknownErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

            - `Type BetaManagedAgentsRetryStatusRetryingType`

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

            - `Type BetaManagedAgentsRetryStatusExhaustedType`

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

            - `Type BetaManagedAgentsRetryStatusTerminalType`

      - `type BetaManagedAgentsModelOverloadedError`

        The model is currently overloaded. Emitted after automatic retries are exhausted.

        - `Type BetaManagedAgentsModelOverloadedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelOverloadedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRateLimitedError`

        The model request was rate-limited.

        - `Type BetaManagedAgentsModelRateLimitedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRequestFailedError`

        A model request failed for a reason other than overload or rate-limiting.

        - `Type BetaManagedAgentsModelRequestFailedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPConnectionFailedError`

        Failed to connect to an MCP server.

        - `Type BetaManagedAgentsMCPConnectionFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed to connect.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPAuthenticationFailedError`

        Authentication to an MCP server failed.

        - `Type BetaManagedAgentsMCPAuthenticationFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed authentication.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsBillingError`

        The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.

        - `Type BetaManagedAgentsBillingErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsBillingErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsCredentialHostUnreachableError`

        An `environment_variable` credential's `auth.networking.allowed_hosts` includes a host the environment's network policy does not permit.

        - `Type BetaManagedAgentsCredentialHostUnreachableErrorType`

        - `CredentialID string`

          ID of the affected credential.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

        - `VaultID string`

          ID of the vault containing the affected credential.

      - `type BetaManagedAgentsRepositoryAuthenticationError`

        The repository host rejected the credentials, or required credentials and received none.

        - `Type RepositoryAuthenticationError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryAuthenticationErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryForbiddenError`

        The repository host refused access to the repository.

        - `Type RepositoryForbiddenError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryForbiddenErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryNotFoundError`

        The repository host reported the repository as not found.

        - `Type RepositoryNotFoundError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryNotFoundErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCheckoutError`

        The requested branch or commit does not exist in the repository.

        - `Type RepositoryCheckoutError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCheckoutErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCloneError`

        The repository could not be cloned.

        - `Type RepositoryCloneError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCloneErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

    - `ProcessedAt Time`

      Timestamp when the error occurred.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRescheduledEvent`

    Indicates the session is recovering from an error state and is rescheduled for execution.

    - `Type BetaManagedAgentsSessionStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRunningEvent`

    Indicates the session is actively running and the agent is working.

    - `Type BetaManagedAgentsSessionStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusIdleEvent`

    Indicates the agent has paused and is awaiting user input.

    - `Type BetaManagedAgentsSessionStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the session stopped. `null` when there is nothing more to report.

      - `Type Refusal`

      - `Category BetaManagedAgentsSessionRefusalStopDetailsCategory`

        The policy category that triggered the refusal, or `null` when there is no named category. New values can be added over time.

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryCyber BetaManagedAgentsSessionRefusalStopDetailsCategory = "cyber"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryBio BetaManagedAgentsSessionRefusalStopDetailsCategory = "bio"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryFrontierLLM BetaManagedAgentsSessionRefusalStopDetailsCategory = "frontier_llm"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryReasoningExtraction BetaManagedAgentsSessionRefusalStopDetailsCategory = "reasoning_extraction"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryGeneralHarms BetaManagedAgentsSessionRefusalStopDetailsCategory = "general_harms"`

      - `Explanation string`

        Human-readable explanation of the refusal, or `null` when none is available. The wording can change, so do not parse it.

    - `StopReason BetaManagedAgentsSessionStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

        - `Type BetaManagedAgentsSessionEndTurnType`

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

        - `Type BetaManagedAgentsSessionRequiresActionType`

        - `EventIDs []string`

          The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

        - `Type BetaManagedAgentsSessionRetriesExhaustedType`

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

        - `Type BetaManagedAgentsSessionBudgetReachedType`

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

        - `Type Refusal`

  - `type BetaManagedAgentsSessionStatusTerminatedEvent`

    Indicates the session has terminated, either due to an error or completion.

    - `Type BetaManagedAgentsSessionStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionThreadCreatedEvent`

    Emitted when a child thread is created. Written to the parent thread's output stream so clients observing the session see child creation.

    - `Type BetaManagedAgentsSessionThreadCreatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the callable agent the thread runs.

    - `ProcessedAt Time`

      Timestamp when the thread was created.

      format: date-time

    - `SessionThreadID string`

      Public `sthr_` ID of the newly created thread.

    - `WorkflowRunID string`

      Identifier of the workflow run that created the thread, or `null` for any other thread.

  - `type BetaManagedAgentsSpanOutcomeEvaluationStartEvent`

    Emitted when an outcome evaluation cycle begins.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation started.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationEndEvent`

    Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of `needs_revision` means another evaluation cycle follows; `satisfied`, `max_iterations_reached`, `failed`, or `interrupted` are terminal — no further evaluation cycles follow.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `Explanation string`

      Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeEvaluationStartID string`

      The id of the corresponding `span.outcome_evaluation_start` event.

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation ended.

      format: date-time

    - `Result string`

      Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.

    - `Usage BetaManagedAgentsSpanModelUsage`

      Aggregate token usage for this evaluation cycle. Sums across all grader model requests within the cycle.

      - `CacheCreationInputTokens int64`

        Tokens used to create prompt cache in this request.

        format: int32

      - `CacheReadInputTokens int64`

        Tokens read from prompt cache in this request.

        format: int32

      - `InputTokens int64`

        Input tokens consumed by this request.

        format: int32

      - `OutputTokens int64`

        Output tokens generated by this request.

        format: int32

      - `Speed BetaManagedAgentsSpanModelUsageSpeed Optional`

        Inference speed tier this request actually ran at. Mirrors `usage.speed` on /v1/messages. Only present when the fast-mode beta is active.

        - `const BetaManagedAgentsSpanModelUsageSpeedStandard BetaManagedAgentsSpanModelUsageSpeed = "standard"`

        - `const BetaManagedAgentsSpanModelUsageSpeedFast BetaManagedAgentsSpanModelUsageSpeed = "fast"`

  - `type BetaManagedAgentsSpanModelRequestStartEvent`

    Emitted when a model request is initiated by the agent.

    - `Type BetaManagedAgentsSpanModelRequestStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the model request started.

      format: date-time

  - `type BetaManagedAgentsSpanModelRequestEndEvent`

    Emitted when a model request completes.

    - `Type BetaManagedAgentsSpanModelRequestEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `IsError bool`

      Whether the model request resulted in an error.

    - `ModelRequestStartID string`

      The id of the corresponding `span.model_request_start` event.

    - `ModelUsage BetaManagedAgentsSpanModelUsage`

      Token usage for this model request.

    - `ProcessedAt Time`

      Timestamp when the model request completed.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding `span.outcome_evaluation_start` and `span.outcome_evaluation_end` events.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when this heartbeat was emitted.

      format: date-time

  - `type BetaManagedAgentsUserDefineOutcomeEvent`

    Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.

    - `Type BetaManagedAgentsUserDefineOutcomeEventType`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      What the agent should produce. Copied from the input event.

    - `MaxIterations int64`

      Evaluate-then-revise cycles before giving up. Default 3, max 20.

      format: int32

    - `OutcomeID string`

      Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.

    - `ProcessedAt Time`

      Timestamp when the outcome was accepted.

      format: date-time

    - `Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion`

      How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.

      - `type BetaManagedAgentsFileRubric`

        Rubric referenced by a file uploaded via the Files API.

        - `Type BetaManagedAgentsFileRubricType`

        - `FileID string`

          ID of the rubric file.

      - `type BetaManagedAgentsTextRubric`

        Rubric content provided inline as text.

        - `Type BetaManagedAgentsTextRubricType`

        - `Content string`

          Rubric content. Plain text or markdown — the grader treats it as freeform text.

  - `type BetaManagedAgentsSessionDeletedEvent`

    Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.

    - `Type BetaManagedAgentsSessionDeletedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the session was deleted.

      format: date-time

  - `type BetaManagedAgentsSessionThreadStatusRunningEvent`

    A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that started running.

  - `type BetaManagedAgentsSessionThreadStatusIdleEvent`

    A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that went idle.

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the thread stopped. `null` when there is nothing more to report.

    - `StopReason BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

  - `type BetaManagedAgentsSessionThreadStatusTerminatedEvent`

    A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that terminated.

  - `type BetaManagedAgentsUserToolResultEvent`

    Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

    - `Type BetaManagedAgentsUserToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsSessionThreadStatusRescheduledEvent`

    A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that is retrying.

  - `type BetaManagedAgentsSessionUpdatedEvent`

    Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.

    - `Type BetaManagedAgentsSessionUpdatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the update was applied.

      format: date-time

    - `Agent BetaManagedAgentsSessionAgent Optional`

      The session's effective agent configuration after the update. Present only when the update changed `agent` (tools or mcp_servers); when present it is the full materialised snapshot, not a diff.

      - `Type BetaManagedAgentsSessionAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

        Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

        - `type BetaManagedAgentsSessionMultiagentCoordinator`

          Resolved coordinator topology with full agent definitions for each roster member.

          - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

          - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

            Full `agent` definitions the coordinator may spawn as session threads.

            - `type BetaManagedAgentsSessionThreadAgent`

              Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Type BetaManagedAgentsMCPServerURLDefinitionType`

                - `Name string`

                - `URL string`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `type BetaManagedAgentsAnthropicSkill`

                  A resolved Anthropic-managed skill.

                  - `Type BetaManagedAgentsAnthropicSkillType`

                  - `SkillID string`

                  - `Version string`

                - `type BetaManagedAgentsCustomSkill`

                  A resolved user-created custom skill.

                  - `Type BetaManagedAgentsCustomSkillType`

                  - `SkillID string`

                  - `Version string`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `type BetaManagedAgentsAgentToolset20260401`

                  - `Type BetaManagedAgentsAgentToolset20260401Type`

                  - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                    - `type BetaManagedAgentsBashToolConfig`

                      Configuration for the bash tool.

                      - `Type Bash`

                      - `Enabled bool`

                      - `Name Bash`

                      - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                          - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                          - `Type BetaManagedAgentsAlwaysAskPolicyType`

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                          - `Type Auto`

                    - `type BetaManagedAgentsEditToolConfig`

                      Configuration for the edit tool.

                      - `Type Edit`

                      - `Enabled bool`

                      - `Name Edit`

                      - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsReadToolConfig`

                      Configuration for the read tool.

                      - `Type Read`

                      - `Enabled bool`

                      - `Name Read`

                      - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWriteToolConfig`

                      Configuration for the write tool.

                      - `Type Write`

                      - `Enabled bool`

                      - `Name Write`

                      - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGlobToolConfig`

                      Configuration for the glob tool.

                      - `Type Glob`

                      - `Enabled bool`

                      - `Name Glob`

                      - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGrepToolConfig`

                      Configuration for the grep tool.

                      - `Type Grep`

                      - `Enabled bool`

                      - `Name Grep`

                      - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWebFetchToolConfig`

                      Configuration for the web_fetch tool.

                      - `Type WebFetch`

                      - `Enabled bool`

                      - `Name WebFetch`

                      - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `URLSources BetaManagedAgentsWebFetchURLSources`

                        Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                        - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                            - `Type All`

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                            - `Type None`

                          - `type BetaManagedAgentsWebFetchURLSourceOnly`

                            Only the named tools' results contribute URLs that may be fetched.

                            - `Type Only`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                          - `type BetaManagedAgentsWebFetchURLSourceExcept`

                            Every tool's results contribute URLs that may be fetched, except the named tools' results.

                            - `Type Except`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                        - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                        - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                          Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `MaxContentTokens int64 Optional`

                        format: int32

                    - `type BetaManagedAgentsWebSearchToolConfig`

                      Configuration for the web_search tool.

                      - `Type WebSearch`

                      - `Enabled bool`

                      - `Name WebSearch`

                      - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `UserLocation BetaManagedAgentsUserLocation Optional`

                        Approximate user location for search result localization.

                        - `Type Approximate`

                          Location precision. Only "approximate" is supported.

                        - `City string Optional`

                          City name.

                          minLength: 1, maxLength: 255

                        - `Country string Optional`

                          Two-letter ISO 3166-1 country code, uppercase.

                        - `Region string Optional`

                          Region or state name.

                          minLength: 1, maxLength: 255

                        - `Timezone string Optional`

                          IANA timezone identifier, e.g. "America/Los_Angeles".

                          minLength: 1, maxLength: 255

                  - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                    Resolved default configuration for agent tools.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `type BetaManagedAgentsMCPToolset`

                  - `Type BetaManagedAgentsMCPToolsetType`

                  - `Configs []BetaManagedAgentsMCPToolConfig`

                    - `Enabled bool`

                    - `Name string`

                    - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                    Resolved default configuration for all tools from an MCP server.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `MCPServerName string`

                - `type BetaManagedAgentsCustomTool`

                  A custom tool as returned in API responses.

                  - `Type BetaManagedAgentsCustomToolType`

                  - `Description string`

                  - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                    JSON Schema for custom tool input parameters.

                    - `Type Object`

                    - `Properties map[string, any] Optional`

                    - `Required []string Optional`

                  - `Name string`

              - `Version int64`

                format: int32

            - `type BetaManagedAgentsAdvisor`

              Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

              - `Type BetaManagedAgentsAdvisorType`

              - `Model string`

                The advisor model id.

        - `type BetaManagedAgentsSessionMultiagent20261001`

          Resolved multiagent configuration with three members, as copied to the `session` at creation.

          - `Type Multiagent20261001`

          - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

            Whether the session's primary thread can consult an advisor model.

            - `type BetaManagedAgentsMultiagentAdvisorEnabled`

              The session's primary thread can consult `model` mid-turn.

              - `Type Enabled`

              - `Model string`

                The advisor model id.

            - `type BetaManagedAgentsMultiagentAdvisorDisabled`

              The agent has no advisor.

              - `Type Disabled`

          - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

            Whether the agent can spawn session threads.

            - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

              The agent can spawn session threads.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether the agent can define inline agents, which are not saved, when it spawns session threads.

                - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                  The agent can define inline agents.

                  - `Type Enabled`

                - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                  The agent cannot define inline agents.

                  - `Type Disabled`

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentSubagentsDisabled`

              The agent cannot spawn session threads.

              - `Type Disabled`

          - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

            Whether the agent can start workflow runs.

            - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

              The agent can start workflow runs.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether a run's plan can define inline agents, which are not saved.

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

              The agent cannot start workflow runs.

              - `Type Disabled`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsSessionAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

      - `Version int64`

        format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's budget after the update: the new budget when set or replaced, or null when the update removed it. Present only when the update changed the budget.

      - `Type BetaManagedAgentsBudgetLimitType`

      - `MaxListCost BetaMonetaryAmount`

        Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

        - `Amount string`

          Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

        - `Currency BetaCurrency`

          Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `Metadata map[string, string] Optional`

      The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.

    - `Title string Optional`

      The session's new title. Present only when the update changed it.

  - `type BetaManagedAgentsStartEvent`

    Opens a preview of a buffered event. Carries the previewed event's type and id only. Followed by zero or more event_delta events with the same event id, normally concluded by the buffered event carrying that id. If the producing model request ends without that event (an error or interrupt mid-stream), its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

    - `Type BetaManagedAgentsStartEventType`

    - `Event BetaManagedAgentsStartEventPreviewUnion`

      The previewed event's type and id. The event type determines which delta types the preview's event_delta events carry: agent.message events stream content_delta fragments; agent.thinking previews are start-only — no deltas follow, and the buffered agent.thinking with the same id concludes them.

      - `type BetaManagedAgentsAgentMessagePreview`

        - `Type BetaManagedAgentsAgentMessagePreviewType`

        - `ID string`

          The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

      - `type BetaManagedAgentsAgentThinkingPreview`

        - `Type BetaManagedAgentsAgentThinkingPreviewType`

        - `ID string`

          The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

  - `type BetaManagedAgentsDeltaEvent`

    An incremental update to an event that is still being streamed. Deltas are best-effort and may stop early; when the buffered event with id == event_id is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no buffered event — its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

    - `Type BetaManagedAgentsDeltaEventType`

    - `Delta BetaManagedAgentsDeltaContent`

      One fragment of the previewed event. The delta type is named for the previewed event's field it streams into: agent.message events stream content_delta fragments, each a partial element of the content array.

      - `Type BetaManagedAgentsDeltaContentType`

      - `Content BetaManagedAgentsTextBlock`

        A partial element of the content array at index, typed like the element itself — the same shape the buffered agent.message carries in content.

      - `Index int64 Optional`

        Which entry in the previewed event's content array this fragment lands in. Insert content as that entry when the index is new; append to the existing entry otherwise.

    - `EventID string`

      The id of the event being previewed. Matches event.id on the corresponding event_start and the buffered event that reconciles the preview.

  - `type BetaManagedAgentsSystemMessageEvent`

    A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.

    - `Type BetaManagedAgentsSystemMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsSystemContentBlock`

      System content blocks. Text-only.

      - `Type BetaManagedAgentsSystemContentBlockType`

      - `Text string`

        The text content.

        minLength: 1

    - `ProcessedAt Time Optional`

      Timestamp when this system message was processed.

      format: date-time

  - `type BetaManagedAgentsSessionUsageEvent`

    Periodic snapshot of the session's cumulative usage and tracked list cost.

    - `Type BetaManagedAgentsSessionUsageEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the snapshot was taken.

      format: date-time

    - `Usage BetaManagedAgentsSessionUsageSnapshot`

      The session's cumulative usage at the snapshot time.

      - `ActiveSeconds float64 Optional`

        Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once. This is the duration the session's runtime cost is priced on.

        format: double

      - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

        Tokens used to create prompt cache entries, broken down by cache TTL.

        - `Ephemeral1hInputTokens int64 Optional`

          Tokens used to create 1-hour ephemeral cache entries.

          format: int32

        - `Ephemeral5mInputTokens int64 Optional`

          Tokens used to create 5-minute ephemeral cache entries.

          format: int32

      - `CacheReadInputTokens int64 Optional`

        Total tokens read from prompt cache.

        format: int32

      - `InputTokens int64 Optional`

        Total input tokens consumed across all turns.

        format: int32

      - `ListCost BetaMonetaryAmount Optional`

        Cumulative list cost of the session across all turns, priced at public list rates.

      - `OutputTokens int64 Optional`

        Total output tokens generated across all turns.

        format: int32

      - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

        Cumulative server-executed tool usage across all turns.

        - `WebFetchRequests int64 Optional`

          Number of server-executed web fetch requests.

          format: int32

        - `WebSearchRequests int64 Optional`

          Number of server-executed web search requests.

          format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's configured budget at the snapshot time, or null when the session has no budget.

  - `type BetaManagedAgentsWorkflowRunCreatedEvent`

    A workflow run was created. A workflow run is background work that the session's agent starts. Emitted once per run, before the run's other `workflow_run.*` events.

    - `Type WorkflowRunCreated`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      Description that the agent gave the run, passed on as written, or `null` if it gave none.

    - `Name string`

      Name that the agent gave the run, passed on as written, or a name that the server assigned.

    - `Phases []BetaManagedAgentsWorkflowRunPhase`

      The phases that the run's plan declares, in the plan's order. Can be empty.

      - `ID string`

        Unique identifier for the phase.

      - `Description string`

        Description that the agent gave the phase, passed on as written, or `null` if it gave none.

      - `Name string`

        Name that the agent gave the phase, passed on as written.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusEndedEvent`

    A workflow run ended. Emitted once per run, as the last of the run's `workflow_run.*` events.

    - `Type WorkflowRunStatusEnded`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Result BetaManagedAgentsWorkflowRunResultUnion`

      How the run ended.

      - `type BetaManagedAgentsWorkflowRunResultCompleted`

        The run's plan, a program that the agent wrote, finished. This does not say whether the work succeeded.

        - `Type Completed`

      - `type BetaManagedAgentsWorkflowRunResultError`

        The run failed or reached its time limit.

        - `Type Error`

        - `Error BetaManagedAgentsWorkflowRunErrorUnion`

          Why the run did not finish.

          - `type BetaManagedAgentsTimeoutWorkflowRunError`

            The run reached its time limit.

            - `Type TimeoutError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsProgramWorkflowRunError`

            The plan, a program that the agent wrote, failed, or the server refused it.

            - `Type ProgramError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsUnknownWorkflowRunError`

            A failure that has no type of its own.

            - `Type UnknownError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsThreadLimitWorkflowRunError`

            The run exceeded the limit on the number of threads that a run can create.

            - `Type ThreadLimitError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsMaxWorkflowRunsWorkflowRunError`

            No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only `workflow_run.error` carries this type.

            - `Type MaxWorkflowRunsError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

      - `type BetaManagedAgentsWorkflowRunResultStopped`

        The agent stopped the run.

        - `Type Stopped`

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunPhaseStartedEvent`

    A workflow run's plan entered a phase.

    - `Type WorkflowRunPhaseStarted`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunPhaseEndedEvent`

    A workflow run's plan left a phase, or the run's end closed it. Emitted once for every `workflow_run.phase_started` event, before the run's `workflow_run.status_ended` event. The event does not say whether the plan finished the phase's work, or why it left.

    - `Type WorkflowRunPhaseEnded`

    - `ID string`

      Unique identifier for this event.

    - `PhaseStartedID string`

      Identifier of the `workflow_run.phase_started` event that opened the phase.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunStatusRunningEvent`

    A workflow run is running. Emitted when the run starts to execute, and each time it resumes after being idle. A run that starts idle emits `workflow_run.status_idle` first.

    - `Type WorkflowRunStatusRunning`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusIdleEvent`

    A workflow run is idle. Emitted each time the run goes idle, whatever the cause. If the run ends while idle, no `workflow_run.status_running` comes between this event and its `workflow_run.status_ended`.

    - `Type WorkflowRunStatusIdle`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunErrorEvent`

    A workflow run met an error, or an error kept a run from being created. A run that ends with a `result.type` of `error` emits this event before its `workflow_run.status_ended`, with the same `error`.

    - `Type WorkflowRunError`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsWorkflowRunErrorUnion`

      Why the run did not finish, or was not created.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run that met the error, or `null` when the error kept a run from being created.

#### 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"),
	)
	stream := client.Beta.Sessions.Events.StreamEvents(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionEventStreamParams{},
	)
	for stream.Next() {
		fmt.Printf("%+v\n", stream.Current())
	}
	err := stream.Err()
	if err != nil {
		panic(err.Error())
	}
}
```

##### Response (200)

```json
{
  "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
  "content": [
    {
      "text": "Where is my order #1234?",
      "type": "text"
    }
  ],
  "type": "user.message",
  "processed_at": "2026-03-15T10:00:00Z"
}
```

## Beta › Sessions › Resources

### Add Session Resource

`client.Beta.Sessions.Resources.Add(ctx, sessionID, params) (*BetaManagedAgentsFileResource, error)`

**POST** `/v1/sessions/{session_id}/resources`

Add Session Resource

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionResourceAddParams`

  - `BetaManagedAgentsFileResourceParams BetaManagedAgentsFileResourceParams`

    Request parameters for adding a resource to a session.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsFileResource`

  - `Type BetaManagedAgentsFileResourceType`

  - `ID string`

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `FileID string`

  - `MountPath string`

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

#### 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"),
	)
	betaManagedAgentsFileResource, err := client.Beta.Sessions.Resources.Add(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionResourceAddParams{
			BetaManagedAgentsFileResourceParams: anthropic.BetaManagedAgentsFileResourceParams{
				FileID: "file_011CNha8iCJcU1wXNR6q4V8w",
				Type:   anthropic.BetaManagedAgentsFileResourceParamsTypeFile,
			},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsFileResource.ID)
}
```

##### Response (200)

```json
{
  "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
  "created_at": "2026-03-15T10:00:00Z",
  "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "mount_path": "/uploads/receipt.pdf",
  "type": "file",
  "updated_at": "2026-03-15T10:00:00Z"
}
```

### List Session Resources

`client.Beta.Sessions.Resources.List(ctx, sessionID, params) (*PageCursor[BetaManagedAgentsSessionResourceUnion], error)`

**GET** `/v1/sessions/{session_id}/resources`

List Session Resources

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionResourceListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of resources to return per page (max 1000). If omitted, returns all resources.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSessionResourceUnion interface{…}`

  - `type BetaManagedAgentsGitHubRepositoryResource`

    - `Type BetaManagedAgentsGitHubRepositoryResourceType`

    - `ID string`

    - `CreatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `MountPath string`

    - `UpdatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `URL string`

    - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

      - `type BetaManagedAgentsBranchCheckout`

        - `Type BetaManagedAgentsBranchCheckoutType`

        - `Name string`

          Branch name to check out.

          minLength: 1, maxLength: 255

      - `type BetaManagedAgentsCommitCheckout`

        - `Type BetaManagedAgentsCommitCheckoutType`

        - `Sha string`

          Full commit SHA to check out.

          minLength: 7, maxLength: 64

  - `type BetaManagedAgentsFileResource`

    - `Type BetaManagedAgentsFileResourceType`

    - `ID string`

    - `CreatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `FileID string`

    - `MountPath string`

    - `UpdatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

  - `type BetaManagedAgentsMemoryStoreResource`

    A memory store attached to an agent session.

    - `Type BetaManagedAgentsMemoryStoreResourceType`

    - `MemoryStoreID string`

      The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

    - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

      Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

      - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

      - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

    - `Description string Optional`

      Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

    - `Instructions string Optional`

      Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

      maxLength: 4096

    - `MountPath string Optional`

      Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

    - `Name string Optional`

      Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

#### 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"),
	)
	page, err := client.Beta.Sessions.Resources.List(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionResourceListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
      "created_at": "2026-03-15T10:00:00Z",
      "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "mount_path": "/uploads/receipt.pdf",
      "type": "file",
      "updated_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
      "created_at": "2026-03-15T10:00:00Z",
      "mount_path": "/workspace/example-repo",
      "type": "github_repository",
      "updated_at": "2026-03-15T10:00:00Z",
      "url": "https://github.com/example-org/example-repo",
      "checkout": {
        "name": "main",
        "type": "branch"
      }
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get Session Resource

`client.Beta.Sessions.Resources.Get(ctx, resourceID, params) (*BetaSessionResourceGetResponseUnion, error)`

**GET** `/v1/sessions/{session_id}/resources/{resource_id}`

Get Session Resource

#### Parameters

- `resourceID string` (path parameter)

- `params BetaSessionResourceGetParams`

  - `SessionID string` (path parameter)

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaSessionResourceGetResponseUnion interface{…}`

  The requested session resource.

  - `type BetaManagedAgentsGitHubRepositoryResource`

    - `Type BetaManagedAgentsGitHubRepositoryResourceType`

    - `ID string`

    - `CreatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `MountPath string`

    - `UpdatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `URL string`

    - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

      - `type BetaManagedAgentsBranchCheckout`

        - `Type BetaManagedAgentsBranchCheckoutType`

        - `Name string`

          Branch name to check out.

          minLength: 1, maxLength: 255

      - `type BetaManagedAgentsCommitCheckout`

        - `Type BetaManagedAgentsCommitCheckoutType`

        - `Sha string`

          Full commit SHA to check out.

          minLength: 7, maxLength: 64

  - `type BetaManagedAgentsFileResource`

    - `Type BetaManagedAgentsFileResourceType`

    - `ID string`

    - `CreatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `FileID string`

    - `MountPath string`

    - `UpdatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

  - `type BetaManagedAgentsMemoryStoreResource`

    A memory store attached to an agent session.

    - `Type BetaManagedAgentsMemoryStoreResourceType`

    - `MemoryStoreID string`

      The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

    - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

      Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

      - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

      - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

    - `Description string Optional`

      Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

    - `Instructions string Optional`

      Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

      maxLength: 4096

    - `MountPath string Optional`

      Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

    - `Name string Optional`

      Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

#### 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"),
	)
	resource, err := client.Beta.Sessions.Resources.Get(
		context.TODO(),
		"sesrsc_011CZkZBJq5dWxk9fVLNcPht",
		anthropic.BetaSessionResourceGetParams{
			SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", resource)
}
```

##### Response (200)

```json
{
  "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
  "created_at": "2026-03-15T10:00:00Z",
  "mount_path": "/workspace/example-repo",
  "type": "github_repository",
  "updated_at": "2026-03-15T10:00:00Z",
  "url": "https://github.com/example-org/example-repo",
  "checkout": {
    "name": "main",
    "type": "branch"
  }
}
```

### Update Session Resource

`client.Beta.Sessions.Resources.Update(ctx, resourceID, params) (*BetaSessionResourceUpdateResponseUnion, error)`

**POST** `/v1/sessions/{session_id}/resources/{resource_id}`

Update Session Resource

#### Parameters

- `resourceID string` (path parameter)

- `params BetaSessionResourceUpdateParams`

  - `SessionID string` (path parameter)

  - `AuthorizationToken string`

    New authorization token for the resource. Currently only `github_repository` resources support token rotation.

    minLength: 1, maxLength: 4096

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaSessionResourceUpdateResponseUnion interface{…}`

  The updated session resource.

  - `type BetaManagedAgentsGitHubRepositoryResource`

    - `Type BetaManagedAgentsGitHubRepositoryResourceType`

    - `ID string`

    - `CreatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `MountPath string`

    - `UpdatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `URL string`

    - `Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion Optional`

      - `type BetaManagedAgentsBranchCheckout`

        - `Type BetaManagedAgentsBranchCheckoutType`

        - `Name string`

          Branch name to check out.

          minLength: 1, maxLength: 255

      - `type BetaManagedAgentsCommitCheckout`

        - `Type BetaManagedAgentsCommitCheckoutType`

        - `Sha string`

          Full commit SHA to check out.

          minLength: 7, maxLength: 64

  - `type BetaManagedAgentsFileResource`

    - `Type BetaManagedAgentsFileResourceType`

    - `ID string`

    - `CreatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

    - `FileID string`

    - `MountPath string`

    - `UpdatedAt Time`

      A timestamp in RFC 3339 format

      format: date-time

  - `type BetaManagedAgentsMemoryStoreResource`

    A memory store attached to an agent session.

    - `Type BetaManagedAgentsMemoryStoreResourceType`

    - `MemoryStoreID string`

      The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

    - `Access BetaManagedAgentsMemoryStoreResourceAccess Optional`

      Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

      - `const BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"`

      - `const BetaManagedAgentsMemoryStoreResourceAccessReadOnly BetaManagedAgentsMemoryStoreResourceAccess = "read_only"`

    - `Description string Optional`

      Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description.

    - `Instructions string Optional`

      Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

      maxLength: 4096

    - `MountPath string Optional`

      Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only.

    - `Name string Optional`

      Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource.

#### 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"),
	)
	resource, err := client.Beta.Sessions.Resources.Update(
		context.TODO(),
		"sesrsc_011CZkZBJq5dWxk9fVLNcPht",
		anthropic.BetaSessionResourceUpdateParams{
			SessionID:          "sesn_011CZkZAtmR3yMPDzynEDxu7",
			AuthorizationToken: "ghp_exampletoken",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", resource)
}
```

##### Response (200)

```json
{
  "id": "sesrsc_011CZkZCKr6eXym1gWMPdQiu",
  "created_at": "2026-03-15T10:00:00Z",
  "mount_path": "/workspace/example-repo",
  "type": "github_repository",
  "updated_at": "2026-03-15T10:00:00Z",
  "url": "https://github.com/example-org/example-repo",
  "checkout": {
    "name": "main",
    "type": "branch"
  }
}
```

### Delete Session Resource

`client.Beta.Sessions.Resources.Delete(ctx, resourceID, params) (*BetaManagedAgentsDeleteSessionResource, error)`

**DELETE** `/v1/sessions/{session_id}/resources/{resource_id}`

Delete Session Resource

#### Parameters

- `resourceID string` (path parameter)

- `params BetaSessionResourceDeleteParams`

  - `SessionID string` (path parameter)

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeleteSessionResource`

  Confirmation of resource deletion.

  - `Type BetaManagedAgentsDeleteSessionResourceType`

  - `ID string`

#### 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"),
	)
	betaManagedAgentsDeleteSessionResource, err := client.Beta.Sessions.Resources.Delete(
		context.TODO(),
		"sesrsc_011CZkZBJq5dWxk9fVLNcPht",
		anthropic.BetaSessionResourceDeleteParams{
			SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeleteSessionResource.ID)
}
```

##### Response (200)

```json
{
  "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
  "type": "session_resource_deleted"
}
```

## Beta › Sessions › Threads

### List Session Threads

`client.Beta.Sessions.Threads.List(ctx, sessionID, params) (*PageCursor[BetaManagedAgentsSessionThread], error)`

**GET** `/v1/sessions/{session_id}/threads`

List Session Threads

#### Parameters

- `sessionID string` (path parameter)

- `params BetaSessionThreadListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum results per page. Defaults to 1000.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor from a previous response's `next_page`. Forward-only.

  - `Statuses []BetaManagedAgentsSessionThreadStatus Optional` (query parameter)

    Return only threads that have one of these statuses.

    Repeat the parameter to give more than one status. Leave it out to return threads of every status.

    - `const BetaManagedAgentsSessionThreadStatusRunning BetaManagedAgentsSessionThreadStatus = "running"`

    - `const BetaManagedAgentsSessionThreadStatusIdle BetaManagedAgentsSessionThreadStatus = "idle"`

    - `const BetaManagedAgentsSessionThreadStatusRescheduling BetaManagedAgentsSessionThreadStatus = "rescheduling"`

    - `const BetaManagedAgentsSessionThreadStatusTerminated BetaManagedAgentsSessionThreadStatus = "terminated"`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSessionThread`

  An execution thread within a `session`. Each session has one primary thread plus zero or more child threads.

  - `Type BetaManagedAgentsSessionThreadType`

  - `ID string`

    Unique identifier for this thread.

  - `Agent BetaManagedAgentsSessionThreadAgentUnion`

    Resolved agent definition for this thread. Snapshot of the agent at thread creation time.

    - `type BetaManagedAgentsSessionThreadAgent`

      Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

      - `Type BetaManagedAgentsSessionThreadAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

          - `Type BetaManagedAgentsAnthropicSkillType`

          - `SkillID string`

          - `Version string`

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

          - `Type BetaManagedAgentsCustomSkillType`

          - `SkillID string`

          - `Version string`

      - `System string`

      - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

          - `Type BetaManagedAgentsAgentToolset20260401Type`

          - `Configs []BetaManagedAgentsAgentToolConfigUnion`

            - `type BetaManagedAgentsBashToolConfig`

              Configuration for the bash tool.

              - `Type Bash`

              - `Enabled bool`

              - `Name Bash`

              - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                  - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                  - `Type BetaManagedAgentsAlwaysAskPolicyType`

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `Type Auto`

            - `type BetaManagedAgentsEditToolConfig`

              Configuration for the edit tool.

              - `Type Edit`

              - `Enabled bool`

              - `Name Edit`

              - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsReadToolConfig`

              Configuration for the read tool.

              - `Type Read`

              - `Enabled bool`

              - `Name Read`

              - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWriteToolConfig`

              Configuration for the write tool.

              - `Type Write`

              - `Enabled bool`

              - `Name Write`

              - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGlobToolConfig`

              Configuration for the glob tool.

              - `Type Glob`

              - `Enabled bool`

              - `Name Glob`

              - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGrepToolConfig`

              Configuration for the grep tool.

              - `Type Grep`

              - `Enabled bool`

              - `Name Grep`

              - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWebFetchToolConfig`

              Configuration for the web_fetch tool.

              - `Type WebFetch`

              - `Enabled bool`

              - `Name WebFetch`

              - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `URLSources BetaManagedAgentsWebFetchURLSources`

                Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                  Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                  - `type BetaManagedAgentsWebFetchURLSourceAll`

                    Every URL from this source may be fetched. This is the default.

                    - `Type All`

                  - `type BetaManagedAgentsWebFetchURLSourceNone`

                    This source contributes no URLs that may be fetched.

                    - `Type None`

                  - `type BetaManagedAgentsWebFetchURLSourceOnly`

                    Only the named tools' results contribute URLs that may be fetched.

                    - `Type Only`

                    - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                      The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                      - `Type ToolReference`

                        Must be "tool_reference".

                      - `Name string`

                        Name of the tool. Compared exactly, so upper and lower case letters are different.

                        minLength: 1, maxLength: 128

                  - `type BetaManagedAgentsWebFetchURLSourceExcept`

                    Every tool's results contribute URLs that may be fetched, except the named tools' results.

                    - `Type Except`

                    - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                      The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                      - `Type ToolReference`

                        Must be "tool_reference".

                      - `Name string`

                        Name of the tool. Compared exactly, so upper and lower case letters are different.

                        minLength: 1, maxLength: 128

                - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                  Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                  Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                  - `type BetaManagedAgentsWebFetchURLSourceAll`

                    Every URL from this source may be fetched. This is the default.

                  - `type BetaManagedAgentsWebFetchURLSourceNone`

                    This source contributes no URLs that may be fetched.

              - `AllowedDomains []string Optional`

              - `BlockedDomains []string Optional`

              - `MaxContentTokens int64 Optional`

                format: int32

            - `type BetaManagedAgentsWebSearchToolConfig`

              Configuration for the web_search tool.

              - `Type WebSearch`

              - `Enabled bool`

              - `Name WebSearch`

              - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `AllowedDomains []string Optional`

              - `BlockedDomains []string Optional`

              - `UserLocation BetaManagedAgentsUserLocation Optional`

                Approximate user location for search result localization.

                - `Type Approximate`

                  Location precision. Only "approximate" is supported.

                - `City string Optional`

                  City name.

                  minLength: 1, maxLength: 255

                - `Country string Optional`

                  Two-letter ISO 3166-1 country code, uppercase.

                - `Region string Optional`

                  Region or state name.

                  minLength: 1, maxLength: 255

                - `Timezone string Optional`

                  IANA timezone identifier, e.g. "America/Los_Angeles".

                  minLength: 1, maxLength: 255

          - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

            Resolved default configuration for agent tools.

            - `Enabled bool`

            - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsMCPToolset`

          - `Type BetaManagedAgentsMCPToolsetType`

          - `Configs []BetaManagedAgentsMCPToolConfig`

            - `Enabled bool`

            - `Name string`

            - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

            Resolved default configuration for all tools from an MCP server.

            - `Enabled bool`

            - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `MCPServerName string`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

          - `Type BetaManagedAgentsCustomToolType`

          - `Description string`

          - `InputSchema BetaManagedAgentsCustomToolInputSchema`

            JSON Schema for custom tool input parameters.

            - `Type Object`

            - `Properties map[string, any] Optional`

            - `Required []string Optional`

          - `Name string`

      - `Version int64`

        format: int32

    - `type BetaManagedAgentsAdvisor`

      Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

      - `Type BetaManagedAgentsAdvisorType`

      - `Model string`

        The advisor model id.

    - `type BetaManagedAgentsInlineAgent`

      An agent that has no Agent resource, and so no `id` or `version`. It is defined inline, in a workflow run's plan or when a session thread is spawned, and is not saved.

      - `Type Inline`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        The session's execution principal.

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

      - `Name string`

        The name that the agent's definition gave, or one that the server assigned.

      - `Skills []BetaManagedAgentsInlineAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsInlineAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

  - `ArchivedAt Time`

    When the thread was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    When the thread was created.

    format: date-time

  - `ParentThreadID string`

    Parent thread that spawned this thread. Null for the primary thread.

  - `SessionID string`

    The session this thread belongs to.

  - `Stats BetaManagedAgentsSessionThreadStats`

    Timing statistics for this thread. Null until the thread's first status transition.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the thread spent actively running. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since thread creation in seconds. For archived threads, frozen at the final update.

      format: double

    - `StartupSeconds float64 Optional`

      Time in seconds for the thread to begin running. Zero for child threads, which start immediately.

      format: double

  - `Status BetaManagedAgentsSessionThreadStatus`

    Current execution status of the thread.

    - `const BetaManagedAgentsSessionThreadStatusRunning BetaManagedAgentsSessionThreadStatus = "running"`

    - `const BetaManagedAgentsSessionThreadStatusIdle BetaManagedAgentsSessionThreadStatus = "idle"`

    - `const BetaManagedAgentsSessionThreadStatusRescheduling BetaManagedAgentsSessionThreadStatus = "rescheduling"`

    - `const BetaManagedAgentsSessionThreadStatusTerminated BetaManagedAgentsSessionThreadStatus = "terminated"`

  - `UpdatedAt Time`

    When the thread was last updated.

    format: date-time

  - `Usage BetaManagedAgentsSessionThreadUsage`

    Cumulative token usage for this thread. Null until the thread's first idle transition.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds this thread spent in running status. Equal to `stats.active_seconds`; surfaced here so a thread's usage carries every quantity its cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of this thread across all turns, priced at public list rates. Absent until cost tracking is available for the thread. Each figure is rounded to the nearest cent independently and the session's aggregate `usage.list_cost` additionally includes session runtime, so per-thread costs do not sum exactly to the session figure; the session figure is authoritative and is what a budget is enforced against.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns of this thread. Absent until server-tool tracking is available for the thread.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `WorkflowRunID string`

    Identifier of the workflow run that created the thread, or `null` for any other thread.

#### 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"),
	)
	page, err := client.Beta.Sessions.Threads.List(
		context.TODO(),
		"sesn_011CZkZAtmR3yMPDzynEDxu7",
		anthropic.BetaSessionThreadListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "sthr_011CZkZVWa6oJjw1rgXZpnBt",
      "agent": {
        "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
        "description": "A focused research subagent.",
        "execution_identity": {
          "type": "service_account"
        },
        "mcp_servers": [
          {
            "name": "example-mcp",
            "type": "url",
            "url": "https://example-server.modelcontextprotocol.io/sse"
          }
        ],
        "model": {
          "id": "claude-opus-5-5",
          "effort": {
            "type": "low"
          },
          "inference_geo": "inference_geo",
          "speed": "standard"
        },
        "name": "Researcher",
        "skills": [
          {
            "skill_id": "xlsx",
            "type": "anthropic",
            "version": "1"
          }
        ],
        "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
        "tools": [
          {
            "configs": [
              {
                "enabled": true,
                "name": "bash",
                "permission_policy": {
                  "type": "always_allow"
                },
                "type": "bash"
              }
            ],
            "default_config": {
              "enabled": true,
              "permission_policy": {
                "type": "always_ask"
              }
            },
            "type": "agent_toolset_20260401"
          }
        ],
        "type": "agent",
        "version": 1
      },
      "archived_at": null,
      "created_at": "2026-03-15T10:00:00Z",
      "parent_thread_id": null,
      "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
      "stats": {
        "active_seconds": 0,
        "duration_seconds": 0,
        "startup_seconds": 0
      },
      "status": "idle",
      "type": "session_thread",
      "updated_at": "2026-03-15T10:00:00Z",
      "usage": {
        "active_seconds": 0,
        "cache_creation": {
          "ephemeral_1h_input_tokens": 0,
          "ephemeral_5m_input_tokens": 0
        },
        "cache_read_input_tokens": 0,
        "input_tokens": 0,
        "list_cost": {
          "amount": "2500",
          "currency": "USD"
        },
        "output_tokens": 0,
        "server_tool_use": {
          "web_fetch_requests": 0,
          "web_search_requests": 3
        }
      },
      "workflow_run_id": null
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get Session Thread

`client.Beta.Sessions.Threads.Get(ctx, threadID, params) (*BetaManagedAgentsSessionThread, error)`

**GET** `/v1/sessions/{session_id}/threads/{thread_id}`

Get Session Thread

#### Parameters

- `threadID string` (path parameter)

- `params BetaSessionThreadGetParams`

  - `SessionID string` (path parameter)

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSessionThread`

  An execution thread within a `session`. Each session has one primary thread plus zero or more child threads.

  - `Type BetaManagedAgentsSessionThreadType`

  - `ID string`

    Unique identifier for this thread.

  - `Agent BetaManagedAgentsSessionThreadAgentUnion`

    Resolved agent definition for this thread. Snapshot of the agent at thread creation time.

    - `type BetaManagedAgentsSessionThreadAgent`

      Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

      - `Type BetaManagedAgentsSessionThreadAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

          - `Type BetaManagedAgentsAnthropicSkillType`

          - `SkillID string`

          - `Version string`

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

          - `Type BetaManagedAgentsCustomSkillType`

          - `SkillID string`

          - `Version string`

      - `System string`

      - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

          - `Type BetaManagedAgentsAgentToolset20260401Type`

          - `Configs []BetaManagedAgentsAgentToolConfigUnion`

            - `type BetaManagedAgentsBashToolConfig`

              Configuration for the bash tool.

              - `Type Bash`

              - `Enabled bool`

              - `Name Bash`

              - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                  - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                  - `Type BetaManagedAgentsAlwaysAskPolicyType`

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `Type Auto`

            - `type BetaManagedAgentsEditToolConfig`

              Configuration for the edit tool.

              - `Type Edit`

              - `Enabled bool`

              - `Name Edit`

              - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsReadToolConfig`

              Configuration for the read tool.

              - `Type Read`

              - `Enabled bool`

              - `Name Read`

              - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWriteToolConfig`

              Configuration for the write tool.

              - `Type Write`

              - `Enabled bool`

              - `Name Write`

              - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGlobToolConfig`

              Configuration for the glob tool.

              - `Type Glob`

              - `Enabled bool`

              - `Name Glob`

              - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGrepToolConfig`

              Configuration for the grep tool.

              - `Type Grep`

              - `Enabled bool`

              - `Name Grep`

              - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWebFetchToolConfig`

              Configuration for the web_fetch tool.

              - `Type WebFetch`

              - `Enabled bool`

              - `Name WebFetch`

              - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `URLSources BetaManagedAgentsWebFetchURLSources`

                Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                  Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                  - `type BetaManagedAgentsWebFetchURLSourceAll`

                    Every URL from this source may be fetched. This is the default.

                    - `Type All`

                  - `type BetaManagedAgentsWebFetchURLSourceNone`

                    This source contributes no URLs that may be fetched.

                    - `Type None`

                  - `type BetaManagedAgentsWebFetchURLSourceOnly`

                    Only the named tools' results contribute URLs that may be fetched.

                    - `Type Only`

                    - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                      The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                      - `Type ToolReference`

                        Must be "tool_reference".

                      - `Name string`

                        Name of the tool. Compared exactly, so upper and lower case letters are different.

                        minLength: 1, maxLength: 128

                  - `type BetaManagedAgentsWebFetchURLSourceExcept`

                    Every tool's results contribute URLs that may be fetched, except the named tools' results.

                    - `Type Except`

                    - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                      The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                      - `Type ToolReference`

                        Must be "tool_reference".

                      - `Name string`

                        Name of the tool. Compared exactly, so upper and lower case letters are different.

                        minLength: 1, maxLength: 128

                - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                  Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                  Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                  - `type BetaManagedAgentsWebFetchURLSourceAll`

                    Every URL from this source may be fetched. This is the default.

                  - `type BetaManagedAgentsWebFetchURLSourceNone`

                    This source contributes no URLs that may be fetched.

              - `AllowedDomains []string Optional`

              - `BlockedDomains []string Optional`

              - `MaxContentTokens int64 Optional`

                format: int32

            - `type BetaManagedAgentsWebSearchToolConfig`

              Configuration for the web_search tool.

              - `Type WebSearch`

              - `Enabled bool`

              - `Name WebSearch`

              - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `AllowedDomains []string Optional`

              - `BlockedDomains []string Optional`

              - `UserLocation BetaManagedAgentsUserLocation Optional`

                Approximate user location for search result localization.

                - `Type Approximate`

                  Location precision. Only "approximate" is supported.

                - `City string Optional`

                  City name.

                  minLength: 1, maxLength: 255

                - `Country string Optional`

                  Two-letter ISO 3166-1 country code, uppercase.

                - `Region string Optional`

                  Region or state name.

                  minLength: 1, maxLength: 255

                - `Timezone string Optional`

                  IANA timezone identifier, e.g. "America/Los_Angeles".

                  minLength: 1, maxLength: 255

          - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

            Resolved default configuration for agent tools.

            - `Enabled bool`

            - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsMCPToolset`

          - `Type BetaManagedAgentsMCPToolsetType`

          - `Configs []BetaManagedAgentsMCPToolConfig`

            - `Enabled bool`

            - `Name string`

            - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

            Resolved default configuration for all tools from an MCP server.

            - `Enabled bool`

            - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `MCPServerName string`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

          - `Type BetaManagedAgentsCustomToolType`

          - `Description string`

          - `InputSchema BetaManagedAgentsCustomToolInputSchema`

            JSON Schema for custom tool input parameters.

            - `Type Object`

            - `Properties map[string, any] Optional`

            - `Required []string Optional`

          - `Name string`

      - `Version int64`

        format: int32

    - `type BetaManagedAgentsAdvisor`

      Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

      - `Type BetaManagedAgentsAdvisorType`

      - `Model string`

        The advisor model id.

    - `type BetaManagedAgentsInlineAgent`

      An agent that has no Agent resource, and so no `id` or `version`. It is defined inline, in a workflow run's plan or when a session thread is spawned, and is not saved.

      - `Type Inline`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        The session's execution principal.

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

      - `Name string`

        The name that the agent's definition gave, or one that the server assigned.

      - `Skills []BetaManagedAgentsInlineAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsInlineAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

  - `ArchivedAt Time`

    When the thread was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    When the thread was created.

    format: date-time

  - `ParentThreadID string`

    Parent thread that spawned this thread. Null for the primary thread.

  - `SessionID string`

    The session this thread belongs to.

  - `Stats BetaManagedAgentsSessionThreadStats`

    Timing statistics for this thread. Null until the thread's first status transition.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the thread spent actively running. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since thread creation in seconds. For archived threads, frozen at the final update.

      format: double

    - `StartupSeconds float64 Optional`

      Time in seconds for the thread to begin running. Zero for child threads, which start immediately.

      format: double

  - `Status BetaManagedAgentsSessionThreadStatus`

    Current execution status of the thread.

    - `const BetaManagedAgentsSessionThreadStatusRunning BetaManagedAgentsSessionThreadStatus = "running"`

    - `const BetaManagedAgentsSessionThreadStatusIdle BetaManagedAgentsSessionThreadStatus = "idle"`

    - `const BetaManagedAgentsSessionThreadStatusRescheduling BetaManagedAgentsSessionThreadStatus = "rescheduling"`

    - `const BetaManagedAgentsSessionThreadStatusTerminated BetaManagedAgentsSessionThreadStatus = "terminated"`

  - `UpdatedAt Time`

    When the thread was last updated.

    format: date-time

  - `Usage BetaManagedAgentsSessionThreadUsage`

    Cumulative token usage for this thread. Null until the thread's first idle transition.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds this thread spent in running status. Equal to `stats.active_seconds`; surfaced here so a thread's usage carries every quantity its cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of this thread across all turns, priced at public list rates. Absent until cost tracking is available for the thread. Each figure is rounded to the nearest cent independently and the session's aggregate `usage.list_cost` additionally includes session runtime, so per-thread costs do not sum exactly to the session figure; the session figure is authoritative and is what a budget is enforced against.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns of this thread. Absent until server-tool tracking is available for the thread.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `WorkflowRunID string`

    Identifier of the workflow run that created the thread, or `null` for any other thread.

#### 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"),
	)
	betaManagedAgentsSessionThread, err := client.Beta.Sessions.Threads.Get(
		context.TODO(),
		"sthr_011CZkZVWa6oJjw1rgXZpnBt",
		anthropic.BetaSessionThreadGetParams{
			SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSessionThread.ID)
}
```

##### Response (200)

```json
{
  "id": "sthr_011CZkZVWa6oJjw1rgXZpnBt",
  "agent": {
    "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
    "description": "A focused research subagent.",
    "execution_identity": {
      "type": "service_account"
    },
    "mcp_servers": [
      {
        "name": "example-mcp",
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse"
      }
    ],
    "model": {
      "id": "claude-opus-5-5",
      "effort": {
        "type": "low"
      },
      "inference_geo": "inference_geo",
      "speed": "standard"
    },
    "name": "Researcher",
    "skills": [
      {
        "skill_id": "xlsx",
        "type": "anthropic",
        "version": "1"
      }
    ],
    "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
    "tools": [
      {
        "configs": [
          {
            "enabled": true,
            "name": "bash",
            "permission_policy": {
              "type": "always_allow"
            },
            "type": "bash"
          }
        ],
        "default_config": {
          "enabled": true,
          "permission_policy": {
            "type": "always_ask"
          }
        },
        "type": "agent_toolset_20260401"
      }
    ],
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "parent_thread_id": null,
  "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "stats": {
    "active_seconds": 0,
    "duration_seconds": 0,
    "startup_seconds": 0
  },
  "status": "idle",
  "type": "session_thread",
  "updated_at": "2026-03-15T10:00:00Z",
  "usage": {
    "active_seconds": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "output_tokens": 0,
    "server_tool_use": {
      "web_fetch_requests": 0,
      "web_search_requests": 3
    }
  },
  "workflow_run_id": null
}
```

### Archive Session Thread

`client.Beta.Sessions.Threads.Archive(ctx, threadID, params) (*BetaManagedAgentsSessionThread, error)`

**POST** `/v1/sessions/{session_id}/threads/{thread_id}/archive`

Archive Session Thread

#### Parameters

- `threadID string` (path parameter)

- `params BetaSessionThreadArchiveParams`

  - `SessionID string` (path parameter)

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSessionThread`

  An execution thread within a `session`. Each session has one primary thread plus zero or more child threads.

  - `Type BetaManagedAgentsSessionThreadType`

  - `ID string`

    Unique identifier for this thread.

  - `Agent BetaManagedAgentsSessionThreadAgentUnion`

    Resolved agent definition for this thread. Snapshot of the agent at thread creation time.

    - `type BetaManagedAgentsSessionThreadAgent`

      Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

      - `Type BetaManagedAgentsSessionThreadAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

          - `Type BetaManagedAgentsAnthropicSkillType`

          - `SkillID string`

          - `Version string`

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

          - `Type BetaManagedAgentsCustomSkillType`

          - `SkillID string`

          - `Version string`

      - `System string`

      - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

          - `Type BetaManagedAgentsAgentToolset20260401Type`

          - `Configs []BetaManagedAgentsAgentToolConfigUnion`

            - `type BetaManagedAgentsBashToolConfig`

              Configuration for the bash tool.

              - `Type Bash`

              - `Enabled bool`

              - `Name Bash`

              - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                  - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                  - `Type BetaManagedAgentsAlwaysAskPolicyType`

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `Type Auto`

            - `type BetaManagedAgentsEditToolConfig`

              Configuration for the edit tool.

              - `Type Edit`

              - `Enabled bool`

              - `Name Edit`

              - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsReadToolConfig`

              Configuration for the read tool.

              - `Type Read`

              - `Enabled bool`

              - `Name Read`

              - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWriteToolConfig`

              Configuration for the write tool.

              - `Type Write`

              - `Enabled bool`

              - `Name Write`

              - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGlobToolConfig`

              Configuration for the glob tool.

              - `Type Glob`

              - `Enabled bool`

              - `Name Glob`

              - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsGrepToolConfig`

              Configuration for the grep tool.

              - `Type Grep`

              - `Enabled bool`

              - `Name Grep`

              - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

            - `type BetaManagedAgentsWebFetchToolConfig`

              Configuration for the web_fetch tool.

              - `Type WebFetch`

              - `Enabled bool`

              - `Name WebFetch`

              - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `URLSources BetaManagedAgentsWebFetchURLSources`

                Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                  Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                  - `type BetaManagedAgentsWebFetchURLSourceAll`

                    Every URL from this source may be fetched. This is the default.

                    - `Type All`

                  - `type BetaManagedAgentsWebFetchURLSourceNone`

                    This source contributes no URLs that may be fetched.

                    - `Type None`

                  - `type BetaManagedAgentsWebFetchURLSourceOnly`

                    Only the named tools' results contribute URLs that may be fetched.

                    - `Type Only`

                    - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                      The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                      - `Type ToolReference`

                        Must be "tool_reference".

                      - `Name string`

                        Name of the tool. Compared exactly, so upper and lower case letters are different.

                        minLength: 1, maxLength: 128

                  - `type BetaManagedAgentsWebFetchURLSourceExcept`

                    Every tool's results contribute URLs that may be fetched, except the named tools' results.

                    - `Type Except`

                    - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                      The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                      - `Type ToolReference`

                        Must be "tool_reference".

                      - `Name string`

                        Name of the tool. Compared exactly, so upper and lower case letters are different.

                        minLength: 1, maxLength: 128

                - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                  Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                  Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                  - `type BetaManagedAgentsWebFetchURLSourceAll`

                    Every URL from this source may be fetched. This is the default.

                  - `type BetaManagedAgentsWebFetchURLSourceNone`

                    This source contributes no URLs that may be fetched.

              - `AllowedDomains []string Optional`

              - `BlockedDomains []string Optional`

              - `MaxContentTokens int64 Optional`

                format: int32

            - `type BetaManagedAgentsWebSearchToolConfig`

              Configuration for the web_search tool.

              - `Type WebSearch`

              - `Enabled bool`

              - `Name WebSearch`

              - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                Permission policy for tool execution.

                - `type BetaManagedAgentsAlwaysAllowPolicy`

                  Tool calls are automatically approved without user confirmation.

                - `type BetaManagedAgentsAlwaysAskPolicy`

                  Tool calls require user confirmation before execution.

                - `type BetaManagedAgentsAutoPolicy`

                  The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

              - `AllowedDomains []string Optional`

              - `BlockedDomains []string Optional`

              - `UserLocation BetaManagedAgentsUserLocation Optional`

                Approximate user location for search result localization.

                - `Type Approximate`

                  Location precision. Only "approximate" is supported.

                - `City string Optional`

                  City name.

                  minLength: 1, maxLength: 255

                - `Country string Optional`

                  Two-letter ISO 3166-1 country code, uppercase.

                - `Region string Optional`

                  Region or state name.

                  minLength: 1, maxLength: 255

                - `Timezone string Optional`

                  IANA timezone identifier, e.g. "America/Los_Angeles".

                  minLength: 1, maxLength: 255

          - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

            Resolved default configuration for agent tools.

            - `Enabled bool`

            - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

        - `type BetaManagedAgentsMCPToolset`

          - `Type BetaManagedAgentsMCPToolsetType`

          - `Configs []BetaManagedAgentsMCPToolConfig`

            - `Enabled bool`

            - `Name string`

            - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

            Resolved default configuration for all tools from an MCP server.

            - `Enabled bool`

            - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

              Permission policy for tool execution.

              - `type BetaManagedAgentsAlwaysAllowPolicy`

                Tool calls are automatically approved without user confirmation.

              - `type BetaManagedAgentsAlwaysAskPolicy`

                Tool calls require user confirmation before execution.

              - `type BetaManagedAgentsAutoPolicy`

                The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

          - `MCPServerName string`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

          - `Type BetaManagedAgentsCustomToolType`

          - `Description string`

          - `InputSchema BetaManagedAgentsCustomToolInputSchema`

            JSON Schema for custom tool input parameters.

            - `Type Object`

            - `Properties map[string, any] Optional`

            - `Required []string Optional`

          - `Name string`

      - `Version int64`

        format: int32

    - `type BetaManagedAgentsAdvisor`

      Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

      - `Type BetaManagedAgentsAdvisorType`

      - `Model string`

        The advisor model id.

    - `type BetaManagedAgentsInlineAgent`

      An agent that has no Agent resource, and so no `id` or `version`. It is defined inline, in a workflow run's plan or when a session thread is spawned, and is not saved.

      - `Type Inline`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        The session's execution principal.

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

      - `Name string`

        The name that the agent's definition gave, or one that the server assigned.

      - `Skills []BetaManagedAgentsInlineAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsInlineAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

  - `ArchivedAt Time`

    When the thread was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    When the thread was created.

    format: date-time

  - `ParentThreadID string`

    Parent thread that spawned this thread. Null for the primary thread.

  - `SessionID string`

    The session this thread belongs to.

  - `Stats BetaManagedAgentsSessionThreadStats`

    Timing statistics for this thread. Null until the thread's first status transition.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds the thread spent actively running. Excludes idle time.

      format: double

    - `DurationSeconds float64 Optional`

      Elapsed time since thread creation in seconds. For archived threads, frozen at the final update.

      format: double

    - `StartupSeconds float64 Optional`

      Time in seconds for the thread to begin running. Zero for child threads, which start immediately.

      format: double

  - `Status BetaManagedAgentsSessionThreadStatus`

    Current execution status of the thread.

    - `const BetaManagedAgentsSessionThreadStatusRunning BetaManagedAgentsSessionThreadStatus = "running"`

    - `const BetaManagedAgentsSessionThreadStatusIdle BetaManagedAgentsSessionThreadStatus = "idle"`

    - `const BetaManagedAgentsSessionThreadStatusRescheduling BetaManagedAgentsSessionThreadStatus = "rescheduling"`

    - `const BetaManagedAgentsSessionThreadStatusTerminated BetaManagedAgentsSessionThreadStatus = "terminated"`

  - `UpdatedAt Time`

    When the thread was last updated.

    format: date-time

  - `Usage BetaManagedAgentsSessionThreadUsage`

    Cumulative token usage for this thread. Null until the thread's first idle transition.

    - `ActiveSeconds float64 Optional`

      Cumulative time in seconds this thread spent in running status. Equal to `stats.active_seconds`; surfaced here so a thread's usage carries every quantity its cost is priced on.

      format: double

    - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

      Tokens used to create prompt cache entries, broken down by cache TTL.

      - `Ephemeral1hInputTokens int64 Optional`

        Tokens used to create 1-hour ephemeral cache entries.

        format: int32

      - `Ephemeral5mInputTokens int64 Optional`

        Tokens used to create 5-minute ephemeral cache entries.

        format: int32

    - `CacheReadInputTokens int64 Optional`

      Total tokens read from prompt cache.

      format: int32

    - `InputTokens int64 Optional`

      Total input tokens consumed across all turns.

      format: int32

    - `ListCost BetaMonetaryAmount Optional`

      Cumulative list cost of this thread across all turns, priced at public list rates. Absent until cost tracking is available for the thread. Each figure is rounded to the nearest cent independently and the session's aggregate `usage.list_cost` additionally includes session runtime, so per-thread costs do not sum exactly to the session figure; the session figure is authoritative and is what a budget is enforced against.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `OutputTokens int64 Optional`

      Total output tokens generated across all turns.

      format: int32

    - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

      Cumulative server-executed tool usage across all turns of this thread. Absent until server-tool tracking is available for the thread.

      - `WebFetchRequests int64 Optional`

        Number of server-executed web fetch requests.

        format: int32

      - `WebSearchRequests int64 Optional`

        Number of server-executed web search requests.

        format: int32

  - `WorkflowRunID string`

    Identifier of the workflow run that created the thread, or `null` for any other thread.

#### 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"),
	)
	betaManagedAgentsSessionThread, err := client.Beta.Sessions.Threads.Archive(
		context.TODO(),
		"sthr_011CZkZVWa6oJjw1rgXZpnBt",
		anthropic.BetaSessionThreadArchiveParams{
			SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsSessionThread.ID)
}
```

##### Response (200)

```json
{
  "id": "sthr_011CZkZVWa6oJjw1rgXZpnBt",
  "agent": {
    "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
    "description": "A focused research subagent.",
    "execution_identity": {
      "type": "service_account"
    },
    "mcp_servers": [
      {
        "name": "example-mcp",
        "type": "url",
        "url": "https://example-server.modelcontextprotocol.io/sse"
      }
    ],
    "model": {
      "id": "claude-opus-5-5",
      "effort": {
        "type": "low"
      },
      "inference_geo": "inference_geo",
      "speed": "standard"
    },
    "name": "Researcher",
    "skills": [
      {
        "skill_id": "xlsx",
        "type": "anthropic",
        "version": "1"
      }
    ],
    "system": "You are a research subagent that gathers and summarises sources for the coordinating agent.",
    "tools": [
      {
        "configs": [
          {
            "enabled": true,
            "name": "bash",
            "permission_policy": {
              "type": "always_allow"
            },
            "type": "bash"
          }
        ],
        "default_config": {
          "enabled": true,
          "permission_policy": {
            "type": "always_ask"
          }
        },
        "type": "agent_toolset_20260401"
      }
    ],
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "parent_thread_id": null,
  "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
  "stats": {
    "active_seconds": 0,
    "duration_seconds": 0,
    "startup_seconds": 0
  },
  "status": "idle",
  "type": "session_thread",
  "updated_at": "2026-03-15T10:00:00Z",
  "usage": {
    "active_seconds": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "output_tokens": 0,
    "server_tool_use": {
      "web_fetch_requests": 0,
      "web_search_requests": 3
    }
  },
  "workflow_run_id": null
}
```

## Beta › Sessions › Threads › Events

### List Session Thread Events

`client.Beta.Sessions.Threads.Events.List(ctx, threadID, params) (*PageCursor[BetaManagedAgentsSessionEventUnion], error)`

**GET** `/v1/sessions/{session_id}/threads/{thread_id}/events`

List Session Thread Events

#### Parameters

- `threadID string` (path parameter)

- `params BetaSessionThreadEventListParams`

  - `SessionID string` (path parameter)

  - `Limit param.Opt[int64] Optional` (query parameter)

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsSessionEventUnion interface{…}`

  Union type for all event types in a session.

  - `type BetaManagedAgentsUserMessageEvent`

    A user message event in the session conversation.

    - `Type BetaManagedAgentsUserMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsUserMessageEventContentUnion`

      Array of content blocks comprising the user message.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

        - `Type BetaManagedAgentsTextBlockType`

        - `Text string`

          The text content.

          minLength: 1

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

        - `Type BetaManagedAgentsImageBlockType`

        - `Source BetaManagedAgentsImageBlockSourceUnion`

          The source of the image data.

          - `type BetaManagedAgentsBase64ImageSource`

            Base64-encoded image data.

            - `Type BetaManagedAgentsBase64ImageSourceType`

            - `Data string`

              Base64-encoded image data.

              minLength: 1

            - `MediaType string`

              MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

              minLength: 1

          - `type BetaManagedAgentsURLImageSource`

            Image referenced by URL.

            - `Type BetaManagedAgentsURLImageSourceType`

            - `URL string`

              URL of the image to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileImageSource`

            Image referenced by file ID.

            - `Type BetaManagedAgentsFileImageSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `Type BetaManagedAgentsDocumentBlockType`

        - `Source BetaManagedAgentsDocumentBlockSourceUnion`

          The source of the document data.

          - `type BetaManagedAgentsBase64DocumentSource`

            Base64-encoded document data.

            - `Type BetaManagedAgentsBase64DocumentSourceType`

            - `Data string`

              Base64-encoded document data.

              minLength: 1

            - `MediaType string`

              MIME type of the document (e.g., "application/pdf").

              minLength: 1

          - `type BetaManagedAgentsPlainTextDocumentSource`

            Plain text document content.

            - `Type BetaManagedAgentsPlainTextDocumentSourceType`

            - `Data string`

              The plain text content.

              minLength: 1

            - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

              MIME type of the text content. Must be "text/plain".

          - `type BetaManagedAgentsURLDocumentSource`

            Document referenced by URL.

            - `Type BetaManagedAgentsURLDocumentSourceType`

            - `URL string`

              URL of the document to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileDocumentSource`

            Document referenced by file ID.

            - `Type BetaManagedAgentsFileDocumentSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

        - `Context string Optional`

          Additional context about the document for the model.

        - `Title string Optional`

          The title of the document.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

        - `Type BetaManagedAgentsRedactedBlockType`

    - `ProcessedAt Time Optional`

      Timestamp when the agent finished processing this message.

      format: date-time

  - `type BetaManagedAgentsUserInterruptEvent`

    An interrupt event that pauses agent execution and returns control to the user.

    - `Type BetaManagedAgentsUserInterruptEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time Optional`

      Timestamp when the interrupt was processed.

      format: date-time

    - `SessionThreadID string Optional`

      If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

  - `type BetaManagedAgentsUserToolConfirmationEvent`

    A tool confirmation event that approves or denies a pending tool execution.

    - `Type BetaManagedAgentsUserToolConfirmationEventType`

    - `ID string`

      Unique identifier for this event.

    - `Result BetaManagedAgentsUserToolConfirmationEventResult`

      The confirmation result: 'allow' or 'deny'.

      - `const BetaManagedAgentsUserToolConfirmationEventResultAllow BetaManagedAgentsUserToolConfirmationEventResult = "allow"`

      - `const BetaManagedAgentsUserToolConfirmationEventResultDeny BetaManagedAgentsUserToolConfirmationEventResult = "deny"`

    - `ToolUseID string`

      The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `DenyMessage string Optional`

      Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

      maxLength: 10000

    - `ProcessedAt Time Optional`

      Timestamp when the confirmation was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsUserCustomToolResultEvent`

    Event sent by the client providing the result of a custom tool execution.

    - `Type BetaManagedAgentsUserCustomToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `CustomToolUseID string`

      The id of the `agent.custom_tool_use` event this result corresponds to. It is also listed in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserCustomToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

        - `Type BetaManagedAgentsSearchResultBlockType`

        - `Citations BetaManagedAgentsSearchResultCitations`

          Citation settings for this search result.

          - `Enabled bool`

            Whether citations are enabled for this search result.

        - `Content []BetaManagedAgentsSearchResultContent`

          Array of text content blocks from the search result.

          - `Type BetaManagedAgentsSearchResultContentType`

          - `Text string`

            The text content.

            minLength: 1

        - `Source string`

          The URL source of the search result.

          minLength: 1

        - `Title string`

          The title of the search result.

          minLength: 1

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsAgentCustomToolUseEvent`

    Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result. The client can send it as soon as this event arrives, without waiting for `session.status_idle`.

    - `Type BetaManagedAgentsAgentCustomToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the custom tool being called.

    - `ProcessedAt Time`

      Timestamp when this tool use was processed.

      format: date-time

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMessageEvent`

    An agent response event in the session conversation.

    - `Type BetaManagedAgentsAgentMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentMessageEventContentUnion`

      Array of text blocks comprising the agent response.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when this response was generated.

      format: date-time

  - `type BetaManagedAgentsAgentThinkingEvent`

    Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.

    - `Type BetaManagedAgentsAgentThinkingEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this thinking was produced.

      format: date-time

  - `type BetaManagedAgentsAgentMCPToolUseEvent`

    Event emitted when the agent invokes a tool provided by an MCP server.

    - `Type BetaManagedAgentsAgentMCPToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `MCPServerName string`

      Name of the MCP server providing the tool.

    - `Name string`

      Name of the MCP tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

      - `const BetaManagedAgentsAgentEvaluatedPermissionAllow BetaManagedAgentsAgentEvaluatedPermission = "allow"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionAsk BetaManagedAgentsAgentEvaluatedPermission = "ask"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionDeny BetaManagedAgentsAgentEvaluatedPermission = "deny"`

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAllow`

        The resolved permission_policy was always_allow; accompanies evaluated_permission "allow".

        - `Type AlwaysAllow`

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAsk`

        The resolved permission_policy was always_ask; accompanies evaluated_permission "ask".

        - `Type AlwaysAsk`

      - `type BetaManagedAgentsAgentToolEvaluationAuto`

        The resolved permission_policy was auto: the server judged this invocation individually.

        - `Type Auto`

        - `EvaluatedPermission BetaManagedAgentsAgentAutoEvaluatedPermissionUnion`

          The server's judgement for this invocation.

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAllow`

            The server judged the invocation safe to execute without client approval.

            - `Type Allow`

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAsk`

            The server reached no judgement; the invocation is held for client approval.

            - `Type Ask`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.

              maxLength: 64

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionDeny`

            The server judged the invocation high-risk; it does not execute and a synthetic error tool result is appended.

            - `Type Deny`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.

              maxLength: 64

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMCPToolResultEvent`

    Event representing the result of an MCP tool execution.

    - `Type BetaManagedAgentsAgentMCPToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `MCPToolUseID string`

      The id of the `agent.mcp_tool_use` event this result corresponds to.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Content []BetaManagedAgentsAgentMCPToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentToolUseEvent`

    Event emitted when the agent invokes a built-in agent tool.

    - `Type BetaManagedAgentsAgentToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the agent tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentToolResultEvent`

    Event representing the result of an agent tool execution.

    - `Type BetaManagedAgentsAgentToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to.

    - `Content []BetaManagedAgentsAgentToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentThreadMessageReceivedEvent`

    Delivery event written to the target thread's input stream when an agent-to-agent message arrives.

    - `Type BetaManagedAgentsAgentThreadMessageReceivedEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `FromSessionThreadID string`

      Public `sthr_` ID of the thread that sent the message.

    - `ProcessedAt Time`

      Timestamp when the message was received.

      format: date-time

    - `FromAgentName string Optional`

      Name of the callable agent this message came from. Absent when received from the primary agent.

  - `type BetaManagedAgentsAgentThreadMessageSentEvent`

    Observability event emitted to the sender's output stream when an agent-to-agent message is sent.

    - `Type BetaManagedAgentsAgentThreadMessageSentEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageSentEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when the message was sent.

      format: date-time

    - `ToSessionThreadID string`

      Public `sthr_` ID of the thread the message was sent to.

    - `ToAgentName string Optional`

      Name of the callable agent this message was sent to. Absent when sent to the primary agent.

  - `type BetaManagedAgentsAgentThreadContextCompactedEvent`

    Indicates that context compaction (summarization) occurred during the session.

    - `Type BetaManagedAgentsAgentThreadContextCompactedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when compaction was processed.

      format: date-time

  - `type BetaManagedAgentsSessionErrorEvent`

    An error event indicating a problem occurred during session execution.

    - `Type BetaManagedAgentsSessionErrorEventType`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsSessionErrorEventErrorUnion`

      - `type BetaManagedAgentsUnknownError`

        An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.

        - `Type BetaManagedAgentsUnknownErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsUnknownErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

            - `Type BetaManagedAgentsRetryStatusRetryingType`

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

            - `Type BetaManagedAgentsRetryStatusExhaustedType`

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

            - `Type BetaManagedAgentsRetryStatusTerminalType`

      - `type BetaManagedAgentsModelOverloadedError`

        The model is currently overloaded. Emitted after automatic retries are exhausted.

        - `Type BetaManagedAgentsModelOverloadedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelOverloadedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRateLimitedError`

        The model request was rate-limited.

        - `Type BetaManagedAgentsModelRateLimitedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRequestFailedError`

        A model request failed for a reason other than overload or rate-limiting.

        - `Type BetaManagedAgentsModelRequestFailedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPConnectionFailedError`

        Failed to connect to an MCP server.

        - `Type BetaManagedAgentsMCPConnectionFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed to connect.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPAuthenticationFailedError`

        Authentication to an MCP server failed.

        - `Type BetaManagedAgentsMCPAuthenticationFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed authentication.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsBillingError`

        The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.

        - `Type BetaManagedAgentsBillingErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsBillingErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsCredentialHostUnreachableError`

        An `environment_variable` credential's `auth.networking.allowed_hosts` includes a host the environment's network policy does not permit.

        - `Type BetaManagedAgentsCredentialHostUnreachableErrorType`

        - `CredentialID string`

          ID of the affected credential.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

        - `VaultID string`

          ID of the vault containing the affected credential.

      - `type BetaManagedAgentsRepositoryAuthenticationError`

        The repository host rejected the credentials, or required credentials and received none.

        - `Type RepositoryAuthenticationError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryAuthenticationErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryForbiddenError`

        The repository host refused access to the repository.

        - `Type RepositoryForbiddenError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryForbiddenErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryNotFoundError`

        The repository host reported the repository as not found.

        - `Type RepositoryNotFoundError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryNotFoundErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCheckoutError`

        The requested branch or commit does not exist in the repository.

        - `Type RepositoryCheckoutError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCheckoutErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCloneError`

        The repository could not be cloned.

        - `Type RepositoryCloneError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCloneErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

    - `ProcessedAt Time`

      Timestamp when the error occurred.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRescheduledEvent`

    Indicates the session is recovering from an error state and is rescheduled for execution.

    - `Type BetaManagedAgentsSessionStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRunningEvent`

    Indicates the session is actively running and the agent is working.

    - `Type BetaManagedAgentsSessionStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusIdleEvent`

    Indicates the agent has paused and is awaiting user input.

    - `Type BetaManagedAgentsSessionStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the session stopped. `null` when there is nothing more to report.

      - `Type Refusal`

      - `Category BetaManagedAgentsSessionRefusalStopDetailsCategory`

        The policy category that triggered the refusal, or `null` when there is no named category. New values can be added over time.

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryCyber BetaManagedAgentsSessionRefusalStopDetailsCategory = "cyber"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryBio BetaManagedAgentsSessionRefusalStopDetailsCategory = "bio"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryFrontierLLM BetaManagedAgentsSessionRefusalStopDetailsCategory = "frontier_llm"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryReasoningExtraction BetaManagedAgentsSessionRefusalStopDetailsCategory = "reasoning_extraction"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryGeneralHarms BetaManagedAgentsSessionRefusalStopDetailsCategory = "general_harms"`

      - `Explanation string`

        Human-readable explanation of the refusal, or `null` when none is available. The wording can change, so do not parse it.

    - `StopReason BetaManagedAgentsSessionStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

        - `Type BetaManagedAgentsSessionEndTurnType`

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

        - `Type BetaManagedAgentsSessionRequiresActionType`

        - `EventIDs []string`

          The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

        - `Type BetaManagedAgentsSessionRetriesExhaustedType`

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

        - `Type BetaManagedAgentsSessionBudgetReachedType`

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

        - `Type Refusal`

  - `type BetaManagedAgentsSessionStatusTerminatedEvent`

    Indicates the session has terminated, either due to an error or completion.

    - `Type BetaManagedAgentsSessionStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionThreadCreatedEvent`

    Emitted when a child thread is created. Written to the parent thread's output stream so clients observing the session see child creation.

    - `Type BetaManagedAgentsSessionThreadCreatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the callable agent the thread runs.

    - `ProcessedAt Time`

      Timestamp when the thread was created.

      format: date-time

    - `SessionThreadID string`

      Public `sthr_` ID of the newly created thread.

    - `WorkflowRunID string`

      Identifier of the workflow run that created the thread, or `null` for any other thread.

  - `type BetaManagedAgentsSpanOutcomeEvaluationStartEvent`

    Emitted when an outcome evaluation cycle begins.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation started.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationEndEvent`

    Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of `needs_revision` means another evaluation cycle follows; `satisfied`, `max_iterations_reached`, `failed`, or `interrupted` are terminal — no further evaluation cycles follow.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `Explanation string`

      Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeEvaluationStartID string`

      The id of the corresponding `span.outcome_evaluation_start` event.

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation ended.

      format: date-time

    - `Result string`

      Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.

    - `Usage BetaManagedAgentsSpanModelUsage`

      Aggregate token usage for this evaluation cycle. Sums across all grader model requests within the cycle.

      - `CacheCreationInputTokens int64`

        Tokens used to create prompt cache in this request.

        format: int32

      - `CacheReadInputTokens int64`

        Tokens read from prompt cache in this request.

        format: int32

      - `InputTokens int64`

        Input tokens consumed by this request.

        format: int32

      - `OutputTokens int64`

        Output tokens generated by this request.

        format: int32

      - `Speed BetaManagedAgentsSpanModelUsageSpeed Optional`

        Inference speed tier this request actually ran at. Mirrors `usage.speed` on /v1/messages. Only present when the fast-mode beta is active.

        - `const BetaManagedAgentsSpanModelUsageSpeedStandard BetaManagedAgentsSpanModelUsageSpeed = "standard"`

        - `const BetaManagedAgentsSpanModelUsageSpeedFast BetaManagedAgentsSpanModelUsageSpeed = "fast"`

  - `type BetaManagedAgentsSpanModelRequestStartEvent`

    Emitted when a model request is initiated by the agent.

    - `Type BetaManagedAgentsSpanModelRequestStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the model request started.

      format: date-time

  - `type BetaManagedAgentsSpanModelRequestEndEvent`

    Emitted when a model request completes.

    - `Type BetaManagedAgentsSpanModelRequestEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `IsError bool`

      Whether the model request resulted in an error.

    - `ModelRequestStartID string`

      The id of the corresponding `span.model_request_start` event.

    - `ModelUsage BetaManagedAgentsSpanModelUsage`

      Token usage for this model request.

    - `ProcessedAt Time`

      Timestamp when the model request completed.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding `span.outcome_evaluation_start` and `span.outcome_evaluation_end` events.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when this heartbeat was emitted.

      format: date-time

  - `type BetaManagedAgentsUserDefineOutcomeEvent`

    Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.

    - `Type BetaManagedAgentsUserDefineOutcomeEventType`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      What the agent should produce. Copied from the input event.

    - `MaxIterations int64`

      Evaluate-then-revise cycles before giving up. Default 3, max 20.

      format: int32

    - `OutcomeID string`

      Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.

    - `ProcessedAt Time`

      Timestamp when the outcome was accepted.

      format: date-time

    - `Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion`

      How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.

      - `type BetaManagedAgentsFileRubric`

        Rubric referenced by a file uploaded via the Files API.

        - `Type BetaManagedAgentsFileRubricType`

        - `FileID string`

          ID of the rubric file.

      - `type BetaManagedAgentsTextRubric`

        Rubric content provided inline as text.

        - `Type BetaManagedAgentsTextRubricType`

        - `Content string`

          Rubric content. Plain text or markdown — the grader treats it as freeform text.

  - `type BetaManagedAgentsSessionDeletedEvent`

    Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.

    - `Type BetaManagedAgentsSessionDeletedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the session was deleted.

      format: date-time

  - `type BetaManagedAgentsSessionThreadStatusRunningEvent`

    A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that started running.

  - `type BetaManagedAgentsSessionThreadStatusIdleEvent`

    A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that went idle.

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the thread stopped. `null` when there is nothing more to report.

    - `StopReason BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

  - `type BetaManagedAgentsSessionThreadStatusTerminatedEvent`

    A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that terminated.

  - `type BetaManagedAgentsUserToolResultEvent`

    Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

    - `Type BetaManagedAgentsUserToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsSessionThreadStatusRescheduledEvent`

    A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that is retrying.

  - `type BetaManagedAgentsSessionUpdatedEvent`

    Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.

    - `Type BetaManagedAgentsSessionUpdatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the update was applied.

      format: date-time

    - `Agent BetaManagedAgentsSessionAgent Optional`

      The session's effective agent configuration after the update. Present only when the update changed `agent` (tools or mcp_servers); when present it is the full materialised snapshot, not a diff.

      - `Type BetaManagedAgentsSessionAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

        Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

        - `type BetaManagedAgentsSessionMultiagentCoordinator`

          Resolved coordinator topology with full agent definitions for each roster member.

          - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

          - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

            Full `agent` definitions the coordinator may spawn as session threads.

            - `type BetaManagedAgentsSessionThreadAgent`

              Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Type BetaManagedAgentsMCPServerURLDefinitionType`

                - `Name string`

                - `URL string`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `type BetaManagedAgentsAnthropicSkill`

                  A resolved Anthropic-managed skill.

                  - `Type BetaManagedAgentsAnthropicSkillType`

                  - `SkillID string`

                  - `Version string`

                - `type BetaManagedAgentsCustomSkill`

                  A resolved user-created custom skill.

                  - `Type BetaManagedAgentsCustomSkillType`

                  - `SkillID string`

                  - `Version string`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `type BetaManagedAgentsAgentToolset20260401`

                  - `Type BetaManagedAgentsAgentToolset20260401Type`

                  - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                    - `type BetaManagedAgentsBashToolConfig`

                      Configuration for the bash tool.

                      - `Type Bash`

                      - `Enabled bool`

                      - `Name Bash`

                      - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                          - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                          - `Type BetaManagedAgentsAlwaysAskPolicyType`

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                          - `Type Auto`

                    - `type BetaManagedAgentsEditToolConfig`

                      Configuration for the edit tool.

                      - `Type Edit`

                      - `Enabled bool`

                      - `Name Edit`

                      - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsReadToolConfig`

                      Configuration for the read tool.

                      - `Type Read`

                      - `Enabled bool`

                      - `Name Read`

                      - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWriteToolConfig`

                      Configuration for the write tool.

                      - `Type Write`

                      - `Enabled bool`

                      - `Name Write`

                      - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGlobToolConfig`

                      Configuration for the glob tool.

                      - `Type Glob`

                      - `Enabled bool`

                      - `Name Glob`

                      - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGrepToolConfig`

                      Configuration for the grep tool.

                      - `Type Grep`

                      - `Enabled bool`

                      - `Name Grep`

                      - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWebFetchToolConfig`

                      Configuration for the web_fetch tool.

                      - `Type WebFetch`

                      - `Enabled bool`

                      - `Name WebFetch`

                      - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `URLSources BetaManagedAgentsWebFetchURLSources`

                        Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                        - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                            - `Type All`

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                            - `Type None`

                          - `type BetaManagedAgentsWebFetchURLSourceOnly`

                            Only the named tools' results contribute URLs that may be fetched.

                            - `Type Only`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                          - `type BetaManagedAgentsWebFetchURLSourceExcept`

                            Every tool's results contribute URLs that may be fetched, except the named tools' results.

                            - `Type Except`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                        - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                        - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                          Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `MaxContentTokens int64 Optional`

                        format: int32

                    - `type BetaManagedAgentsWebSearchToolConfig`

                      Configuration for the web_search tool.

                      - `Type WebSearch`

                      - `Enabled bool`

                      - `Name WebSearch`

                      - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `UserLocation BetaManagedAgentsUserLocation Optional`

                        Approximate user location for search result localization.

                        - `Type Approximate`

                          Location precision. Only "approximate" is supported.

                        - `City string Optional`

                          City name.

                          minLength: 1, maxLength: 255

                        - `Country string Optional`

                          Two-letter ISO 3166-1 country code, uppercase.

                        - `Region string Optional`

                          Region or state name.

                          minLength: 1, maxLength: 255

                        - `Timezone string Optional`

                          IANA timezone identifier, e.g. "America/Los_Angeles".

                          minLength: 1, maxLength: 255

                  - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                    Resolved default configuration for agent tools.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `type BetaManagedAgentsMCPToolset`

                  - `Type BetaManagedAgentsMCPToolsetType`

                  - `Configs []BetaManagedAgentsMCPToolConfig`

                    - `Enabled bool`

                    - `Name string`

                    - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                    Resolved default configuration for all tools from an MCP server.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `MCPServerName string`

                - `type BetaManagedAgentsCustomTool`

                  A custom tool as returned in API responses.

                  - `Type BetaManagedAgentsCustomToolType`

                  - `Description string`

                  - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                    JSON Schema for custom tool input parameters.

                    - `Type Object`

                    - `Properties map[string, any] Optional`

                    - `Required []string Optional`

                  - `Name string`

              - `Version int64`

                format: int32

            - `type BetaManagedAgentsAdvisor`

              Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

              - `Type BetaManagedAgentsAdvisorType`

              - `Model string`

                The advisor model id.

        - `type BetaManagedAgentsSessionMultiagent20261001`

          Resolved multiagent configuration with three members, as copied to the `session` at creation.

          - `Type Multiagent20261001`

          - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

            Whether the session's primary thread can consult an advisor model.

            - `type BetaManagedAgentsMultiagentAdvisorEnabled`

              The session's primary thread can consult `model` mid-turn.

              - `Type Enabled`

              - `Model string`

                The advisor model id.

            - `type BetaManagedAgentsMultiagentAdvisorDisabled`

              The agent has no advisor.

              - `Type Disabled`

          - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

            Whether the agent can spawn session threads.

            - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

              The agent can spawn session threads.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether the agent can define inline agents, which are not saved, when it spawns session threads.

                - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                  The agent can define inline agents.

                  - `Type Enabled`

                - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                  The agent cannot define inline agents.

                  - `Type Disabled`

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentSubagentsDisabled`

              The agent cannot spawn session threads.

              - `Type Disabled`

          - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

            Whether the agent can start workflow runs.

            - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

              The agent can start workflow runs.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether a run's plan can define inline agents, which are not saved.

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

              The agent cannot start workflow runs.

              - `Type Disabled`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsSessionAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

      - `Version int64`

        format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's budget after the update: the new budget when set or replaced, or null when the update removed it. Present only when the update changed the budget.

      - `Type BetaManagedAgentsBudgetLimitType`

      - `MaxListCost BetaMonetaryAmount`

        Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

        - `Amount string`

          Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

        - `Currency BetaCurrency`

          Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `Metadata map[string, string] Optional`

      The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.

    - `Title string Optional`

      The session's new title. Present only when the update changed it.

  - `type BetaManagedAgentsSystemMessageEvent`

    A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.

    - `Type BetaManagedAgentsSystemMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsSystemContentBlock`

      System content blocks. Text-only.

      - `Type BetaManagedAgentsSystemContentBlockType`

      - `Text string`

        The text content.

        minLength: 1

    - `ProcessedAt Time Optional`

      Timestamp when this system message was processed.

      format: date-time

  - `type BetaManagedAgentsSessionUsageEvent`

    Periodic snapshot of the session's cumulative usage and tracked list cost.

    - `Type BetaManagedAgentsSessionUsageEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the snapshot was taken.

      format: date-time

    - `Usage BetaManagedAgentsSessionUsageSnapshot`

      The session's cumulative usage at the snapshot time.

      - `ActiveSeconds float64 Optional`

        Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once. This is the duration the session's runtime cost is priced on.

        format: double

      - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

        Tokens used to create prompt cache entries, broken down by cache TTL.

        - `Ephemeral1hInputTokens int64 Optional`

          Tokens used to create 1-hour ephemeral cache entries.

          format: int32

        - `Ephemeral5mInputTokens int64 Optional`

          Tokens used to create 5-minute ephemeral cache entries.

          format: int32

      - `CacheReadInputTokens int64 Optional`

        Total tokens read from prompt cache.

        format: int32

      - `InputTokens int64 Optional`

        Total input tokens consumed across all turns.

        format: int32

      - `ListCost BetaMonetaryAmount Optional`

        Cumulative list cost of the session across all turns, priced at public list rates.

      - `OutputTokens int64 Optional`

        Total output tokens generated across all turns.

        format: int32

      - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

        Cumulative server-executed tool usage across all turns.

        - `WebFetchRequests int64 Optional`

          Number of server-executed web fetch requests.

          format: int32

        - `WebSearchRequests int64 Optional`

          Number of server-executed web search requests.

          format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's configured budget at the snapshot time, or null when the session has no budget.

  - `type BetaManagedAgentsWorkflowRunCreatedEvent`

    A workflow run was created. A workflow run is background work that the session's agent starts. Emitted once per run, before the run's other `workflow_run.*` events.

    - `Type WorkflowRunCreated`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      Description that the agent gave the run, passed on as written, or `null` if it gave none.

    - `Name string`

      Name that the agent gave the run, passed on as written, or a name that the server assigned.

    - `Phases []BetaManagedAgentsWorkflowRunPhase`

      The phases that the run's plan declares, in the plan's order. Can be empty.

      - `ID string`

        Unique identifier for the phase.

      - `Description string`

        Description that the agent gave the phase, passed on as written, or `null` if it gave none.

      - `Name string`

        Name that the agent gave the phase, passed on as written.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusEndedEvent`

    A workflow run ended. Emitted once per run, as the last of the run's `workflow_run.*` events.

    - `Type WorkflowRunStatusEnded`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Result BetaManagedAgentsWorkflowRunResultUnion`

      How the run ended.

      - `type BetaManagedAgentsWorkflowRunResultCompleted`

        The run's plan, a program that the agent wrote, finished. This does not say whether the work succeeded.

        - `Type Completed`

      - `type BetaManagedAgentsWorkflowRunResultError`

        The run failed or reached its time limit.

        - `Type Error`

        - `Error BetaManagedAgentsWorkflowRunErrorUnion`

          Why the run did not finish.

          - `type BetaManagedAgentsTimeoutWorkflowRunError`

            The run reached its time limit.

            - `Type TimeoutError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsProgramWorkflowRunError`

            The plan, a program that the agent wrote, failed, or the server refused it.

            - `Type ProgramError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsUnknownWorkflowRunError`

            A failure that has no type of its own.

            - `Type UnknownError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsThreadLimitWorkflowRunError`

            The run exceeded the limit on the number of threads that a run can create.

            - `Type ThreadLimitError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsMaxWorkflowRunsWorkflowRunError`

            No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only `workflow_run.error` carries this type.

            - `Type MaxWorkflowRunsError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

      - `type BetaManagedAgentsWorkflowRunResultStopped`

        The agent stopped the run.

        - `Type Stopped`

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunPhaseStartedEvent`

    A workflow run's plan entered a phase.

    - `Type WorkflowRunPhaseStarted`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunPhaseEndedEvent`

    A workflow run's plan left a phase, or the run's end closed it. Emitted once for every `workflow_run.phase_started` event, before the run's `workflow_run.status_ended` event. The event does not say whether the plan finished the phase's work, or why it left.

    - `Type WorkflowRunPhaseEnded`

    - `ID string`

      Unique identifier for this event.

    - `PhaseStartedID string`

      Identifier of the `workflow_run.phase_started` event that opened the phase.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunStatusRunningEvent`

    A workflow run is running. Emitted when the run starts to execute, and each time it resumes after being idle. A run that starts idle emits `workflow_run.status_idle` first.

    - `Type WorkflowRunStatusRunning`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusIdleEvent`

    A workflow run is idle. Emitted each time the run goes idle, whatever the cause. If the run ends while idle, no `workflow_run.status_running` comes between this event and its `workflow_run.status_ended`.

    - `Type WorkflowRunStatusIdle`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunErrorEvent`

    A workflow run met an error, or an error kept a run from being created. A run that ends with a `result.type` of `error` emits this event before its `workflow_run.status_ended`, with the same `error`.

    - `Type WorkflowRunError`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsWorkflowRunErrorUnion`

      Why the run did not finish, or was not created.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run that met the error, or `null` when the error kept a run from being created.

#### 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"),
	)
	page, err := client.Beta.Sessions.Threads.Events.List(
		context.TODO(),
		"sthr_011CZkZVWa6oJjw1rgXZpnBt",
		anthropic.BetaSessionThreadEventListParams{
			SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
      "content": [
        {
          "text": "Where is my order #1234?",
          "type": "text"
        }
      ],
      "type": "user.message",
      "processed_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sevt_011CZkZHPq1jCdq5mbRTjiVn",
      "content": [
        {
          "text": "Let me look up order #1234 for you.",
          "type": "text"
        }
      ],
      "processed_at": "2026-03-15T10:00:00Z",
      "type": "agent.message"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Stream Session Thread Events

`client.Beta.Sessions.Threads.Events.StreamEvents(ctx, threadID, params) *ssestream.Stream[BetaManagedAgentsStreamSessionThreadEventsUnion]`

**GET** `/v1/sessions/{session_id}/threads/{thread_id}/stream`

Stream Session Thread Events

#### Parameters

- `threadID string` (path parameter)

- `params BetaSessionThreadEventStreamParams`

  - `SessionID string` (path parameter)

  - `EventDeltas []BetaManagedAgentsDeltaType Optional` (query parameter)

    When set, this connection also receives streaming deltas (`event_start`, `event_delta`) while an event is being produced, before the event itself arrives. Deltas are best-effort; when the final event is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no final event — its terminal `span.model_request_end` closes the preview. Accepts one or more event types to preview and may be repeated: `agent.message` streams `content_delta` fragments; `agent.thinking` is start-only — a signal that the agent has begun extended thinking, concluded by the `agent.thinking` event itself. Only previews of the requested event types are sent.

    - `const BetaManagedAgentsDeltaTypeAgentMessage BetaManagedAgentsDeltaType = "agent.message"`

    - `const BetaManagedAgentsDeltaTypeAgentThinking BetaManagedAgentsDeltaType = "agent.thinking"`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsStreamSessionThreadEventsUnion interface{…}`

  Server-sent event in a single thread's stream.

  - `type BetaManagedAgentsUserMessageEvent`

    A user message event in the session conversation.

    - `Type BetaManagedAgentsUserMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsUserMessageEventContentUnion`

      Array of content blocks comprising the user message.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

        - `Type BetaManagedAgentsTextBlockType`

        - `Text string`

          The text content.

          minLength: 1

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

        - `Type BetaManagedAgentsImageBlockType`

        - `Source BetaManagedAgentsImageBlockSourceUnion`

          The source of the image data.

          - `type BetaManagedAgentsBase64ImageSource`

            Base64-encoded image data.

            - `Type BetaManagedAgentsBase64ImageSourceType`

            - `Data string`

              Base64-encoded image data.

              minLength: 1

            - `MediaType string`

              MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

              minLength: 1

          - `type BetaManagedAgentsURLImageSource`

            Image referenced by URL.

            - `Type BetaManagedAgentsURLImageSourceType`

            - `URL string`

              URL of the image to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileImageSource`

            Image referenced by file ID.

            - `Type BetaManagedAgentsFileImageSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

        - `Type BetaManagedAgentsDocumentBlockType`

        - `Source BetaManagedAgentsDocumentBlockSourceUnion`

          The source of the document data.

          - `type BetaManagedAgentsBase64DocumentSource`

            Base64-encoded document data.

            - `Type BetaManagedAgentsBase64DocumentSourceType`

            - `Data string`

              Base64-encoded document data.

              minLength: 1

            - `MediaType string`

              MIME type of the document (e.g., "application/pdf").

              minLength: 1

          - `type BetaManagedAgentsPlainTextDocumentSource`

            Plain text document content.

            - `Type BetaManagedAgentsPlainTextDocumentSourceType`

            - `Data string`

              The plain text content.

              minLength: 1

            - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

              MIME type of the text content. Must be "text/plain".

          - `type BetaManagedAgentsURLDocumentSource`

            Document referenced by URL.

            - `Type BetaManagedAgentsURLDocumentSourceType`

            - `URL string`

              URL of the document to fetch.

              minLength: 1

          - `type BetaManagedAgentsFileDocumentSource`

            Document referenced by file ID.

            - `Type BetaManagedAgentsFileDocumentSourceType`

            - `FileID string`

              ID of a previously uploaded file.

              minLength: 1

        - `Context string Optional`

          Additional context about the document for the model.

        - `Title string Optional`

          The title of the document.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

        - `Type BetaManagedAgentsRedactedBlockType`

    - `ProcessedAt Time Optional`

      Timestamp when the agent finished processing this message.

      format: date-time

  - `type BetaManagedAgentsUserInterruptEvent`

    An interrupt event that pauses agent execution and returns control to the user.

    - `Type BetaManagedAgentsUserInterruptEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time Optional`

      Timestamp when the interrupt was processed.

      format: date-time

    - `SessionThreadID string Optional`

      If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

  - `type BetaManagedAgentsUserToolConfirmationEvent`

    A tool confirmation event that approves or denies a pending tool execution.

    - `Type BetaManagedAgentsUserToolConfirmationEventType`

    - `ID string`

      Unique identifier for this event.

    - `Result BetaManagedAgentsUserToolConfirmationEventResult`

      The confirmation result: 'allow' or 'deny'.

      - `const BetaManagedAgentsUserToolConfirmationEventResultAllow BetaManagedAgentsUserToolConfirmationEventResult = "allow"`

      - `const BetaManagedAgentsUserToolConfirmationEventResultDeny BetaManagedAgentsUserToolConfirmationEventResult = "deny"`

    - `ToolUseID string`

      The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `DenyMessage string Optional`

      Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

      maxLength: 10000

    - `ProcessedAt Time Optional`

      Timestamp when the confirmation was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsUserCustomToolResultEvent`

    Event sent by the client providing the result of a custom tool execution.

    - `Type BetaManagedAgentsUserCustomToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `CustomToolUseID string`

      The id of the `agent.custom_tool_use` event this result corresponds to. It is also listed in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserCustomToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

        - `Type BetaManagedAgentsSearchResultBlockType`

        - `Citations BetaManagedAgentsSearchResultCitations`

          Citation settings for this search result.

          - `Enabled bool`

            Whether citations are enabled for this search result.

        - `Content []BetaManagedAgentsSearchResultContent`

          Array of text content blocks from the search result.

          - `Type BetaManagedAgentsSearchResultContentType`

          - `Text string`

            The text content.

            minLength: 1

        - `Source string`

          The URL source of the search result.

          minLength: 1

        - `Title string`

          The title of the search result.

          minLength: 1

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsAgentCustomToolUseEvent`

    Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result. The client can send it as soon as this event arrives, without waiting for `session.status_idle`.

    - `Type BetaManagedAgentsAgentCustomToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the custom tool being called.

    - `ProcessedAt Time`

      Timestamp when this tool use was processed.

      format: date-time

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMessageEvent`

    An agent response event in the session conversation.

    - `Type BetaManagedAgentsAgentMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentMessageEventContentUnion`

      Array of text blocks comprising the agent response.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when this response was generated.

      format: date-time

  - `type BetaManagedAgentsAgentThinkingEvent`

    Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.

    - `Type BetaManagedAgentsAgentThinkingEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this thinking was produced.

      format: date-time

  - `type BetaManagedAgentsAgentMCPToolUseEvent`

    Event emitted when the agent invokes a tool provided by an MCP server.

    - `Type BetaManagedAgentsAgentMCPToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `MCPServerName string`

      Name of the MCP server providing the tool.

    - `Name string`

      Name of the MCP tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

      - `const BetaManagedAgentsAgentEvaluatedPermissionAllow BetaManagedAgentsAgentEvaluatedPermission = "allow"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionAsk BetaManagedAgentsAgentEvaluatedPermission = "ask"`

      - `const BetaManagedAgentsAgentEvaluatedPermissionDeny BetaManagedAgentsAgentEvaluatedPermission = "deny"`

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAllow`

        The resolved permission_policy was always_allow; accompanies evaluated_permission "allow".

        - `Type AlwaysAllow`

      - `type BetaManagedAgentsAgentToolEvaluationAlwaysAsk`

        The resolved permission_policy was always_ask; accompanies evaluated_permission "ask".

        - `Type AlwaysAsk`

      - `type BetaManagedAgentsAgentToolEvaluationAuto`

        The resolved permission_policy was auto: the server judged this invocation individually.

        - `Type Auto`

        - `EvaluatedPermission BetaManagedAgentsAgentAutoEvaluatedPermissionUnion`

          The server's judgement for this invocation.

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAllow`

            The server judged the invocation safe to execute without client approval.

            - `Type Allow`

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionAsk`

            The server reached no judgement; the invocation is held for client approval.

            - `Type Ask`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.

              maxLength: 64

          - `type BetaManagedAgentsAgentAutoEvaluatedPermissionDeny`

            The server judged the invocation high-risk; it does not execute and a synthetic error tool result is appended.

            - `Type Deny`

            - `ReasonCode string`

              The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.

              maxLength: 64

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentMCPToolResultEvent`

    Event representing the result of an MCP tool execution.

    - `Type BetaManagedAgentsAgentMCPToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `MCPToolUseID string`

      The id of the `agent.mcp_tool_use` event this result corresponds to.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Content []BetaManagedAgentsAgentMCPToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentToolUseEvent`

    Event emitted when the agent invokes a built-in agent tool.

    - `Type BetaManagedAgentsAgentToolUseEventType`

    - `ID string`

      Unique identifier for this event.

    - `Input map[string, any]`

      Input parameters for the tool call.

    - `Name string`

      Name of the agent tool being used.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `EvaluatedPermission BetaManagedAgentsAgentEvaluatedPermission Optional`

      The evaluated permission policy for this tool invocation.

    - `Evaluation BetaManagedAgentsAgentToolEvaluationUnion Optional`

      Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

    - `SessionThreadID string Optional`

      When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back.

  - `type BetaManagedAgentsAgentToolResultEvent`

    Event representing the result of an agent tool execution.

    - `Type BetaManagedAgentsAgentToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to.

    - `Content []BetaManagedAgentsAgentToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

  - `type BetaManagedAgentsAgentThreadMessageReceivedEvent`

    Delivery event written to the target thread's input stream when an agent-to-agent message arrives.

    - `Type BetaManagedAgentsAgentThreadMessageReceivedEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `FromSessionThreadID string`

      Public `sthr_` ID of the thread that sent the message.

    - `ProcessedAt Time`

      Timestamp when the message was received.

      format: date-time

    - `FromAgentName string Optional`

      Name of the callable agent this message came from. Absent when received from the primary agent.

  - `type BetaManagedAgentsAgentThreadMessageSentEvent`

    Observability event emitted to the sender's output stream when an agent-to-agent message is sent.

    - `Type BetaManagedAgentsAgentThreadMessageSentEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsAgentThreadMessageSentEventContentUnion`

      Message content blocks.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsRedactedBlock`

        Placeholder for content withheld by Anthropic model policy.

    - `ProcessedAt Time`

      Timestamp when the message was sent.

      format: date-time

    - `ToSessionThreadID string`

      Public `sthr_` ID of the thread the message was sent to.

    - `ToAgentName string Optional`

      Name of the callable agent this message was sent to. Absent when sent to the primary agent.

  - `type BetaManagedAgentsAgentThreadContextCompactedEvent`

    Indicates that context compaction (summarization) occurred during the session.

    - `Type BetaManagedAgentsAgentThreadContextCompactedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when compaction was processed.

      format: date-time

  - `type BetaManagedAgentsSessionErrorEvent`

    An error event indicating a problem occurred during session execution.

    - `Type BetaManagedAgentsSessionErrorEventType`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsSessionErrorEventErrorUnion`

      - `type BetaManagedAgentsUnknownError`

        An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.

        - `Type BetaManagedAgentsUnknownErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsUnknownErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

            - `Type BetaManagedAgentsRetryStatusRetryingType`

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

            - `Type BetaManagedAgentsRetryStatusExhaustedType`

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

            - `Type BetaManagedAgentsRetryStatusTerminalType`

      - `type BetaManagedAgentsModelOverloadedError`

        The model is currently overloaded. Emitted after automatic retries are exhausted.

        - `Type BetaManagedAgentsModelOverloadedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelOverloadedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRateLimitedError`

        The model request was rate-limited.

        - `Type BetaManagedAgentsModelRateLimitedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsModelRequestFailedError`

        A model request failed for a reason other than overload or rate-limiting.

        - `Type BetaManagedAgentsModelRequestFailedErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPConnectionFailedError`

        Failed to connect to an MCP server.

        - `Type BetaManagedAgentsMCPConnectionFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed to connect.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsMCPAuthenticationFailedError`

        Authentication to an MCP server failed.

        - `Type BetaManagedAgentsMCPAuthenticationFailedErrorType`

        - `MCPServerName string`

          Name of the MCP server that failed authentication.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsBillingError`

        The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.

        - `Type BetaManagedAgentsBillingErrorType`

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsBillingErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsCredentialHostUnreachableError`

        An `environment_variable` credential's `auth.networking.allowed_hosts` includes a host the environment's network policy does not permit.

        - `Type BetaManagedAgentsCredentialHostUnreachableErrorType`

        - `CredentialID string`

          ID of the affected credential.

        - `Message string`

          Human-readable error description.

        - `RetryStatus BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion`

          What the client should do next.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

        - `VaultID string`

          ID of the vault containing the affected credential.

      - `type BetaManagedAgentsRepositoryAuthenticationError`

        The repository host rejected the credentials, or required credentials and received none.

        - `Type RepositoryAuthenticationError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryAuthenticationErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryForbiddenError`

        The repository host refused access to the repository.

        - `Type RepositoryForbiddenError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryForbiddenErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryNotFoundError`

        The repository host reported the repository as not found.

        - `Type RepositoryNotFoundError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryNotFoundErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCheckoutError`

        The requested branch or commit does not exist in the repository.

        - `Type RepositoryCheckoutError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCheckoutErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

      - `type BetaManagedAgentsRepositoryCloneError`

        The repository could not be cloned.

        - `Type RepositoryCloneError`

        - `Message string`

          Human-readable error description.

        - `RepositoryURL string`

          URL of the repository that could not be cloned. Null when it could not be identified.

        - `RetryStatus BetaManagedAgentsRepositoryCloneErrorRetryStatusUnion`

          What the client should do next. Always `retrying`: the session keeps running without the repository.

          - `type BetaManagedAgentsRetryStatusRetrying`

            The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

          - `type BetaManagedAgentsRetryStatusExhausted`

            This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

          - `type BetaManagedAgentsRetryStatusTerminal`

            The session encountered a terminal error and will transition to `terminated` state.

    - `ProcessedAt Time`

      Timestamp when the error occurred.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRescheduledEvent`

    Indicates the session is recovering from an error state and is rescheduled for execution.

    - `Type BetaManagedAgentsSessionStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusRunningEvent`

    Indicates the session is actively running and the agent is working.

    - `Type BetaManagedAgentsSessionStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionStatusIdleEvent`

    Indicates the agent has paused and is awaiting user input.

    - `Type BetaManagedAgentsSessionStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the session stopped. `null` when there is nothing more to report.

      - `Type Refusal`

      - `Category BetaManagedAgentsSessionRefusalStopDetailsCategory`

        The policy category that triggered the refusal, or `null` when there is no named category. New values can be added over time.

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryCyber BetaManagedAgentsSessionRefusalStopDetailsCategory = "cyber"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryBio BetaManagedAgentsSessionRefusalStopDetailsCategory = "bio"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryFrontierLLM BetaManagedAgentsSessionRefusalStopDetailsCategory = "frontier_llm"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryReasoningExtraction BetaManagedAgentsSessionRefusalStopDetailsCategory = "reasoning_extraction"`

        - `const BetaManagedAgentsSessionRefusalStopDetailsCategoryGeneralHarms BetaManagedAgentsSessionRefusalStopDetailsCategory = "general_harms"`

      - `Explanation string`

        Human-readable explanation of the refusal, or `null` when none is available. The wording can change, so do not parse it.

    - `StopReason BetaManagedAgentsSessionStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

        - `Type BetaManagedAgentsSessionEndTurnType`

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

        - `Type BetaManagedAgentsSessionRequiresActionType`

        - `EventIDs []string`

          The ids of events the agent is blocked on. Resolving fewer than all re-emits `session.status_idle` with the remainder.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

        - `Type BetaManagedAgentsSessionRetriesExhaustedType`

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

        - `Type BetaManagedAgentsSessionBudgetReachedType`

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

        - `Type Refusal`

  - `type BetaManagedAgentsSessionStatusTerminatedEvent`

    Indicates the session has terminated, either due to an error or completion.

    - `Type BetaManagedAgentsSessionStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp of status change.

      format: date-time

  - `type BetaManagedAgentsSessionThreadCreatedEvent`

    Emitted when a child thread is created. Written to the parent thread's output stream so clients observing the session see child creation.

    - `Type BetaManagedAgentsSessionThreadCreatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the callable agent the thread runs.

    - `ProcessedAt Time`

      Timestamp when the thread was created.

      format: date-time

    - `SessionThreadID string`

      Public `sthr_` ID of the newly created thread.

    - `WorkflowRunID string`

      Identifier of the workflow run that created the thread, or `null` for any other thread.

  - `type BetaManagedAgentsSpanOutcomeEvaluationStartEvent`

    Emitted when an outcome evaluation cycle begins.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation started.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationEndEvent`

    Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of `needs_revision` means another evaluation cycle follows; `satisfied`, `max_iterations_reached`, `failed`, or `interrupted` are terminal — no further evaluation cycles follow.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `Explanation string`

      Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeEvaluationStartID string`

      The id of the corresponding `span.outcome_evaluation_start` event.

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when outcome evaluation ended.

      format: date-time

    - `Result string`

      Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.

    - `Usage BetaManagedAgentsSpanModelUsage`

      Aggregate token usage for this evaluation cycle. Sums across all grader model requests within the cycle.

      - `CacheCreationInputTokens int64`

        Tokens used to create prompt cache in this request.

        format: int32

      - `CacheReadInputTokens int64`

        Tokens read from prompt cache in this request.

        format: int32

      - `InputTokens int64`

        Input tokens consumed by this request.

        format: int32

      - `OutputTokens int64`

        Output tokens generated by this request.

        format: int32

      - `Speed BetaManagedAgentsSpanModelUsageSpeed Optional`

        Inference speed tier this request actually ran at. Mirrors `usage.speed` on /v1/messages. Only present when the fast-mode beta is active.

        - `const BetaManagedAgentsSpanModelUsageSpeedStandard BetaManagedAgentsSpanModelUsageSpeed = "standard"`

        - `const BetaManagedAgentsSpanModelUsageSpeedFast BetaManagedAgentsSpanModelUsageSpeed = "fast"`

  - `type BetaManagedAgentsSpanModelRequestStartEvent`

    Emitted when a model request is initiated by the agent.

    - `Type BetaManagedAgentsSpanModelRequestStartEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the model request started.

      format: date-time

  - `type BetaManagedAgentsSpanModelRequestEndEvent`

    Emitted when a model request completes.

    - `Type BetaManagedAgentsSpanModelRequestEndEventType`

    - `ID string`

      Unique identifier for this event.

    - `IsError bool`

      Whether the model request resulted in an error.

    - `ModelRequestStartID string`

      The id of the corresponding `span.model_request_start` event.

    - `ModelUsage BetaManagedAgentsSpanModelUsage`

      Token usage for this model request.

    - `ProcessedAt Time`

      Timestamp when the model request completed.

      format: date-time

  - `type BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding `span.outcome_evaluation_start` and `span.outcome_evaluation_end` events.

    - `Type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType`

    - `ID string`

      Unique identifier for this event.

    - `Iteration int64`

      0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`.

      format: int32

    - `OutcomeID string`

      The `outc_` ID of the outcome being evaluated.

    - `ProcessedAt Time`

      Timestamp when this heartbeat was emitted.

      format: date-time

  - `type BetaManagedAgentsUserDefineOutcomeEvent`

    Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.

    - `Type BetaManagedAgentsUserDefineOutcomeEventType`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      What the agent should produce. Copied from the input event.

    - `MaxIterations int64`

      Evaluate-then-revise cycles before giving up. Default 3, max 20.

      format: int32

    - `OutcomeID string`

      Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.

    - `ProcessedAt Time`

      Timestamp when the outcome was accepted.

      format: date-time

    - `Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion`

      How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.

      - `type BetaManagedAgentsFileRubric`

        Rubric referenced by a file uploaded via the Files API.

        - `Type BetaManagedAgentsFileRubricType`

        - `FileID string`

          ID of the rubric file.

      - `type BetaManagedAgentsTextRubric`

        Rubric content provided inline as text.

        - `Type BetaManagedAgentsTextRubricType`

        - `Content string`

          Rubric content. Plain text or markdown — the grader treats it as freeform text.

  - `type BetaManagedAgentsSessionDeletedEvent`

    Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.

    - `Type BetaManagedAgentsSessionDeletedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the session was deleted.

      format: date-time

  - `type BetaManagedAgentsSessionThreadStatusRunningEvent`

    A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRunningEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that started running.

  - `type BetaManagedAgentsSessionThreadStatusIdleEvent`

    A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusIdleEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that went idle.

    - `StopDetails BetaManagedAgentsSessionRefusalStopDetails`

      Structured information about why the thread stopped. `null` when there is nothing more to report.

    - `StopReason BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion`

      - `type BetaManagedAgentsSessionEndTurn`

        The agent completed its turn naturally and is ready for the next user message.

      - `type BetaManagedAgentsSessionRequiresAction`

        The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

      - `type BetaManagedAgentsSessionRetriesExhausted`

        The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

      - `type BetaManagedAgentsSessionBudgetReached`

        The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

      - `type BetaManagedAgentsSessionRefusal`

        The turn ended because the model's response was refused, for example by a safety classifier.

  - `type BetaManagedAgentsSessionThreadStatusTerminatedEvent`

    A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusTerminatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that terminated.

  - `type BetaManagedAgentsUserToolResultEvent`

    Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

    - `Type BetaManagedAgentsUserToolResultEventType`

    - `ID string`

      Unique identifier for this event.

    - `ToolUseID string`

      The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` [event's](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=go#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `Content []BetaManagedAgentsUserToolResultEventContentUnion Optional`

      The result content returned by the tool.

      - `type BetaManagedAgentsTextBlock`

        Regular text content.

      - `type BetaManagedAgentsImageBlock`

        Image content specified directly as base64 data or as a reference via a URL.

      - `type BetaManagedAgentsDocumentBlock`

        Document content, either specified directly as base64 data, as text, or as a reference via a URL.

      - `type BetaManagedAgentsSearchResultBlock`

        A block containing a web search result.

    - `IsError bool Optional`

      Whether the tool execution resulted in an error.

    - `ProcessedAt Time Optional`

      Timestamp when this result was processed.

      format: date-time

    - `SessionThreadID string Optional`

      Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

  - `type BetaManagedAgentsSessionThreadStatusRescheduledEvent`

    A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

    - `Type BetaManagedAgentsSessionThreadStatusRescheduledEventType`

    - `ID string`

      Unique identifier for this event.

    - `AgentName string`

      Name of the agent the thread runs.

    - `ProcessedAt Time`

      Timestamp of the status transition.

      format: date-time

    - `SessionThreadID string`

      Public sthr_ ID of the thread that is retrying.

  - `type BetaManagedAgentsSessionUpdatedEvent`

    Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.

    - `Type BetaManagedAgentsSessionUpdatedEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the update was applied.

      format: date-time

    - `Agent BetaManagedAgentsSessionAgent Optional`

      The session's effective agent configuration after the update. Present only when the update changed `agent` (tools or mcp_servers); when present it is the full materialised snapshot, not a diff.

      - `Type BetaManagedAgentsSessionAgentType`

      - `ID string`

      - `Description string`

      - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

        Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

        - `type BetaManagedAgentsAWSRoleExecutionIdentity`

          An AWS IAM role principal as returned in API responses.

          - `Type AWSRole`

          - `RoleARN string`

            The IAM role's ARN.

        - `type BetaManagedAgentsServiceAccountExecutionIdentity`

          The Anthropic-managed service account as returned in API responses.

          - `Type ServiceAccount`

      - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

        - `Type BetaManagedAgentsMCPServerURLDefinitionType`

        - `Name string`

        - `URL string`

      - `Model BetaManagedAgentsModelConfig`

        Model identifier and configuration.

        - `ID BetaManagedAgentsModel`

          The model that will power your agent.

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

          - `const BetaManagedAgentsModelClaudeHaiku5_5 BetaManagedAgentsModel = "claude-haiku-5-5"`

            Fastest model for high-volume, real-time tasks

          - `const BetaManagedAgentsModelClaudeSonnet5_5 BetaManagedAgentsModel = "claude-sonnet-5-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeOpus5_5 BetaManagedAgentsModel = "claude-opus-5-5"`

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

          - `const BetaManagedAgentsModelClaudeFable5_1 BetaManagedAgentsModel = "claude-fable-5-1"`

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

          - `const BetaManagedAgentsModelClaudeSonnet5 BetaManagedAgentsModel = "claude-sonnet-5"`

            Efficient model for coding and agents

          - `const BetaManagedAgentsModelClaudeFable5 BetaManagedAgentsModel = "claude-fable-5"`

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

          - `const BetaManagedAgentsModelClaudeOpus5 BetaManagedAgentsModel = "claude-opus-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_8 BetaManagedAgentsModel = "claude-opus-4-8"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_7 BetaManagedAgentsModel = "claude-opus-4-7"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_6 BetaManagedAgentsModel = "claude-opus-4-6"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_6 BetaManagedAgentsModel = "claude-sonnet-4-6"`

            Best combination of speed and intelligence

          - `const BetaManagedAgentsModelClaudeHaiku4_5 BetaManagedAgentsModel = "claude-haiku-4-5"`

          - `const BetaManagedAgentsModelClaudeHaiku4_5_20251001 BetaManagedAgentsModel = "claude-haiku-4-5-20251001"`

          - `const BetaManagedAgentsModelClaudeOpus4_5 BetaManagedAgentsModel = "claude-opus-4-5"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeOpus4_5_20251101 BetaManagedAgentsModel = "claude-opus-4-5-20251101"`

            Powerful intelligence for long-running agents and coding

          - `const BetaManagedAgentsModelClaudeSonnet4_5 BetaManagedAgentsModel = "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 BetaManagedAgentsModelClaudeSonnet4_5_20250929 BetaManagedAgentsModel = "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

        - `Effort BetaManagedAgentsModelConfigEffortUnion Optional`

          How hard Claude works on each inference call. One of `low`, `medium`, `high`, `xhigh`, `max`. Always present; resolved to the per-model default at save time when not supplied.

          - `type BetaManagedAgentsEffortLow`

            Low effort. Favors latency over reasoning depth.

            - `Type BetaManagedAgentsEffortLowType`

          - `type BetaManagedAgentsEffortMedium`

            Medium effort. Balances latency and reasoning depth.

            - `Type BetaManagedAgentsEffortMediumType`

          - `type BetaManagedAgentsEffortHigh`

            High effort. Favors reasoning depth.

            - `Type BetaManagedAgentsEffortHighType`

          - `type BetaManagedAgentsEffortXhigh`

            Extra-high effort. Not all models accept this level.

            - `Type BetaManagedAgentsEffortXhighType`

          - `type BetaManagedAgentsEffortMax`

            Maximum effort. Favors reasoning depth over latency.

            - `Type BetaManagedAgentsEffortMaxType`

        - `InferenceGeo string Optional`

          Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo.

        - `Speed BetaManagedAgentsModelConfigSpeed Optional`

          Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Defaults to `standard`. Not all models support `fast`; invalid combinations are rejected at create time.

          - `const BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"`

          - `const BetaManagedAgentsModelConfigSpeedFast BetaManagedAgentsModelConfigSpeed = "fast"`

      - `Multiagent BetaManagedAgentsSessionMultiagentUnion`

        Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

        - `type BetaManagedAgentsSessionMultiagentCoordinator`

          Resolved coordinator topology with full agent definitions for each roster member.

          - `Type BetaManagedAgentsSessionMultiagentCoordinatorType`

          - `Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion`

            Full `agent` definitions the coordinator may spawn as session threads.

            - `type BetaManagedAgentsSessionThreadAgent`

              Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

              - `Type BetaManagedAgentsSessionThreadAgentType`

              - `ID string`

              - `Description string`

              - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

              - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Type BetaManagedAgentsMCPServerURLDefinitionType`

                - `Name string`

                - `URL string`

              - `Model BetaManagedAgentsModelConfig`

                Model identifier and configuration.

              - `Name string`

              - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `type BetaManagedAgentsAnthropicSkill`

                  A resolved Anthropic-managed skill.

                  - `Type BetaManagedAgentsAnthropicSkillType`

                  - `SkillID string`

                  - `Version string`

                - `type BetaManagedAgentsCustomSkill`

                  A resolved user-created custom skill.

                  - `Type BetaManagedAgentsCustomSkillType`

                  - `SkillID string`

                  - `Version string`

              - `System string`

              - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `type BetaManagedAgentsAgentToolset20260401`

                  - `Type BetaManagedAgentsAgentToolset20260401Type`

                  - `Configs []BetaManagedAgentsAgentToolConfigUnion`

                    - `type BetaManagedAgentsBashToolConfig`

                      Configuration for the bash tool.

                      - `Type Bash`

                      - `Enabled bool`

                      - `Name Bash`

                      - `PermissionPolicy BetaManagedAgentsBashToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                          - `Type BetaManagedAgentsAlwaysAllowPolicyType`

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                          - `Type BetaManagedAgentsAlwaysAskPolicyType`

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                          - `Type Auto`

                    - `type BetaManagedAgentsEditToolConfig`

                      Configuration for the edit tool.

                      - `Type Edit`

                      - `Enabled bool`

                      - `Name Edit`

                      - `PermissionPolicy BetaManagedAgentsEditToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsReadToolConfig`

                      Configuration for the read tool.

                      - `Type Read`

                      - `Enabled bool`

                      - `Name Read`

                      - `PermissionPolicy BetaManagedAgentsReadToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWriteToolConfig`

                      Configuration for the write tool.

                      - `Type Write`

                      - `Enabled bool`

                      - `Name Write`

                      - `PermissionPolicy BetaManagedAgentsWriteToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGlobToolConfig`

                      Configuration for the glob tool.

                      - `Type Glob`

                      - `Enabled bool`

                      - `Name Glob`

                      - `PermissionPolicy BetaManagedAgentsGlobToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsGrepToolConfig`

                      Configuration for the grep tool.

                      - `Type Grep`

                      - `Enabled bool`

                      - `Name Grep`

                      - `PermissionPolicy BetaManagedAgentsGrepToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                    - `type BetaManagedAgentsWebFetchToolConfig`

                      Configuration for the web_fetch tool.

                      - `Type WebFetch`

                      - `Enabled bool`

                      - `Name WebFetch`

                      - `PermissionPolicy BetaManagedAgentsWebFetchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `URLSources BetaManagedAgentsWebFetchURLSources`

                        Which sources contribute URLs the tool may fetch, always in the object form. Null when not set, which allows every source.

                        - `ClientToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which custom tools' results contribute URLs that may be fetched. Null when not set, which allows every custom tool's results.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                            - `Type All`

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                            - `Type None`

                          - `type BetaManagedAgentsWebFetchURLSourceOnly`

                            Only the named tools' results contribute URLs that may be fetched.

                            - `Type Only`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "none" to allow no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                          - `type BetaManagedAgentsWebFetchURLSourceExcept`

                            Every tool's results contribute URLs that may be fetched, except the named tools' results.

                            - `Type Except`

                            - `Tools []BetaManagedAgentsWebFetchURLSourceToolReference`

                              The tools whose results do not contribute. Between 1 and 128 entries, each with a different name. An empty list is rejected; use "all" to leave out no tool's results.

                              - `Type ToolReference`

                                Must be "tool_reference".

                              - `Name string`

                                Name of the tool. Compared exactly, so upper and lower case letters are different.

                                minLength: 1, maxLength: 128

                        - `ServerToolResults BetaManagedAgentsWebFetchURLSourceToolFilterUnion`

                          Which of the web_search and web_fetch tools' results contribute URLs that may be fetched. Null when not set, which allows both.

                        - `UserInput BetaManagedAgentsWebFetchURLSourceUserInputUnion`

                          Whether URLs in the text of user messages may be fetched. Null when not set, which allows them.

                          - `type BetaManagedAgentsWebFetchURLSourceAll`

                            Every URL from this source may be fetched. This is the default.

                          - `type BetaManagedAgentsWebFetchURLSourceNone`

                            This source contributes no URLs that may be fetched.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `MaxContentTokens int64 Optional`

                        format: int32

                    - `type BetaManagedAgentsWebSearchToolConfig`

                      Configuration for the web_search tool.

                      - `Type WebSearch`

                      - `Enabled bool`

                      - `Name WebSearch`

                      - `PermissionPolicy BetaManagedAgentsWebSearchToolConfigPermissionPolicyUnion`

                        Permission policy for tool execution.

                        - `type BetaManagedAgentsAlwaysAllowPolicy`

                          Tool calls are automatically approved without user confirmation.

                        - `type BetaManagedAgentsAlwaysAskPolicy`

                          Tool calls require user confirmation before execution.

                        - `type BetaManagedAgentsAutoPolicy`

                          The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                      - `AllowedDomains []string Optional`

                      - `BlockedDomains []string Optional`

                      - `UserLocation BetaManagedAgentsUserLocation Optional`

                        Approximate user location for search result localization.

                        - `Type Approximate`

                          Location precision. Only "approximate" is supported.

                        - `City string Optional`

                          City name.

                          minLength: 1, maxLength: 255

                        - `Country string Optional`

                          Two-letter ISO 3166-1 country code, uppercase.

                        - `Region string Optional`

                          Region or state name.

                          minLength: 1, maxLength: 255

                        - `Timezone string Optional`

                          IANA timezone identifier, e.g. "America/Los_Angeles".

                          minLength: 1, maxLength: 255

                  - `DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig`

                    Resolved default configuration for agent tools.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                - `type BetaManagedAgentsMCPToolset`

                  - `Type BetaManagedAgentsMCPToolsetType`

                  - `Configs []BetaManagedAgentsMCPToolConfig`

                    - `Enabled bool`

                    - `Name string`

                    - `PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig`

                    Resolved default configuration for all tools from an MCP server.

                    - `Enabled bool`

                    - `PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion`

                      Permission policy for tool execution.

                      - `type BetaManagedAgentsAlwaysAllowPolicy`

                        Tool calls are automatically approved without user confirmation.

                      - `type BetaManagedAgentsAlwaysAskPolicy`

                        Tool calls require user confirmation before execution.

                      - `type BetaManagedAgentsAutoPolicy`

                        The server decides each tool call individually: it judges, from the tool, its input, and the session content so far, whether the call is safe to execute or high-risk, and evaluates it to allow when judged safe and to deny when judged high-risk. A call the server cannot reach a judgement on evaluates to ask.

                  - `MCPServerName string`

                - `type BetaManagedAgentsCustomTool`

                  A custom tool as returned in API responses.

                  - `Type BetaManagedAgentsCustomToolType`

                  - `Description string`

                  - `InputSchema BetaManagedAgentsCustomToolInputSchema`

                    JSON Schema for custom tool input parameters.

                    - `Type Object`

                    - `Properties map[string, any] Optional`

                    - `Required []string Optional`

                  - `Name string`

              - `Version int64`

                format: int32

            - `type BetaManagedAgentsAdvisor`

              Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

              - `Type BetaManagedAgentsAdvisorType`

              - `Model string`

                The advisor model id.

        - `type BetaManagedAgentsSessionMultiagent20261001`

          Resolved multiagent configuration with three members, as copied to the `session` at creation.

          - `Type Multiagent20261001`

          - `Advisor BetaManagedAgentsMultiagentAdvisorUnion`

            Whether the session's primary thread can consult an advisor model.

            - `type BetaManagedAgentsMultiagentAdvisorEnabled`

              The session's primary thread can consult `model` mid-turn.

              - `Type Enabled`

              - `Model string`

                The advisor model id.

            - `type BetaManagedAgentsMultiagentAdvisorDisabled`

              The agent has no advisor.

              - `Type Disabled`

          - `Subagents BetaManagedAgentsSessionMultiagentSubagentsUnion`

            Whether the agent can spawn session threads.

            - `type BetaManagedAgentsSessionMultiagentSubagentsEnabled`

              The agent can spawn session threads.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether the agent can define inline agents, which are not saved, when it spawns session threads.

                - `type BetaManagedAgentsMultiagentInlineAgentsEnabled`

                  The agent can define inline agents.

                  - `Type Enabled`

                - `type BetaManagedAgentsMultiagentInlineAgentsDisabled`

                  The agent cannot define inline agents.

                  - `Type Disabled`

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentSubagentsDisabled`

              The agent cannot spawn session threads.

              - `Type Disabled`

          - `Workflows BetaManagedAgentsSessionMultiagentWorkflowsUnion`

            Whether the agent can start workflow runs.

            - `type BetaManagedAgentsSessionMultiagentWorkflowsEnabled`

              The agent can start workflow runs.

              - `Type Enabled`

              - `InlineAgents BetaManagedAgentsMultiagentInlineAgentsUnion`

                Whether a run's plan can define inline agents, which are not saved.

              - `PredefinedAgents []BetaManagedAgentsSessionThreadAgent`

                Full `agent` definitions of the predefined agents, which are saved agents that a run's plan can use.

                - `Type BetaManagedAgentsSessionThreadAgentType`

                - `ID string`

                - `Description string`

                - `ExecutionIdentity BetaManagedAgentsExecutionIdentityUnion`

                  Execution principal snapshotted from the agent at session creation. Always present; `{"type": "service_account"}` when runs carry no customer-named principal.

                - `MCPServers []BetaManagedAgentsMCPServerURLDefinition`

                - `Model BetaManagedAgentsModelConfig`

                  Model identifier and configuration.

                - `Name string`

                - `Skills []BetaManagedAgentsSessionThreadAgentSkillUnion`

                - `System string`

                - `Tools []BetaManagedAgentsSessionThreadAgentToolUnion`

                - `Version int64`

                  format: int32

            - `type BetaManagedAgentsMultiagentWorkflowsDisabled`

              The agent cannot start workflow runs.

              - `Type Disabled`

      - `Name string`

      - `Skills []BetaManagedAgentsSessionAgentSkillUnion`

        - `type BetaManagedAgentsAnthropicSkill`

          A resolved Anthropic-managed skill.

        - `type BetaManagedAgentsCustomSkill`

          A resolved user-created custom skill.

      - `System string`

      - `Tools []BetaManagedAgentsSessionAgentToolUnion`

        - `type BetaManagedAgentsAgentToolset20260401`

        - `type BetaManagedAgentsMCPToolset`

        - `type BetaManagedAgentsCustomTool`

          A custom tool as returned in API responses.

      - `Version int64`

        format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's budget after the update: the new budget when set or replaced, or null when the update removed it. Present only when the update changed the budget.

      - `Type BetaManagedAgentsBudgetLimitType`

      - `MaxListCost BetaMonetaryAmount`

        Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

        - `Amount string`

          Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

        - `Currency BetaCurrency`

          Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

    - `Metadata map[string, string] Optional`

      The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.

    - `Title string Optional`

      The session's new title. Present only when the update changed it.

  - `type BetaManagedAgentsStartEvent`

    Opens a preview of a buffered event. Carries the previewed event's type and id only. Followed by zero or more event_delta events with the same event id, normally concluded by the buffered event carrying that id. If the producing model request ends without that event (an error or interrupt mid-stream), its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

    - `Type BetaManagedAgentsStartEventType`

    - `Event BetaManagedAgentsStartEventPreviewUnion`

      The previewed event's type and id. The event type determines which delta types the preview's event_delta events carry: agent.message events stream content_delta fragments; agent.thinking previews are start-only — no deltas follow, and the buffered agent.thinking with the same id concludes them.

      - `type BetaManagedAgentsAgentMessagePreview`

        - `Type BetaManagedAgentsAgentMessagePreviewType`

        - `ID string`

          The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

      - `type BetaManagedAgentsAgentThinkingPreview`

        - `Type BetaManagedAgentsAgentThinkingPreviewType`

        - `ID string`

          The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

  - `type BetaManagedAgentsDeltaEvent`

    An incremental update to an event that is still being streamed. Deltas are best-effort and may stop early; when the buffered event with id == event_id is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no buffered event — its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

    - `Type BetaManagedAgentsDeltaEventType`

    - `Delta BetaManagedAgentsDeltaContent`

      One fragment of the previewed event. The delta type is named for the previewed event's field it streams into: agent.message events stream content_delta fragments, each a partial element of the content array.

      - `Type BetaManagedAgentsDeltaContentType`

      - `Content BetaManagedAgentsTextBlock`

        A partial element of the content array at index, typed like the element itself — the same shape the buffered agent.message carries in content.

      - `Index int64 Optional`

        Which entry in the previewed event's content array this fragment lands in. Insert content as that entry when the index is new; append to the existing entry otherwise.

    - `EventID string`

      The id of the event being previewed. Matches event.id on the corresponding event_start and the buffered event that reconciles the preview.

  - `type BetaManagedAgentsSystemMessageEvent`

    A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.

    - `Type BetaManagedAgentsSystemMessageEventType`

    - `ID string`

      Unique identifier for this event.

    - `Content []BetaManagedAgentsSystemContentBlock`

      System content blocks. Text-only.

      - `Type BetaManagedAgentsSystemContentBlockType`

      - `Text string`

        The text content.

        minLength: 1

    - `ProcessedAt Time Optional`

      Timestamp when this system message was processed.

      format: date-time

  - `type BetaManagedAgentsSessionUsageEvent`

    Periodic snapshot of the session's cumulative usage and tracked list cost.

    - `Type BetaManagedAgentsSessionUsageEventType`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when the snapshot was taken.

      format: date-time

    - `Usage BetaManagedAgentsSessionUsageSnapshot`

      The session's cumulative usage at the snapshot time.

      - `ActiveSeconds float64 Optional`

        Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once. This is the duration the session's runtime cost is priced on.

        format: double

      - `CacheCreation BetaManagedAgentsCacheCreationUsage Optional`

        Tokens used to create prompt cache entries, broken down by cache TTL.

        - `Ephemeral1hInputTokens int64 Optional`

          Tokens used to create 1-hour ephemeral cache entries.

          format: int32

        - `Ephemeral5mInputTokens int64 Optional`

          Tokens used to create 5-minute ephemeral cache entries.

          format: int32

      - `CacheReadInputTokens int64 Optional`

        Total tokens read from prompt cache.

        format: int32

      - `InputTokens int64 Optional`

        Total input tokens consumed across all turns.

        format: int32

      - `ListCost BetaMonetaryAmount Optional`

        Cumulative list cost of the session across all turns, priced at public list rates.

      - `OutputTokens int64 Optional`

        Total output tokens generated across all turns.

        format: int32

      - `ServerToolUse BetaManagedAgentsServerToolUsage Optional`

        Cumulative server-executed tool usage across all turns.

        - `WebFetchRequests int64 Optional`

          Number of server-executed web fetch requests.

          format: int32

        - `WebSearchRequests int64 Optional`

          Number of server-executed web search requests.

          format: int32

    - `Budget BetaManagedAgentsBudgetLimit Optional`

      The session's configured budget at the snapshot time, or null when the session has no budget.

  - `type BetaManagedAgentsWorkflowRunCreatedEvent`

    A workflow run was created. A workflow run is background work that the session's agent starts. Emitted once per run, before the run's other `workflow_run.*` events.

    - `Type WorkflowRunCreated`

    - `ID string`

      Unique identifier for this event.

    - `Description string`

      Description that the agent gave the run, passed on as written, or `null` if it gave none.

    - `Name string`

      Name that the agent gave the run, passed on as written, or a name that the server assigned.

    - `Phases []BetaManagedAgentsWorkflowRunPhase`

      The phases that the run's plan declares, in the plan's order. Can be empty.

      - `ID string`

        Unique identifier for the phase.

      - `Description string`

        Description that the agent gave the phase, passed on as written, or `null` if it gave none.

      - `Name string`

        Name that the agent gave the phase, passed on as written.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusEndedEvent`

    A workflow run ended. Emitted once per run, as the last of the run's `workflow_run.*` events.

    - `Type WorkflowRunStatusEnded`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `Result BetaManagedAgentsWorkflowRunResultUnion`

      How the run ended.

      - `type BetaManagedAgentsWorkflowRunResultCompleted`

        The run's plan, a program that the agent wrote, finished. This does not say whether the work succeeded.

        - `Type Completed`

      - `type BetaManagedAgentsWorkflowRunResultError`

        The run failed or reached its time limit.

        - `Type Error`

        - `Error BetaManagedAgentsWorkflowRunErrorUnion`

          Why the run did not finish.

          - `type BetaManagedAgentsTimeoutWorkflowRunError`

            The run reached its time limit.

            - `Type TimeoutError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsProgramWorkflowRunError`

            The plan, a program that the agent wrote, failed, or the server refused it.

            - `Type ProgramError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsUnknownWorkflowRunError`

            A failure that has no type of its own.

            - `Type UnknownError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsThreadLimitWorkflowRunError`

            The run exceeded the limit on the number of threads that a run can create.

            - `Type ThreadLimitError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

          - `type BetaManagedAgentsMaxWorkflowRunsWorkflowRunError`

            No run was created, because the session was at its limit of open workflow runs, which are runs that have not ended. Only `workflow_run.error` carries this type.

            - `Type MaxWorkflowRunsError`

            - `Message string`

              Short explanation written by the server. It never contains content from the run or its agents.

      - `type BetaManagedAgentsWorkflowRunResultStopped`

        The agent stopped the run.

        - `Type Stopped`

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunPhaseStartedEvent`

    A workflow run's plan entered a phase.

    - `Type WorkflowRunPhaseStarted`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunPhaseEndedEvent`

    A workflow run's plan left a phase, or the run's end closed it. Emitted once for every `workflow_run.phase_started` event, before the run's `workflow_run.status_ended` event. The event does not say whether the plan finished the phase's work, or why it left.

    - `Type WorkflowRunPhaseEnded`

    - `ID string`

      Unique identifier for this event.

    - `PhaseStartedID string`

      Identifier of the `workflow_run.phase_started` event that opened the phase.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

    - `WorkflowRunPhaseID string`

      Identifier of the phase, as in `phases` on the run's `workflow_run.created` event.

  - `type BetaManagedAgentsWorkflowRunStatusRunningEvent`

    A workflow run is running. Emitted when the run starts to execute, and each time it resumes after being idle. A run that starts idle emits `workflow_run.status_idle` first.

    - `Type WorkflowRunStatusRunning`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunStatusIdleEvent`

    A workflow run is idle. Emitted each time the run goes idle, whatever the cause. If the run ends while idle, no `workflow_run.status_running` comes between this event and its `workflow_run.status_ended`.

    - `Type WorkflowRunStatusIdle`

    - `ID string`

      Unique identifier for this event.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run. The same value is on all of the run's `workflow_run.*` events.

  - `type BetaManagedAgentsWorkflowRunErrorEvent`

    A workflow run met an error, or an error kept a run from being created. A run that ends with a `result.type` of `error` emits this event before its `workflow_run.status_ended`, with the same `error`.

    - `Type WorkflowRunError`

    - `ID string`

      Unique identifier for this event.

    - `Error BetaManagedAgentsWorkflowRunErrorUnion`

      Why the run did not finish, or was not created.

    - `ProcessedAt Time`

      Timestamp when this event was processed.

      format: date-time

    - `WorkflowRunID string`

      Identifier of the run that met the error, or `null` when the error kept a run from being created.

#### 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"),
	)
	stream := client.Beta.Sessions.Threads.Events.StreamEvents(
		context.TODO(),
		"sthr_011CZkZVWa6oJjw1rgXZpnBt",
		anthropic.BetaSessionThreadEventStreamParams{
			SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
		},
	)
	for stream.Next() {
		fmt.Printf("%+v\n", stream.Current())
	}
	err := stream.Err()
	if err != nil {
		panic(err.Error())
	}
}
```

##### Response (200)

```json
{
  "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
  "content": [
    {
      "text": "Where is my order #1234?",
      "type": "text"
    }
  ],
  "type": "user.message",
  "processed_at": "2026-03-15T10:00:00Z"
}
```

## Beta › Deployments

### Create Deployment

`client.Beta.Deployments.New(ctx, params) (*BetaManagedAgentsDeployment, error)`

**POST** `/v1/deployments`

Create Deployment

#### Parameters

- `params BetaDeploymentNewParams`

  - `Agent BetaDeploymentNewParamsAgentUnion`

    Agent to deploy. Accepts the `agent` ID string, which pins the latest version, or an `agent` object with both id and version specified. The agent must exist and not be archived.

    - `string`

    - `type BetaManagedAgentsAgentParams`

      Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version

      - `Type BetaManagedAgentsAgentParamsType`

      - `ID string`

        The `agent` ID.

        minLength: 1, maxLength: 128

      - `Version int64 Optional`

        The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.

        format: int32

  - `EnvironmentID string`

    ID of the `environment` defining the container configuration for sessions created from this deployment.

    minLength: 1, maxLength: 128

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventParamsUnion`

    Events to send to each session immediately after creation. At least 1, maximum 50.

    - `type BetaManagedAgentsUserMessageEventParams`

      Parameters for sending a user message to the session.

      - `Type BetaManagedAgentsUserMessageEventParamsType`

      - `Content []BetaManagedAgentsUserMessageEventParamsContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsUserDefineOutcomeEventParams`

      Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsUserDefineOutcomeEventParamsType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubricParams`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricParamsType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubricParams`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricParamsType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

            maxLength: 262144

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsSystemMessageEventParams`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the `user.message`, `user.tool_result`, or `user.custom_tool_result` it accompanies. Only supported on models that accept mid-conversation system messages.

      - `Type BetaManagedAgentsSystemMessageEventParamsType`

      - `Content []BetaManagedAgentsSystemContentBlockParam`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Name string`

    Human-readable name for the deployment.

    minLength: 1, maxLength: 256

  - `Budget BetaManagedAgentsBudgetLimitParam Optional`

    Enforced spend ceiling stamped onto each session created from this deployment, copied at session-creation time. Omit to leave sessions uncapped. The deployment agent's model must have a public list price, or the request is rejected; a multiagent roster is re-validated in full when each fire copies the cap, which fails closed the same way.

  - `Description param.Opt[string] Optional`

    Description of what the deployment does.

    maxLength: 2048

  - `Metadata map[string, string] Optional`

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `Resources []BetaDeploymentNewParamsResourceUnion Optional`

    Resources (e.g. repositories, files) to mount into each session's container. Maximum 500.

    - `type BetaManagedAgentsGitHubRepositoryResourceParams`

      Mount a GitHub repository into the session's container.

      - `Type BetaManagedAgentsGitHubRepositoryResourceParamsType`

      - `URL string`

        Github URL of the repository

        minLength: 1, maxLength: 2048

      - `AuthorizationToken string Optional`

        GitHub authorization token used to clone the repository. Required for private repositories; optional for public ones.

        minLength: 1, maxLength: 4096

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

        minLength: 1, maxLength: 4096

    - `type BetaManagedAgentsFileResourceParams`

      Mount a file uploaded via the Files API into the session.

      - `Type BetaManagedAgentsFileResourceParamsType`

      - `FileID string`

        ID of a previously uploaded file.

        minLength: 1, maxLength: 128

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

        minLength: 1, maxLength: 4096

    - `type BetaManagedAgentsMemoryStoreResourceParam`

      Parameters for attaching a memory store to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceParamType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceParamAccess Optional`

        Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceParamAccessReadWrite BetaManagedAgentsMemoryStoreResourceParamAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceParamAccessReadOnly BetaManagedAgentsMemoryStoreResourceParamAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

  - `Schedule BetaManagedAgentsScheduleParams Optional`

    Optional recurring cron schedule. When present, the deployment fires automatically. Both expression and timezone are required when schedule is set.

  - `VaultIDs []string Optional`

    Vault IDs for stored credentials the agent can use during sessions created from this deployment. Maximum 50.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	betaManagedAgentsDeployment, err := client.Beta.Deployments.New(context.TODO(), anthropic.BetaDeploymentNewParams{
		Agent: anthropic.BetaDeploymentNewParamsAgentUnion{
			OfString: anthropic.String("string"),
		},
		EnvironmentID: "x",
		InitialEvents: []anthropic.BetaManagedAgentsDeploymentInitialEventParamsUnion{anthropic.BetaManagedAgentsDeploymentInitialEventParamsUnion{
			OfUserMessage: &anthropic.BetaManagedAgentsUserMessageEventParams{
				Content: []anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{anthropic.BetaManagedAgentsUserMessageEventParamsContentUnion{
					OfText: &anthropic.BetaManagedAgentsTextBlockParam{
						Text: "Where is my order #1234?",
						Type: anthropic.BetaManagedAgentsTextBlockTypeText,
					},
				}},
				Type: anthropic.BetaManagedAgentsUserMessageEventParamsTypeUserMessage,
			},
		}},
		Name: "x",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeployment.ID)
}
```

##### Response (200)

```json
{
  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Compiles yesterday's orders into a report every weekday morning.",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "initial_events": [
    {
      "content": [
        {
          "text": "Compile yesterday's orders into report.md.",
          "type": "text"
        }
      ],
      "type": "user.message"
    }
  ],
  "metadata": {},
  "name": "Daily order report",
  "paused_reason": {
    "type": "manual"
  },
  "resources": [
    {
      "type": "github_repository",
      "url": "url",
      "checkout": {
        "name": "main",
        "type": "branch"
      },
      "mount_path": "mount_path"
    }
  ],
  "schedule": {
    "expression": "0 9 * * 1-5",
    "timezone": "America/Los_Angeles",
    "type": "cron",
    "last_run_at": "2026-03-16T16:00:09Z",
    "upcoming_runs_at": [
      "2026-03-17T16:00:00Z",
      "2026-03-18T16:00:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  }
}
```

### List Deployments

`client.Beta.Deployments.List(ctx, params) (*PageCursor[BetaManagedAgentsDeployment], error)`

**GET** `/v1/deployments`

List Deployments

#### Parameters

- `params BetaDeploymentListParams`

  - `AgentID param.Opt[string] Optional` (query parameter)

    Filter by agent ID.

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return deployments created at or after this time (inclusive).

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return deployments created at or before this time (inclusive).

    format: date-time

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    When true, includes archived deployments. Default: false (exclude archived).

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum results per page. Default 20, maximum 100.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor.

  - `Status BetaManagedAgentsDeploymentStatus Optional` (query parameter)

    Filter by status: `active` or `paused`. Omit for both. To include archived deployments, use `include_archived` instead; the two cannot be combined.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	page, err := client.Beta.Deployments.List(context.TODO(), anthropic.BetaDeploymentListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
      "agent": {
        "id": "agent_011CZkYpogX7uDKUyvBTophP",
        "type": "agent",
        "version": 1
      },
      "archived_at": null,
      "created_at": "2026-03-15T10:00:00Z",
      "description": "Compiles yesterday's orders into a report every weekday morning.",
      "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
      "initial_events": [
        {
          "content": [
            {
              "text": "Compile yesterday's orders into report.md.",
              "type": "text"
            }
          ],
          "type": "user.message"
        }
      ],
      "metadata": {},
      "name": "Daily order report",
      "paused_reason": {
        "type": "manual"
      },
      "resources": [
        {
          "type": "github_repository",
          "url": "url",
          "checkout": {
            "name": "main",
            "type": "branch"
          },
          "mount_path": "mount_path"
        }
      ],
      "schedule": {
        "expression": "0 9 * * 1-5",
        "timezone": "America/Los_Angeles",
        "type": "cron",
        "last_run_at": "2026-03-16T16:00:09Z",
        "upcoming_runs_at": [
          "2026-03-17T16:00:00Z",
          "2026-03-18T16:00:00Z"
        ]
      },
      "status": "active",
      "type": "deployment",
      "updated_at": "2026-03-15T10:00:00Z",
      "vault_ids": [
        "vlt_011CZkZDLs7fYzm1hXNPeRjv"
      ],
      "budget": {
        "max_list_cost": {
          "amount": "2500",
          "currency": "USD"
        },
        "type": "limit"
      }
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get Deployment

`client.Beta.Deployments.Get(ctx, deploymentID, query) (*BetaManagedAgentsDeployment, error)`

**GET** `/v1/deployments/{deployment_id}`

Get Deployment

#### Parameters

- `deploymentID string` (path parameter)

  Unique identifier of the deployment.

- `query BetaDeploymentGetParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	betaManagedAgentsDeployment, err := client.Beta.Deployments.Get(
		context.TODO(),
		"depl_011CZkZcDH3vPqd7xnEfwTai",
		anthropic.BetaDeploymentGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeployment.ID)
}
```

##### Response (200)

```json
{
  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Compiles yesterday's orders into a report every weekday morning.",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "initial_events": [
    {
      "content": [
        {
          "text": "Compile yesterday's orders into report.md.",
          "type": "text"
        }
      ],
      "type": "user.message"
    }
  ],
  "metadata": {},
  "name": "Daily order report",
  "paused_reason": {
    "type": "manual"
  },
  "resources": [
    {
      "type": "github_repository",
      "url": "url",
      "checkout": {
        "name": "main",
        "type": "branch"
      },
      "mount_path": "mount_path"
    }
  ],
  "schedule": {
    "expression": "0 9 * * 1-5",
    "timezone": "America/Los_Angeles",
    "type": "cron",
    "last_run_at": "2026-03-16T16:00:09Z",
    "upcoming_runs_at": [
      "2026-03-17T16:00:00Z",
      "2026-03-18T16:00:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  }
}
```

### Update Deployment

`client.Beta.Deployments.Update(ctx, deploymentID, params) (*BetaManagedAgentsDeployment, error)`

**POST** `/v1/deployments/{deployment_id}`

Update Deployment

#### Parameters

- `deploymentID string` (path parameter)

  Unique identifier of the deployment to update.

- `params BetaDeploymentUpdateParams`

  - `Agent BetaDeploymentUpdateParamsAgentUnion Optional`

    Agent to deploy. Accepts the `agent` ID string, which re-pins to the latest version, or an `agent` object with both id and version specified. Omit to preserve. Cannot be cleared.

    - `string`

    - `type BetaManagedAgentsAgentParams`

      Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version

      - `Type BetaManagedAgentsAgentParamsType`

      - `ID string`

        The `agent` ID.

        minLength: 1, maxLength: 128

      - `Version int64 Optional`

        The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.

        format: int32

  - `Budget BetaManagedAgentsBudgetLimitParam Optional`

    Spend ceiling for future sessions. Full replacement. Omit to preserve; send null to clear (sessions created afterwards are uncapped). The deployment agent's model must have a public list price, or the request is rejected; a multiagent roster is re-validated in full when each fire copies the cap, which fails closed the same way.

  - `Description param.Opt[string] Optional`

    Description. Omit to preserve; send empty string or null to clear.

    maxLength: 2048

  - `EnvironmentID param.Opt[string] Optional`

    ID of the `environment` where sessions run. Omit to preserve. Cannot be cleared.

    maxLength: 128

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventParamsUnion Optional`

    Initial events. Full replacement. Omit to preserve. Cannot be cleared. At least 1, maximum 50.

    - `type BetaManagedAgentsUserMessageEventParams`

      Parameters for sending a user message to the session.

      - `Type BetaManagedAgentsUserMessageEventParamsType`

      - `Content []BetaManagedAgentsUserMessageEventParamsContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsUserDefineOutcomeEventParams`

      Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsUserDefineOutcomeEventParamsType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubricParams`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricParamsType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubricParams`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricParamsType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

            maxLength: 262144

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsSystemMessageEventParams`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the `user.message`, `user.tool_result`, or `user.custom_tool_result` it accompanies. Only supported on models that accept mid-conversation system messages.

      - `Type BetaManagedAgentsSystemMessageEventParamsType`

      - `Content []BetaManagedAgentsSystemContentBlockParam`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string] Optional`

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.

  - `Name param.Opt[string] Optional`

    Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.

    maxLength: 256

  - `Resources []BetaDeploymentUpdateParamsResourceUnion Optional`

    Session resources. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 500.

    - `type BetaManagedAgentsGitHubRepositoryResourceParams`

      Mount a GitHub repository into the session's container.

      - `Type BetaManagedAgentsGitHubRepositoryResourceParamsType`

      - `URL string`

        Github URL of the repository

        minLength: 1, maxLength: 2048

      - `AuthorizationToken string Optional`

        GitHub authorization token used to clone the repository. Required for private repositories; optional for public ones.

        minLength: 1, maxLength: 4096

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

        minLength: 1, maxLength: 4096

    - `type BetaManagedAgentsFileResourceParams`

      Mount a file uploaded via the Files API into the session.

      - `Type BetaManagedAgentsFileResourceParamsType`

      - `FileID string`

        ID of a previously uploaded file.

        minLength: 1, maxLength: 128

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

        minLength: 1, maxLength: 4096

    - `type BetaManagedAgentsMemoryStoreResourceParam`

      Parameters for attaching a memory store to an agent session.

      - `Type BetaManagedAgentsMemoryStoreResourceParamType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceParamAccess Optional`

        Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceParamAccessReadWrite BetaManagedAgentsMemoryStoreResourceParamAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceParamAccessReadOnly BetaManagedAgentsMemoryStoreResourceParamAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

        maxLength: 4096

  - `Schedule BetaManagedAgentsScheduleParams Optional`

    Cron schedule. Full replacement. Omit to preserve; send null to clear (revert to manual-only).

  - `VaultIDs []string Optional`

    Vault IDs. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 50.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	betaManagedAgentsDeployment, err := client.Beta.Deployments.Update(
		context.TODO(),
		"depl_011CZkZcDH3vPqd7xnEfwTai",
		anthropic.BetaDeploymentUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeployment.ID)
}
```

##### Response (200)

```json
{
  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Compiles yesterday's orders into a report every weekday morning.",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "initial_events": [
    {
      "content": [
        {
          "text": "Compile yesterday's orders into report.md.",
          "type": "text"
        }
      ],
      "type": "user.message"
    }
  ],
  "metadata": {},
  "name": "Daily order report",
  "paused_reason": {
    "type": "manual"
  },
  "resources": [
    {
      "type": "github_repository",
      "url": "url",
      "checkout": {
        "name": "main",
        "type": "branch"
      },
      "mount_path": "mount_path"
    }
  ],
  "schedule": {
    "expression": "0 9 * * 1-5",
    "timezone": "America/Los_Angeles",
    "type": "cron",
    "last_run_at": "2026-03-16T16:00:09Z",
    "upcoming_runs_at": [
      "2026-03-17T16:00:00Z",
      "2026-03-18T16:00:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  }
}
```

### Archive Deployment

`client.Beta.Deployments.Archive(ctx, deploymentID, body) (*BetaManagedAgentsDeployment, error)`

**POST** `/v1/deployments/{deployment_id}/archive`

Archive Deployment

#### Parameters

- `deploymentID string` (path parameter)

  Unique identifier of the deployment to archive.

- `body BetaDeploymentArchiveParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	betaManagedAgentsDeployment, err := client.Beta.Deployments.Archive(
		context.TODO(),
		"depl_011CZkZcDH3vPqd7xnEfwTai",
		anthropic.BetaDeploymentArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeployment.ID)
}
```

##### Response (200)

```json
{
  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Compiles yesterday's orders into a report every weekday morning.",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "initial_events": [
    {
      "content": [
        {
          "text": "Compile yesterday's orders into report.md.",
          "type": "text"
        }
      ],
      "type": "user.message"
    }
  ],
  "metadata": {},
  "name": "Daily order report",
  "paused_reason": {
    "type": "manual"
  },
  "resources": [
    {
      "type": "github_repository",
      "url": "url",
      "checkout": {
        "name": "main",
        "type": "branch"
      },
      "mount_path": "mount_path"
    }
  ],
  "schedule": {
    "expression": "0 9 * * 1-5",
    "timezone": "America/Los_Angeles",
    "type": "cron",
    "last_run_at": "2026-03-16T16:00:09Z",
    "upcoming_runs_at": [
      "2026-03-17T16:00:00Z",
      "2026-03-18T16:00:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  }
}
```

### Run Deployment Now

`client.Beta.Deployments.Run(ctx, deploymentID, body) (*BetaManagedAgentsDeploymentRun, error)`

**POST** `/v1/deployments/{deployment_id}/run`

Run Deployment Now

#### Parameters

- `deploymentID string` (path parameter)

  Unique identifier of the deployment to run.

- `body BetaDeploymentRunParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeploymentRun`

  A persistent, append-only record of a single deployment execution. Records session creation success or failure — no session lifecycle tracking.

  - `Type BetaManagedAgentsDeploymentRunType`

  - `ID string`

    Unique identifier for this run (`drun_...`).

  - `Agent BetaManagedAgentsAgentReference`

    Snapshot of the agent at fire time. Always fully resolved — deployments pin agent + version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `CreatedAt Time`

    Time this run record was persisted.

    format: date-time

  - `DeploymentID string`

    ID of the deployment that produced this run.

  - `Error BetaManagedAgentsDeploymentRunErrorUnion`

    Populated on creation failure. Null on success. Exactly one of `session_id` or `error` is non-null.

    - `type BetaManagedAgentsEnvironmentArchivedRunError`

      The deployment's environment was archived.

      - `Type BetaManagedAgentsEnvironmentArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsAgentArchivedRunError`

      The deployment's agent was archived.

      - `Type BetaManagedAgentsAgentArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsEnvironmentNotFoundRunError`

      The deployment's environment no longer exists.

      - `Type BetaManagedAgentsEnvironmentNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsVaultNotFoundRunError`

      A vault referenced by the deployment no longer exists.

      - `Type BetaManagedAgentsVaultNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsVaultArchivedRunError`

      A vault referenced by the deployment is archived.

      - `Type BetaManagedAgentsVaultArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsFileNotFoundRunError`

      A file resource referenced by the deployment no longer exists.

      - `Type BetaManagedAgentsFileNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsMemoryStoreArchivedRunError`

      A memory store referenced by the deployment is archived.

      - `Type BetaManagedAgentsMemoryStoreArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSkillNotFoundRunError`

      A skill referenced by the deployment's agent no longer exists.

      - `Type BetaManagedAgentsSkillNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionResourceNotFoundRunError`

      A referenced resource no longer exists and its kind was not reported.

      - `Type BetaManagedAgentsSessionResourceNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsWorkspaceArchivedRunError`

      The deployment's workspace was archived.

      - `Type BetaManagedAgentsWorkspaceArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsOrganizationDisabledRunError`

      The deployment's organization is disabled.

      - `Type BetaManagedAgentsOrganizationDisabledRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionRateLimitedRunError`

      Session creation was rejected due to rate limiting. The schedule keeps firing; subsequent runs may succeed.

      - `Type BetaManagedAgentsSessionRateLimitedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionCreationRejectedRunError`

      The session create request was rejected with a non-retryable validation error.

      - `Type BetaManagedAgentsSessionCreationRejectedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsUnknownRunError`

      An unknown or unexpected error caused the run to fail. A fallback variant; clients that do not recognize a new error type can match on message alone.

      - `Type BetaManagedAgentsUnknownRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSelfHostedResourcesUnsupportedRunError`

      The deployment configures resources, but its environment is self-hosted and cannot mount them.

      - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsMCPEgressBlockedRunError`

      An MCP server host used by the deployment's agent is blocked by the environment's network policy.

      - `Type BetaManagedAgentsMCPEgressBlockedRunErrorType`

      - `Message string`

        Human-readable error description.

  - `SessionID string`

    Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null.

  - `TriggerContext BetaManagedAgentsTriggerContextUnion`

    What triggered this run and trigger-specific metadata.

    - `type BetaManagedAgentsScheduleTriggerContext`

      The run was fired by the deployment's cron schedule.

      - `Type BetaManagedAgentsScheduleTriggerContextType`

      - `ScheduledAt Time`

        The UTC instant at which the cron expression matched in the configured timezone, before jitter is applied. At most one run is recorded per (`deployment_id`, `scheduled_at`) pair.

        format: date-time

    - `type BetaManagedAgentsManualTriggerContext`

      The run was started manually by creating a session directly against the deployment.

      - `Type BetaManagedAgentsManualTriggerContextType`

#### 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"),
	)
	betaManagedAgentsDeploymentRun, err := client.Beta.Deployments.Run(
		context.TODO(),
		"depl_011CZkZcDH3vPqd7xnEfwTai",
		anthropic.BetaDeploymentRunParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeploymentRun.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "agent": {
    "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
    "type": "agent",
    "version": 1
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "deployment_id": "deployment_id",
  "error": {
    "message": "message",
    "type": "environment_archived_error"
  },
  "session_id": "session_id",
  "trigger_context": {
    "scheduled_at": "2019-12-27T18:11:19.117Z",
    "type": "schedule"
  },
  "type": "deployment_run"
}
```

### Pause Deployment

`client.Beta.Deployments.Pause(ctx, deploymentID, body) (*BetaManagedAgentsDeployment, error)`

**POST** `/v1/deployments/{deployment_id}/pause`

Pause Deployment

#### Parameters

- `deploymentID string` (path parameter)

  Unique identifier of the deployment to pause.

- `body BetaDeploymentPauseParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	betaManagedAgentsDeployment, err := client.Beta.Deployments.Pause(
		context.TODO(),
		"depl_011CZkZcDH3vPqd7xnEfwTai",
		anthropic.BetaDeploymentPauseParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeployment.ID)
}
```

##### Response (200)

```json
{
  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Compiles yesterday's orders into a report every weekday morning.",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "initial_events": [
    {
      "content": [
        {
          "text": "Compile yesterday's orders into report.md.",
          "type": "text"
        }
      ],
      "type": "user.message"
    }
  ],
  "metadata": {},
  "name": "Daily order report",
  "paused_reason": {
    "type": "manual"
  },
  "resources": [
    {
      "type": "github_repository",
      "url": "url",
      "checkout": {
        "name": "main",
        "type": "branch"
      },
      "mount_path": "mount_path"
    }
  ],
  "schedule": {
    "expression": "0 9 * * 1-5",
    "timezone": "America/Los_Angeles",
    "type": "cron",
    "last_run_at": "2026-03-16T16:00:09Z",
    "upcoming_runs_at": [
      "2026-03-17T16:00:00Z",
      "2026-03-18T16:00:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  }
}
```

### Unpause Deployment

`client.Beta.Deployments.Unpause(ctx, deploymentID, body) (*BetaManagedAgentsDeployment, error)`

**POST** `/v1/deployments/{deployment_id}/unpause`

Unpause Deployment

#### Parameters

- `deploymentID string` (path parameter)

  Unique identifier of the deployment to unpause.

- `body BetaDeploymentUnpauseParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeployment`

  A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

  - `Type BetaManagedAgentsDeploymentType`

  - `ID string`

    Unique identifier for this deployment.

  - `Agent BetaManagedAgentsAgentReference`

    Reference to the agent this deployment runs, resolved to a concrete version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `ArchivedAt Time`

    Time the deployment was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    Time the deployment was created.

    format: date-time

  - `Description string`

    Description of what the deployment does.

  - `EnvironmentID string`

    ID of the `environment` where sessions run.

  - `InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion`

    Events sent to each session immediately after creation.

    - `type BetaManagedAgentsDeploymentUserMessageEvent`

      A user message sent to the session.

      - `Type BetaManagedAgentsDeploymentUserMessageEventType`

      - `Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion`

        Array of content blocks for the user message.

        - `type BetaManagedAgentsTextBlock`

          Regular text content.

          - `Type BetaManagedAgentsTextBlockType`

          - `Text string`

            The text content.

            minLength: 1

        - `type BetaManagedAgentsImageBlock`

          Image content specified directly as base64 data or as a reference via a URL.

          - `Type BetaManagedAgentsImageBlockType`

          - `Source BetaManagedAgentsImageBlockSourceUnion`

            The source of the image data.

            - `type BetaManagedAgentsBase64ImageSource`

              Base64-encoded image data.

              - `Type BetaManagedAgentsBase64ImageSourceType`

              - `Data string`

                Base64-encoded image data.

                minLength: 1

              - `MediaType string`

                MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

                minLength: 1

            - `type BetaManagedAgentsURLImageSource`

              Image referenced by URL.

              - `Type BetaManagedAgentsURLImageSourceType`

              - `URL string`

                URL of the image to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileImageSource`

              Image referenced by file ID.

              - `Type BetaManagedAgentsFileImageSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

        - `type BetaManagedAgentsDocumentBlock`

          Document content, either specified directly as base64 data, as text, or as a reference via a URL.

          - `Type BetaManagedAgentsDocumentBlockType`

          - `Source BetaManagedAgentsDocumentBlockSourceUnion`

            The source of the document data.

            - `type BetaManagedAgentsBase64DocumentSource`

              Base64-encoded document data.

              - `Type BetaManagedAgentsBase64DocumentSourceType`

              - `Data string`

                Base64-encoded document data.

                minLength: 1

              - `MediaType string`

                MIME type of the document (e.g., "application/pdf").

                minLength: 1

            - `type BetaManagedAgentsPlainTextDocumentSource`

              Plain text document content.

              - `Type BetaManagedAgentsPlainTextDocumentSourceType`

              - `Data string`

                The plain text content.

                minLength: 1

              - `MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType`

                MIME type of the text content. Must be "text/plain".

            - `type BetaManagedAgentsURLDocumentSource`

              Document referenced by URL.

              - `Type BetaManagedAgentsURLDocumentSourceType`

              - `URL string`

                URL of the document to fetch.

                minLength: 1

            - `type BetaManagedAgentsFileDocumentSource`

              Document referenced by file ID.

              - `Type BetaManagedAgentsFileDocumentSourceType`

              - `FileID string`

                ID of a previously uploaded file.

                minLength: 1

          - `Context string Optional`

            Additional context about the document for the model.

          - `Title string Optional`

            The title of the document.

        - `type BetaManagedAgentsRedactedBlock`

          Placeholder for content withheld by Anthropic model policy.

          - `Type BetaManagedAgentsRedactedBlockType`

    - `type BetaManagedAgentsDeploymentUserDefineOutcomeEvent`

      An outcome the agent should work toward. The agent begins work on receipt.

      - `Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType`

      - `Description string`

        What the agent should produce. This is the task specification.

      - `Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion`

        How to grade the outcome. Text or file reference.

        - `type BetaManagedAgentsFileRubric`

          Rubric referenced by a file uploaded via the Files API.

          - `Type BetaManagedAgentsFileRubricType`

          - `FileID string`

            ID of the rubric file.

        - `type BetaManagedAgentsTextRubric`

          Rubric content provided inline as text.

          - `Type BetaManagedAgentsTextRubricType`

          - `Content string`

            Rubric content. Plain text or markdown — the grader treats it as freeform text.

      - `MaxIterations int64 Optional`

        Eval→revision cycles before giving up. Default 3, max 20.

        format: int32

    - `type BetaManagedAgentsDeploymentSystemMessageEvent`

      Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

      - `Type BetaManagedAgentsDeploymentSystemMessageEventType`

      - `Content []BetaManagedAgentsSystemContentBlock`

        System content blocks to append. Text-only.

        - `Type BetaManagedAgentsSystemContentBlockType`

        - `Text string`

          The text content.

          minLength: 1

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs.

  - `Name string`

    Human-readable name.

  - `PausedReason BetaManagedAgentsDeploymentPausedReasonUnion`

    Why the deployment is `paused`. Non-null exactly when `status` is `paused`; null otherwise.

    - `type BetaManagedAgentsManualDeploymentPausedReason`

      The caller invoked the pause endpoint on the deployment.

      - `Type BetaManagedAgentsManualDeploymentPausedReasonType`

    - `type BetaManagedAgentsErrorDeploymentPausedReason`

      A scheduled fire recorded a failed run whose error auto-pauses the deployment.

      - `Type BetaManagedAgentsErrorDeploymentPausedReasonType`

      - `Error BetaManagedAgentsDeploymentPausedReasonErrorUnion`

        The failed run's error.

        - `type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError`

          The deployment's environment was archived.

          - `Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError`

          The deployment's agent was archived.

          - `Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError`

          The deployment's environment no longer exists.

          - `Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError`

          A vault referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError`

          A file resource referenced by the deployment no longer exists.

          - `Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError`

          A referenced resource no longer exists and its kind was not reported.

          - `Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError`

          The deployment's workspace was archived.

          - `Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError`

          The deployment's organization is disabled.

          - `Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError`

          A memory store referenced by the deployment is archived.

          - `Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError`

          A skill referenced by the deployment's agent no longer exists.

          - `Type BetaManagedAgentsSkillNotFoundDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError`

          A vault referenced by the deployment is archived.

          - `Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsUnknownDeploymentPausedReasonError`

          An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

          - `Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError`

          The deployment configures resources, but its environment is self-hosted and cannot mount them.

          - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType`

        - `type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError`

          An MCP server host used by the deployment's agent is blocked by the environment's network policy.

          - `Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType`

  - `Resources []BetaManagedAgentsSessionResourceConfigUnion`

    Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials.

    - `type BetaManagedAgentsGitHubRepositoryResourceConfig`

      A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

      - `Type BetaManagedAgentsGitHubRepositoryResourceConfigType`

      - `URL string`

        Github URL of the repository

      - `Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion Optional`

        Branch or commit to check out. Defaults to the repository's default branch.

        - `type BetaManagedAgentsBranchCheckout`

          - `Type BetaManagedAgentsBranchCheckoutType`

          - `Name string`

            Branch name to check out.

            minLength: 1, maxLength: 255

        - `type BetaManagedAgentsCommitCheckout`

          - `Type BetaManagedAgentsCommitCheckoutType`

          - `Sha string`

            Full commit SHA to check out.

            minLength: 7, maxLength: 64

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/workspace/<repo-name>`.

    - `type BetaManagedAgentsFileResourceConfig`

      A file mounted into each session's container.

      - `Type BetaManagedAgentsFileResourceConfigType`

      - `FileID string`

        ID of a previously uploaded file.

      - `MountPath string Optional`

        Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

    - `type BetaManagedAgentsMemoryStoreResourceConfig`

      A memory store attached to each session created from this deployment.

      - `Type BetaManagedAgentsMemoryStoreResourceConfigType`

      - `MemoryStoreID string`

        The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

      - `Access BetaManagedAgentsMemoryStoreResourceConfigAccess Optional`

        Access mode for the mounted store. Defaults to `read_write`. `read_only` mounts the store as a read-only filesystem.

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"`

        - `const BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"`

      - `Instructions string Optional`

        Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

  - `Schedule BetaManagedAgentsSchedule`

    Recurring cron schedule. Presence enables scheduled execution; null means manual-only. Includes computed timestamps (next fire times, last run) on the cron variant.

    - `Type BetaManagedAgentsScheduleType`

    - `Expression string`

      5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).

      minLength: 1, maxLength: 256

    - `Timezone string`

      IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").

      minLength: 1

    - `LastRunAt Time Optional`

      Time the most recent scheduled run actually started. Null until one completes; preserved after the deployment is archived. Manual runs do not update this.

      format: date-time

    - `UpcomingRunsAt []Time Optional`

      Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time.

  - `Status BetaManagedAgentsDeploymentStatus`

    Computed status of the deployment: `active` or `paused`. Archived deployments report `active` with `archived_at` set.

    - `const BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"`

      The deployment is active and can run sessions. Archived deployments also report this status; check `archived_at` to distinguish them.

    - `const BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"`

      The deployment is paused. Autonomous triggers are suppressed; manual runs are still permitted.

  - `UpdatedAt Time`

    Time the deployment was last updated.

    format: date-time

  - `VaultIDs []string`

    Vault IDs supplying stored credentials for sessions created from this deployment.

  - `Budget BetaManagedAgentsBudgetLimit Optional`

    Spend ceiling stamped onto each session created from this deployment. Absent when no budget is set.

    - `Type BetaManagedAgentsBudgetLimitType`

    - `MaxListCost BetaMonetaryAmount`

      Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

      - `Amount string`

        Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied.

      - `Currency BetaCurrency`

        Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced.

#### 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"),
	)
	betaManagedAgentsDeployment, err := client.Beta.Deployments.Unpause(
		context.TODO(),
		"depl_011CZkZcDH3vPqd7xnEfwTai",
		anthropic.BetaDeploymentUnpauseParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeployment.ID)
}
```

##### Response (200)

```json
{
  "id": "depl_011CZkZcDH3vPqd7xnEfwTai",
  "agent": {
    "id": "agent_011CZkYpogX7uDKUyvBTophP",
    "type": "agent",
    "version": 1
  },
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "description": "Compiles yesterday's orders into a report every weekday morning.",
  "environment_id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
  "initial_events": [
    {
      "content": [
        {
          "text": "Compile yesterday's orders into report.md.",
          "type": "text"
        }
      ],
      "type": "user.message"
    }
  ],
  "metadata": {},
  "name": "Daily order report",
  "paused_reason": {
    "type": "manual"
  },
  "resources": [
    {
      "type": "github_repository",
      "url": "url",
      "checkout": {
        "name": "main",
        "type": "branch"
      },
      "mount_path": "mount_path"
    }
  ],
  "schedule": {
    "expression": "0 9 * * 1-5",
    "timezone": "America/Los_Angeles",
    "type": "cron",
    "last_run_at": "2026-03-16T16:00:09Z",
    "upcoming_runs_at": [
      "2026-03-17T16:00:00Z",
      "2026-03-18T16:00:00Z"
    ]
  },
  "status": "active",
  "type": "deployment",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_ids": [
    "vlt_011CZkZDLs7fYzm1hXNPeRjv"
  ],
  "budget": {
    "max_list_cost": {
      "amount": "2500",
      "currency": "USD"
    },
    "type": "limit"
  }
}
```

## Beta › Deployment Runs

### List Deployment Runs

`client.Beta.DeploymentRuns.List(ctx, params) (*PageCursor[BetaManagedAgentsDeploymentRun], error)`

**GET** `/v1/deployment_runs`

List Deployment Runs

#### Parameters

- `params BetaDeploymentRunListParams`

  - `CreatedAtGt param.Opt[Time] Optional` (query parameter)

    Return runs created strictly after this time (exclusive).

    format: date-time

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return runs created at or after this time (inclusive).

    format: date-time

  - `CreatedAtLt param.Opt[Time] Optional` (query parameter)

    Return runs created strictly before this time (exclusive).

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return runs created at or before this time (inclusive).

    format: date-time

  - `DeploymentID param.Opt[string] Optional` (query parameter)

    Filter to a specific deployment. Omit to list across all deployments in the workspace. Filtering by a non-existent `deployment_id` returns 200 with empty data.

  - `HasError param.Opt[bool] Optional` (query parameter)

    Filter: true for runs with non-null `error`, false for runs with non-null `session_id`. Omit for all.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum results per page. Default 20, maximum 1000.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor. Pass `next_page` from the previous response. Invalid or expired cursors return 400.

  - `TriggerType BetaManagedAgentsTriggerType Optional` (query parameter)

    Filter runs by what triggered them. Omit to return all runs.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeploymentRun`

  A persistent, append-only record of a single deployment execution. Records session creation success or failure — no session lifecycle tracking.

  - `Type BetaManagedAgentsDeploymentRunType`

  - `ID string`

    Unique identifier for this run (`drun_...`).

  - `Agent BetaManagedAgentsAgentReference`

    Snapshot of the agent at fire time. Always fully resolved — deployments pin agent + version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `CreatedAt Time`

    Time this run record was persisted.

    format: date-time

  - `DeploymentID string`

    ID of the deployment that produced this run.

  - `Error BetaManagedAgentsDeploymentRunErrorUnion`

    Populated on creation failure. Null on success. Exactly one of `session_id` or `error` is non-null.

    - `type BetaManagedAgentsEnvironmentArchivedRunError`

      The deployment's environment was archived.

      - `Type BetaManagedAgentsEnvironmentArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsAgentArchivedRunError`

      The deployment's agent was archived.

      - `Type BetaManagedAgentsAgentArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsEnvironmentNotFoundRunError`

      The deployment's environment no longer exists.

      - `Type BetaManagedAgentsEnvironmentNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsVaultNotFoundRunError`

      A vault referenced by the deployment no longer exists.

      - `Type BetaManagedAgentsVaultNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsVaultArchivedRunError`

      A vault referenced by the deployment is archived.

      - `Type BetaManagedAgentsVaultArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsFileNotFoundRunError`

      A file resource referenced by the deployment no longer exists.

      - `Type BetaManagedAgentsFileNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsMemoryStoreArchivedRunError`

      A memory store referenced by the deployment is archived.

      - `Type BetaManagedAgentsMemoryStoreArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSkillNotFoundRunError`

      A skill referenced by the deployment's agent no longer exists.

      - `Type BetaManagedAgentsSkillNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionResourceNotFoundRunError`

      A referenced resource no longer exists and its kind was not reported.

      - `Type BetaManagedAgentsSessionResourceNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsWorkspaceArchivedRunError`

      The deployment's workspace was archived.

      - `Type BetaManagedAgentsWorkspaceArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsOrganizationDisabledRunError`

      The deployment's organization is disabled.

      - `Type BetaManagedAgentsOrganizationDisabledRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionRateLimitedRunError`

      Session creation was rejected due to rate limiting. The schedule keeps firing; subsequent runs may succeed.

      - `Type BetaManagedAgentsSessionRateLimitedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionCreationRejectedRunError`

      The session create request was rejected with a non-retryable validation error.

      - `Type BetaManagedAgentsSessionCreationRejectedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsUnknownRunError`

      An unknown or unexpected error caused the run to fail. A fallback variant; clients that do not recognize a new error type can match on message alone.

      - `Type BetaManagedAgentsUnknownRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSelfHostedResourcesUnsupportedRunError`

      The deployment configures resources, but its environment is self-hosted and cannot mount them.

      - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsMCPEgressBlockedRunError`

      An MCP server host used by the deployment's agent is blocked by the environment's network policy.

      - `Type BetaManagedAgentsMCPEgressBlockedRunErrorType`

      - `Message string`

        Human-readable error description.

  - `SessionID string`

    Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null.

  - `TriggerContext BetaManagedAgentsTriggerContextUnion`

    What triggered this run and trigger-specific metadata.

    - `type BetaManagedAgentsScheduleTriggerContext`

      The run was fired by the deployment's cron schedule.

      - `Type BetaManagedAgentsScheduleTriggerContextType`

      - `ScheduledAt Time`

        The UTC instant at which the cron expression matched in the configured timezone, before jitter is applied. At most one run is recorded per (`deployment_id`, `scheduled_at`) pair.

        format: date-time

    - `type BetaManagedAgentsManualTriggerContext`

      The run was started manually by creating a session directly against the deployment.

      - `Type BetaManagedAgentsManualTriggerContextType`

#### 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"),
	)
	page, err := client.Beta.DeploymentRuns.List(context.TODO(), anthropic.BetaDeploymentRunListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "agent": {
        "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
        "type": "agent",
        "version": 1
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "deployment_id": "deployment_id",
      "error": {
        "message": "message",
        "type": "environment_archived_error"
      },
      "session_id": "session_id",
      "trigger_context": {
        "scheduled_at": "2019-12-27T18:11:19.117Z",
        "type": "schedule"
      },
      "type": "deployment_run"
    }
  ],
  "next_page": "next_page"
}
```

### Get Deployment Run

`client.Beta.DeploymentRuns.Get(ctx, deploymentRunID, query) (*BetaManagedAgentsDeploymentRun, error)`

**GET** `/v1/deployment_runs/{deployment_run_id}`

Get Deployment Run

#### Parameters

- `deploymentRunID string` (path parameter)

  Unique identifier of the deployment run.

- `query BetaDeploymentRunGetParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeploymentRun`

  A persistent, append-only record of a single deployment execution. Records session creation success or failure — no session lifecycle tracking.

  - `Type BetaManagedAgentsDeploymentRunType`

  - `ID string`

    Unique identifier for this run (`drun_...`).

  - `Agent BetaManagedAgentsAgentReference`

    Snapshot of the agent at fire time. Always fully resolved — deployments pin agent + version.

    - `Type BetaManagedAgentsAgentReferenceType`

    - `ID string`

    - `Version int64`

      format: int32

  - `CreatedAt Time`

    Time this run record was persisted.

    format: date-time

  - `DeploymentID string`

    ID of the deployment that produced this run.

  - `Error BetaManagedAgentsDeploymentRunErrorUnion`

    Populated on creation failure. Null on success. Exactly one of `session_id` or `error` is non-null.

    - `type BetaManagedAgentsEnvironmentArchivedRunError`

      The deployment's environment was archived.

      - `Type BetaManagedAgentsEnvironmentArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsAgentArchivedRunError`

      The deployment's agent was archived.

      - `Type BetaManagedAgentsAgentArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsEnvironmentNotFoundRunError`

      The deployment's environment no longer exists.

      - `Type BetaManagedAgentsEnvironmentNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsVaultNotFoundRunError`

      A vault referenced by the deployment no longer exists.

      - `Type BetaManagedAgentsVaultNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsVaultArchivedRunError`

      A vault referenced by the deployment is archived.

      - `Type BetaManagedAgentsVaultArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsFileNotFoundRunError`

      A file resource referenced by the deployment no longer exists.

      - `Type BetaManagedAgentsFileNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsMemoryStoreArchivedRunError`

      A memory store referenced by the deployment is archived.

      - `Type BetaManagedAgentsMemoryStoreArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSkillNotFoundRunError`

      A skill referenced by the deployment's agent no longer exists.

      - `Type BetaManagedAgentsSkillNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionResourceNotFoundRunError`

      A referenced resource no longer exists and its kind was not reported.

      - `Type BetaManagedAgentsSessionResourceNotFoundRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsWorkspaceArchivedRunError`

      The deployment's workspace was archived.

      - `Type BetaManagedAgentsWorkspaceArchivedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsOrganizationDisabledRunError`

      The deployment's organization is disabled.

      - `Type BetaManagedAgentsOrganizationDisabledRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionRateLimitedRunError`

      Session creation was rejected due to rate limiting. The schedule keeps firing; subsequent runs may succeed.

      - `Type BetaManagedAgentsSessionRateLimitedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSessionCreationRejectedRunError`

      The session create request was rejected with a non-retryable validation error.

      - `Type BetaManagedAgentsSessionCreationRejectedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsUnknownRunError`

      An unknown or unexpected error caused the run to fail. A fallback variant; clients that do not recognize a new error type can match on message alone.

      - `Type BetaManagedAgentsUnknownRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsSelfHostedResourcesUnsupportedRunError`

      The deployment configures resources, but its environment is self-hosted and cannot mount them.

      - `Type BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType`

      - `Message string`

        Human-readable error description.

    - `type BetaManagedAgentsMCPEgressBlockedRunError`

      An MCP server host used by the deployment's agent is blocked by the environment's network policy.

      - `Type BetaManagedAgentsMCPEgressBlockedRunErrorType`

      - `Message string`

        Human-readable error description.

  - `SessionID string`

    Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null.

  - `TriggerContext BetaManagedAgentsTriggerContextUnion`

    What triggered this run and trigger-specific metadata.

    - `type BetaManagedAgentsScheduleTriggerContext`

      The run was fired by the deployment's cron schedule.

      - `Type BetaManagedAgentsScheduleTriggerContextType`

      - `ScheduledAt Time`

        The UTC instant at which the cron expression matched in the configured timezone, before jitter is applied. At most one run is recorded per (`deployment_id`, `scheduled_at`) pair.

        format: date-time

    - `type BetaManagedAgentsManualTriggerContext`

      The run was started manually by creating a session directly against the deployment.

      - `Type BetaManagedAgentsManualTriggerContextType`

#### 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"),
	)
	betaManagedAgentsDeploymentRun, err := client.Beta.DeploymentRuns.Get(
		context.TODO(),
		"deployment_run_id",
		anthropic.BetaDeploymentRunGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeploymentRun.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "agent": {
    "id": "agent_011CZkYqphY8vELVzwCUpqiQ",
    "type": "agent",
    "version": 1
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "deployment_id": "deployment_id",
  "error": {
    "message": "message",
    "type": "environment_archived_error"
  },
  "session_id": "session_id",
  "trigger_context": {
    "scheduled_at": "2019-12-27T18:11:19.117Z",
    "type": "schedule"
  },
  "type": "deployment_run"
}
```

## Beta › Vaults

### Create Vault

`client.Beta.Vaults.New(ctx, params) (*BetaManagedAgentsVault, error)`

**POST** `/v1/vaults`

Create Vault

#### Parameters

- `params BetaVaultNewParams`

  - `DisplayName string`

    Human-readable name for the vault. 1-255 characters.

    minLength: 1, maxLength: 255

  - `Metadata map[string, string] Optional`

    Arbitrary key-value metadata to attach to the vault. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsVault`

  A vault that stores credentials for use by agents during sessions.

  - `Type BetaManagedAgentsVaultType`

  - `ID string`

    Unique identifier for the vault.

  - `ArchivedAt Time`

    When the vault was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `DisplayName string`

    Human-readable name for the vault.

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the vault.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

#### 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"),
	)
	betaManagedAgentsVault, err := client.Beta.Vaults.New(context.TODO(), anthropic.BetaVaultNewParams{
		DisplayName: "Example vault",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsVault.ID)
}
```

##### Response (200)

```json
{
  "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "display_name": "Example vault",
  "metadata": {
    "environment": "production"
  },
  "type": "vault",
  "updated_at": "2026-03-15T10:00:00Z"
}
```

### List Vaults

`client.Beta.Vaults.List(ctx, params) (*PageCursor[BetaManagedAgentsVault], error)`

**GET** `/v1/vaults`

List Vaults

#### Parameters

- `params BetaVaultListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Whether to include archived vaults in the results.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of vaults to return per page. Defaults to 20, maximum 100.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination token from a previous `list_vaults` response.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsVault`

  A vault that stores credentials for use by agents during sessions.

  - `Type BetaManagedAgentsVaultType`

  - `ID string`

    Unique identifier for the vault.

  - `ArchivedAt Time`

    When the vault was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `DisplayName string`

    Human-readable name for the vault.

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the vault.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Vaults.List(context.TODO(), anthropic.BetaVaultListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
      "archived_at": null,
      "created_at": "2026-03-15T10:00:00Z",
      "display_name": "Example vault",
      "metadata": {
        "environment": "production"
      },
      "type": "vault",
      "updated_at": "2026-03-15T10:00:00Z"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get Vault

`client.Beta.Vaults.Get(ctx, vaultID, query) (*BetaManagedAgentsVault, error)`

**GET** `/v1/vaults/{vault_id}`

Get Vault

#### Parameters

- `vaultID string` (path parameter)

  Unique identifier of the vault to retrieve.

- `query BetaVaultGetParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsVault`

  A vault that stores credentials for use by agents during sessions.

  - `Type BetaManagedAgentsVaultType`

  - `ID string`

    Unique identifier for the vault.

  - `ArchivedAt Time`

    When the vault was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `DisplayName string`

    Human-readable name for the vault.

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the vault.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

#### 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"),
	)
	betaManagedAgentsVault, err := client.Beta.Vaults.Get(
		context.TODO(),
		"vlt_011CZkZDLs7fYzm1hXNPeRjv",
		anthropic.BetaVaultGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsVault.ID)
}
```

##### Response (200)

```json
{
  "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "display_name": "Example vault",
  "metadata": {
    "environment": "production"
  },
  "type": "vault",
  "updated_at": "2026-03-15T10:00:00Z"
}
```

### Update Vault

`client.Beta.Vaults.Update(ctx, vaultID, params) (*BetaManagedAgentsVault, error)`

**POST** `/v1/vaults/{vault_id}`

Update Vault

#### Parameters

- `vaultID string` (path parameter)

  Unique identifier of the vault to update.

- `params BetaVaultUpdateParams`

  - `DisplayName param.Opt[string] Optional`

    Updated human-readable name for the vault. 1-255 characters.

    minLength: 1, maxLength: 255

  - `Metadata map[string, string] Optional`

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsVault`

  A vault that stores credentials for use by agents during sessions.

  - `Type BetaManagedAgentsVaultType`

  - `ID string`

    Unique identifier for the vault.

  - `ArchivedAt Time`

    When the vault was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `DisplayName string`

    Human-readable name for the vault.

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the vault.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

#### 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"),
	)
	betaManagedAgentsVault, err := client.Beta.Vaults.Update(
		context.TODO(),
		"vlt_011CZkZDLs7fYzm1hXNPeRjv",
		anthropic.BetaVaultUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsVault.ID)
}
```

##### Response (200)

```json
{
  "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "display_name": "Example vault",
  "metadata": {
    "environment": "production"
  },
  "type": "vault",
  "updated_at": "2026-03-15T10:00:00Z"
}
```

### Delete Vault

`client.Beta.Vaults.Delete(ctx, vaultID, body) (*BetaManagedAgentsDeletedVault, error)`

**DELETE** `/v1/vaults/{vault_id}`

Delete Vault

#### Parameters

- `vaultID string` (path parameter)

  Unique identifier of the vault to delete.

- `body BetaVaultDeleteParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeletedVault`

  Confirmation of a deleted vault.

  - `Type BetaManagedAgentsDeletedVaultType`

  - `ID string`

    Unique identifier of the deleted vault.

#### 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"),
	)
	betaManagedAgentsDeletedVault, err := client.Beta.Vaults.Delete(
		context.TODO(),
		"vlt_011CZkZDLs7fYzm1hXNPeRjv",
		anthropic.BetaVaultDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeletedVault.ID)
}
```

##### Response (200)

```json
{
  "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "type": "vault_deleted"
}
```

### Archive Vault

`client.Beta.Vaults.Archive(ctx, vaultID, body) (*BetaManagedAgentsVault, error)`

**POST** `/v1/vaults/{vault_id}/archive`

Archive Vault

#### Parameters

- `vaultID string` (path parameter)

  Unique identifier of the vault to archive.

- `body BetaVaultArchiveParams`

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsVault`

  A vault that stores credentials for use by agents during sessions.

  - `Type BetaManagedAgentsVaultType`

  - `ID string`

    Unique identifier for the vault.

  - `ArchivedAt Time`

    When the vault was archived. Null if not archived.

    format: date-time

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `DisplayName string`

    Human-readable name for the vault.

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the vault.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

#### 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"),
	)
	betaManagedAgentsVault, err := client.Beta.Vaults.Archive(
		context.TODO(),
		"vlt_011CZkZDLs7fYzm1hXNPeRjv",
		anthropic.BetaVaultArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsVault.ID)
}
```

##### Response (200)

```json
{
  "id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "archived_at": null,
  "created_at": "2026-03-15T10:00:00Z",
  "display_name": "Example vault",
  "metadata": {
    "environment": "production"
  },
  "type": "vault",
  "updated_at": "2026-03-15T10:00:00Z"
}
```

## Beta › Vaults › Credentials

### Create Credential

`client.Beta.Vaults.Credentials.New(ctx, vaultID, params) (*BetaManagedAgentsCredential, error)`

**POST** `/v1/vaults/{vault_id}/credentials`

Create Credential

#### Parameters

- `vaultID string` (path parameter)

  Identifier of the vault to create the credential in.

- `params BetaVaultCredentialNewParams`

  - `Auth BetaVaultCredentialNewParamsAuthUnion`

    Authentication configuration for the credential.

    - `type BetaManagedAgentsMCPOAuthCreateParams`

      Parameters for creating an MCP OAuth credential.

      - `Type BetaManagedAgentsMCPOAuthCreateParamsType`

      - `AccessToken string`

        OAuth access token.

        minLength: 1, maxLength: 8192

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

        minLength: 1, maxLength: 2047

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshParams Optional`

        Refresh token configuration, if the credential supports token refresh.

        - `ClientID string`

          OAuth client ID.

          minLength: 1, maxLength: 1024

        - `RefreshToken string`

          OAuth refresh token.

          minLength: 1, maxLength: 8192

        - `TokenEndpoint string`

          Token endpoint URL used to refresh the access token.

          minLength: 1, maxLength: 2047

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion`

          - `type BetaManagedAgentsTokenEndpointAuthNoneParam`

            Token endpoint requires no client authentication.

            - `Type BetaManagedAgentsTokenEndpointAuthNoneParamType`

          - `type BetaManagedAgentsTokenEndpointAuthBasicParam`

            Token endpoint uses HTTP Basic authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicParamType`

            - `ClientSecret string`

              OAuth client secret.

              minLength: 1, maxLength: 512

          - `type BetaManagedAgentsTokenEndpointAuthPostParam`

            Token endpoint uses POST body authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthPostParamType`

            - `ClientSecret string`

              OAuth client secret.

              minLength: 1, maxLength: 512

        - `Resource string Optional`

          OAuth resource indicator.

          minLength: 1, maxLength: 2047

        - `Scope string Optional`

          OAuth scope for the refresh request.

          minLength: 1, maxLength: 8192

    - `type BetaManagedAgentsStaticBearerCreateParams`

      Parameters for creating a static bearer token credential.

      - `Type BetaManagedAgentsStaticBearerCreateParamsType`

      - `Token string`

        Static bearer token value.

        minLength: 1, maxLength: 8192

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

        minLength: 1, maxLength: 2047

    - `type BetaManagedAgentsEnvironmentVariableCreateParams`

      Parameters for creating an environment variable credential.

      - `Type BetaManagedAgentsEnvironmentVariableCreateParamsType`

      - `Networking BetaManagedAgentsCredentialNetworkingParamsUnion`

        Outbound hosts the secret value is substituted on.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingParams`

          Substitute the secret on any host the session's Environment network policy permits egress to. The Environment's network policy is the only boundary on where the secret can reach.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingParamsType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingParams`

          Substitute the secret only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingParamsType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. Each entry is a bare hostname (`api.example.com`), an IPv4 address (`192.0.2.1`), or a `*.`-prefixed wildcard (`*.example.com`). URLs, ports, paths, and IPv6 addresses are not accepted. At most 16 entries.

      - `SecretName string`

        Name of the environment variable. Immutable after create.

        minLength: 1, maxLength: 255

      - `SecretValue string`

        Secret value. Write-only; never returned in responses.

        minLength: 1, maxLength: 4096

      - `InjectionLocation BetaManagedAgentsInjectionLocationParams Optional`

        Where in the outbound request the secret value may be substituted.

        - `Body bool Optional`

          Substitute when the placeholder appears in the request body.

        - `Header bool Optional`

          Substitute when the placeholder appears in a request header value.

  - `DisplayName param.Opt[string] Optional`

    Human-readable name for the credential. Up to 255 characters.

    maxLength: 255

  - `Metadata map[string, string] Optional`

    Arbitrary key-value metadata to attach to the credential. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsCredential`

  A credential stored in a vault. Sensitive fields are never returned in responses.

  - `Type BetaManagedAgentsCredentialType`

  - `ID string`

    Unique identifier for the credential.

  - `ArchivedAt Time`

    When the credential was archived. Null if not archived.

    format: date-time

  - `Auth BetaManagedAgentsCredentialAuthUnion`

    Authentication configuration for this credential.

    - `type BetaManagedAgentsMCPOAuthAuthResponse`

      OAuth credential details for an MCP server.

      - `Type BetaManagedAgentsMCPOAuthAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshResponse Optional`

        Refresh token configuration, if the credential supports token refresh.

        - `ClientID string`

          OAuth client ID.

        - `TokenEndpoint string`

          Token endpoint URL used to refresh the access token.

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion`

          - `type BetaManagedAgentsTokenEndpointAuthNoneResponse`

            Token endpoint requires no client authentication.

            - `Type BetaManagedAgentsTokenEndpointAuthNoneResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthBasicResponse`

            Token endpoint uses HTTP Basic authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthPostResponse`

            Token endpoint uses POST body authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthPostResponseType`

        - `Resource string Optional`

          OAuth resource indicator.

        - `Scope string Optional`

          OAuth scope for the refresh request.

    - `type BetaManagedAgentsStaticBearerAuthResponse`

      Static bearer token credential details for an MCP server.

      - `Type BetaManagedAgentsStaticBearerAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

    - `type BetaManagedAgentsEnvironmentVariableAuthResponse`

      Environment variable credential details. The secret value is never returned.

      - `Type BetaManagedAgentsEnvironmentVariableAuthResponseType`

      - `InjectionLocation BetaManagedAgentsInjectionLocationResponse`

        Where in the outbound request the secret value is substituted.

        - `Body bool`

          Whether the placeholder is substituted in the request body.

        - `Header bool`

          Whether the placeholder is substituted in request header values.

      - `Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion`

        Outbound hosts the secret value is substituted on.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse`

          The secret is substituted on any host the session's Environment network policy permits egress to.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingResponse`

          The secret is substituted only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingResponseType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. An entry matches the request host exactly; a `*.`-prefixed entry matches any subdomain of the named domain but not the domain itself.

      - `SecretName string`

        Name of the environment variable.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the credential.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `VaultID string`

    Identifier of the vault this credential belongs to.

  - `DisplayName string Optional`

    Human-readable name for the credential.

#### 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"),
	)
	betaManagedAgentsCredential, err := client.Beta.Vaults.Credentials.New(
		context.TODO(),
		"vlt_011CZkZDLs7fYzm1hXNPeRjv",
		anthropic.BetaVaultCredentialNewParams{
			Auth: anthropic.BetaVaultCredentialNewParamsAuthUnion{
				OfStaticBearer: &anthropic.BetaManagedAgentsStaticBearerCreateParams{
					Token:        "bearer_exampletoken",
					MCPServerURL: "https://example-server.modelcontextprotocol.io/sse",
					Type:         anthropic.BetaManagedAgentsStaticBearerCreateParamsTypeStaticBearer,
				},
			},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsCredential.ID)
}
```

##### Response (200)

```json
{
  "id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
  "archived_at": null,
  "auth": {
    "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse",
    "type": "static_bearer"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {
    "environment": "production"
  },
  "type": "vault_credential",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "display_name": "Example credential"
}
```

### List Credentials

`client.Beta.Vaults.Credentials.List(ctx, vaultID, params) (*PageCursor[BetaManagedAgentsCredential], error)`

**GET** `/v1/vaults/{vault_id}/credentials`

List Credentials

#### Parameters

- `vaultID string` (path parameter)

  Identifier of the vault to list credentials for.

- `params BetaVaultCredentialListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Whether to include archived credentials in the results.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of credentials to return per page. Defaults to 20, maximum 100.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination token from a previous `list_credentials` response.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsCredential`

  A credential stored in a vault. Sensitive fields are never returned in responses.

  - `Type BetaManagedAgentsCredentialType`

  - `ID string`

    Unique identifier for the credential.

  - `ArchivedAt Time`

    When the credential was archived. Null if not archived.

    format: date-time

  - `Auth BetaManagedAgentsCredentialAuthUnion`

    Authentication configuration for this credential.

    - `type BetaManagedAgentsMCPOAuthAuthResponse`

      OAuth credential details for an MCP server.

      - `Type BetaManagedAgentsMCPOAuthAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshResponse Optional`

        Refresh token configuration, if the credential supports token refresh.

        - `ClientID string`

          OAuth client ID.

        - `TokenEndpoint string`

          Token endpoint URL used to refresh the access token.

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion`

          - `type BetaManagedAgentsTokenEndpointAuthNoneResponse`

            Token endpoint requires no client authentication.

            - `Type BetaManagedAgentsTokenEndpointAuthNoneResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthBasicResponse`

            Token endpoint uses HTTP Basic authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthPostResponse`

            Token endpoint uses POST body authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthPostResponseType`

        - `Resource string Optional`

          OAuth resource indicator.

        - `Scope string Optional`

          OAuth scope for the refresh request.

    - `type BetaManagedAgentsStaticBearerAuthResponse`

      Static bearer token credential details for an MCP server.

      - `Type BetaManagedAgentsStaticBearerAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

    - `type BetaManagedAgentsEnvironmentVariableAuthResponse`

      Environment variable credential details. The secret value is never returned.

      - `Type BetaManagedAgentsEnvironmentVariableAuthResponseType`

      - `InjectionLocation BetaManagedAgentsInjectionLocationResponse`

        Where in the outbound request the secret value is substituted.

        - `Body bool`

          Whether the placeholder is substituted in the request body.

        - `Header bool`

          Whether the placeholder is substituted in request header values.

      - `Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion`

        Outbound hosts the secret value is substituted on.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse`

          The secret is substituted on any host the session's Environment network policy permits egress to.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingResponse`

          The secret is substituted only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingResponseType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. An entry matches the request host exactly; a `*.`-prefixed entry matches any subdomain of the named domain but not the domain itself.

      - `SecretName string`

        Name of the environment variable.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the credential.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `VaultID string`

    Identifier of the vault this credential belongs to.

  - `DisplayName string Optional`

    Human-readable name for the credential.

#### 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"),
	)
	page, err := client.Beta.Vaults.Credentials.List(
		context.TODO(),
		"vlt_011CZkZDLs7fYzm1hXNPeRjv",
		anthropic.BetaVaultCredentialListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
      "archived_at": null,
      "auth": {
        "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse",
        "type": "static_bearer"
      },
      "created_at": "2026-03-15T10:00:00Z",
      "metadata": {
        "environment": "production"
      },
      "type": "vault_credential",
      "updated_at": "2026-03-15T10:00:00Z",
      "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
      "display_name": "Example credential"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get Credential

`client.Beta.Vaults.Credentials.Get(ctx, credentialID, params) (*BetaManagedAgentsCredential, error)`

**GET** `/v1/vaults/{vault_id}/credentials/{credential_id}`

Get Credential

#### Parameters

- `credentialID string` (path parameter)

  Unique identifier of the credential to retrieve.

- `params BetaVaultCredentialGetParams`

  - `VaultID string` (path parameter)

    Identifier of the vault containing the credential.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsCredential`

  A credential stored in a vault. Sensitive fields are never returned in responses.

  - `Type BetaManagedAgentsCredentialType`

  - `ID string`

    Unique identifier for the credential.

  - `ArchivedAt Time`

    When the credential was archived. Null if not archived.

    format: date-time

  - `Auth BetaManagedAgentsCredentialAuthUnion`

    Authentication configuration for this credential.

    - `type BetaManagedAgentsMCPOAuthAuthResponse`

      OAuth credential details for an MCP server.

      - `Type BetaManagedAgentsMCPOAuthAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshResponse Optional`

        Refresh token configuration, if the credential supports token refresh.

        - `ClientID string`

          OAuth client ID.

        - `TokenEndpoint string`

          Token endpoint URL used to refresh the access token.

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion`

          - `type BetaManagedAgentsTokenEndpointAuthNoneResponse`

            Token endpoint requires no client authentication.

            - `Type BetaManagedAgentsTokenEndpointAuthNoneResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthBasicResponse`

            Token endpoint uses HTTP Basic authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthPostResponse`

            Token endpoint uses POST body authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthPostResponseType`

        - `Resource string Optional`

          OAuth resource indicator.

        - `Scope string Optional`

          OAuth scope for the refresh request.

    - `type BetaManagedAgentsStaticBearerAuthResponse`

      Static bearer token credential details for an MCP server.

      - `Type BetaManagedAgentsStaticBearerAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

    - `type BetaManagedAgentsEnvironmentVariableAuthResponse`

      Environment variable credential details. The secret value is never returned.

      - `Type BetaManagedAgentsEnvironmentVariableAuthResponseType`

      - `InjectionLocation BetaManagedAgentsInjectionLocationResponse`

        Where in the outbound request the secret value is substituted.

        - `Body bool`

          Whether the placeholder is substituted in the request body.

        - `Header bool`

          Whether the placeholder is substituted in request header values.

      - `Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion`

        Outbound hosts the secret value is substituted on.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse`

          The secret is substituted on any host the session's Environment network policy permits egress to.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingResponse`

          The secret is substituted only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingResponseType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. An entry matches the request host exactly; a `*.`-prefixed entry matches any subdomain of the named domain but not the domain itself.

      - `SecretName string`

        Name of the environment variable.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the credential.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `VaultID string`

    Identifier of the vault this credential belongs to.

  - `DisplayName string Optional`

    Human-readable name for the credential.

#### 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"),
	)
	betaManagedAgentsCredential, err := client.Beta.Vaults.Credentials.Get(
		context.TODO(),
		"vcrd_011CZkZEMt8gZan2iYPQfSkw",
		anthropic.BetaVaultCredentialGetParams{
			VaultID: "vlt_011CZkZDLs7fYzm1hXNPeRjv",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsCredential.ID)
}
```

##### Response (200)

```json
{
  "id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
  "archived_at": null,
  "auth": {
    "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse",
    "type": "static_bearer"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {
    "environment": "production"
  },
  "type": "vault_credential",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "display_name": "Example credential"
}
```

### Update Credential

`client.Beta.Vaults.Credentials.Update(ctx, credentialID, params) (*BetaManagedAgentsCredential, error)`

**POST** `/v1/vaults/{vault_id}/credentials/{credential_id}`

Update Credential

#### Parameters

- `credentialID string` (path parameter)

  Unique identifier of the credential to update.

- `params BetaVaultCredentialUpdateParams`

  - `VaultID string` (path parameter)

    Identifier of the vault containing the credential.

  - `Auth BetaVaultCredentialUpdateParamsAuthUnion Optional`

    Updated authentication configuration. The `type` is immutable; the variant sent must match the stored credential's type.

    - `type BetaManagedAgentsMCPOAuthUpdateParams`

      Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.

      - `Type BetaManagedAgentsMCPOAuthUpdateParamsType`

      - `AccessToken string Optional`

        Updated OAuth access token.

        minLength: 1, maxLength: 8192

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshUpdateParams Optional`

        Updated refresh token configuration.

        - `RefreshToken string Optional`

          Updated OAuth refresh token.

          minLength: 1, maxLength: 8192

        - `Scope string Optional`

          Updated OAuth scope for the refresh request.

          maxLength: 8192

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion Optional`

          - `type BetaManagedAgentsTokenEndpointAuthBasicUpdateParam`

            Updated HTTP Basic authentication parameters for the token endpoint.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicUpdateParamType`

            - `ClientSecret string Optional`

              Updated OAuth client secret.

              minLength: 1, maxLength: 512

          - `type BetaManagedAgentsTokenEndpointAuthPostUpdateParam`

            Updated POST body authentication parameters for the token endpoint.

            - `Type BetaManagedAgentsTokenEndpointAuthPostUpdateParamType`

            - `ClientSecret string Optional`

              Updated OAuth client secret.

              minLength: 1, maxLength: 512

    - `type BetaManagedAgentsStaticBearerUpdateParams`

      Parameters for updating a static bearer token credential. The `mcp_server_url` is immutable.

      - `Type BetaManagedAgentsStaticBearerUpdateParamsType`

      - `Token string Optional`

        Updated static bearer token value.

        minLength: 1, maxLength: 8192

    - `type BetaManagedAgentsEnvironmentVariableUpdateParams`

      Parameters for updating an environment variable credential. `secret_name` is immutable.

      - `Type BetaManagedAgentsEnvironmentVariableUpdateParamsType`

      - `InjectionLocation BetaManagedAgentsInjectionLocationUpdateParams Optional`

        Updated injection location.

        - `Body bool Optional`

          Substitute when the placeholder appears in the request body.

        - `Header bool Optional`

          Substitute when the placeholder appears in a request header value.

      - `Networking BetaManagedAgentsCredentialNetworkingParamsUnion Optional`

        Updated networking scope. Full replacement.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingParams`

          Substitute the secret on any host the session's Environment network policy permits egress to. The Environment's network policy is the only boundary on where the secret can reach.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingParamsType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingParams`

          Substitute the secret only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingParamsType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. Each entry is a bare hostname (`api.example.com`), an IPv4 address (`192.0.2.1`), or a `*.`-prefixed wildcard (`*.example.com`). URLs, ports, paths, and IPv6 addresses are not accepted. At most 16 entries.

      - `SecretValue string Optional`

        Updated secret value.

        minLength: 1, maxLength: 4096

  - `DisplayName param.Opt[string] Optional`

    Updated human-readable name for the credential. 1-255 characters.

    minLength: 1, maxLength: 255

  - `Metadata map[string, string] Optional`

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsCredential`

  A credential stored in a vault. Sensitive fields are never returned in responses.

  - `Type BetaManagedAgentsCredentialType`

  - `ID string`

    Unique identifier for the credential.

  - `ArchivedAt Time`

    When the credential was archived. Null if not archived.

    format: date-time

  - `Auth BetaManagedAgentsCredentialAuthUnion`

    Authentication configuration for this credential.

    - `type BetaManagedAgentsMCPOAuthAuthResponse`

      OAuth credential details for an MCP server.

      - `Type BetaManagedAgentsMCPOAuthAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshResponse Optional`

        Refresh token configuration, if the credential supports token refresh.

        - `ClientID string`

          OAuth client ID.

        - `TokenEndpoint string`

          Token endpoint URL used to refresh the access token.

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion`

          - `type BetaManagedAgentsTokenEndpointAuthNoneResponse`

            Token endpoint requires no client authentication.

            - `Type BetaManagedAgentsTokenEndpointAuthNoneResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthBasicResponse`

            Token endpoint uses HTTP Basic authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthPostResponse`

            Token endpoint uses POST body authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthPostResponseType`

        - `Resource string Optional`

          OAuth resource indicator.

        - `Scope string Optional`

          OAuth scope for the refresh request.

    - `type BetaManagedAgentsStaticBearerAuthResponse`

      Static bearer token credential details for an MCP server.

      - `Type BetaManagedAgentsStaticBearerAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

    - `type BetaManagedAgentsEnvironmentVariableAuthResponse`

      Environment variable credential details. The secret value is never returned.

      - `Type BetaManagedAgentsEnvironmentVariableAuthResponseType`

      - `InjectionLocation BetaManagedAgentsInjectionLocationResponse`

        Where in the outbound request the secret value is substituted.

        - `Body bool`

          Whether the placeholder is substituted in the request body.

        - `Header bool`

          Whether the placeholder is substituted in request header values.

      - `Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion`

        Outbound hosts the secret value is substituted on.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse`

          The secret is substituted on any host the session's Environment network policy permits egress to.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingResponse`

          The secret is substituted only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingResponseType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. An entry matches the request host exactly; a `*.`-prefixed entry matches any subdomain of the named domain but not the domain itself.

      - `SecretName string`

        Name of the environment variable.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the credential.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `VaultID string`

    Identifier of the vault this credential belongs to.

  - `DisplayName string Optional`

    Human-readable name for the credential.

#### 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"),
	)
	betaManagedAgentsCredential, err := client.Beta.Vaults.Credentials.Update(
		context.TODO(),
		"vcrd_011CZkZEMt8gZan2iYPQfSkw",
		anthropic.BetaVaultCredentialUpdateParams{
			VaultID: "vlt_011CZkZDLs7fYzm1hXNPeRjv",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsCredential.ID)
}
```

##### Response (200)

```json
{
  "id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
  "archived_at": null,
  "auth": {
    "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse",
    "type": "static_bearer"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {
    "environment": "production"
  },
  "type": "vault_credential",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "display_name": "Example credential"
}
```

### Delete Credential

`client.Beta.Vaults.Credentials.Delete(ctx, credentialID, params) (*BetaManagedAgentsDeletedCredential, error)`

**DELETE** `/v1/vaults/{vault_id}/credentials/{credential_id}`

Delete Credential

#### Parameters

- `credentialID string` (path parameter)

  Unique identifier of the credential to delete.

- `params BetaVaultCredentialDeleteParams`

  - `VaultID string` (path parameter)

    Identifier of the vault containing the credential.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeletedCredential`

  Confirmation of a deleted credential.

  - `Type BetaManagedAgentsDeletedCredentialType`

  - `ID string`

    Unique identifier of the deleted credential.

#### 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"),
	)
	betaManagedAgentsDeletedCredential, err := client.Beta.Vaults.Credentials.Delete(
		context.TODO(),
		"vcrd_011CZkZEMt8gZan2iYPQfSkw",
		anthropic.BetaVaultCredentialDeleteParams{
			VaultID: "vlt_011CZkZDLs7fYzm1hXNPeRjv",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeletedCredential.ID)
}
```

##### Response (200)

```json
{
  "id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
  "type": "vault_credential_deleted"
}
```

### Archive Credential

`client.Beta.Vaults.Credentials.Archive(ctx, credentialID, params) (*BetaManagedAgentsCredential, error)`

**POST** `/v1/vaults/{vault_id}/credentials/{credential_id}/archive`

Archive Credential

#### Parameters

- `credentialID string` (path parameter)

  Unique identifier of the credential to archive.

- `params BetaVaultCredentialArchiveParams`

  - `VaultID string` (path parameter)

    Identifier of the vault containing the credential.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsCredential`

  A credential stored in a vault. Sensitive fields are never returned in responses.

  - `Type BetaManagedAgentsCredentialType`

  - `ID string`

    Unique identifier for the credential.

  - `ArchivedAt Time`

    When the credential was archived. Null if not archived.

    format: date-time

  - `Auth BetaManagedAgentsCredentialAuthUnion`

    Authentication configuration for this credential.

    - `type BetaManagedAgentsMCPOAuthAuthResponse`

      OAuth credential details for an MCP server.

      - `Type BetaManagedAgentsMCPOAuthAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

      - `ExpiresAt Time Optional`

        A timestamp in RFC 3339 format

        format: date-time

      - `Refresh BetaManagedAgentsMCPOAuthRefreshResponse Optional`

        Refresh token configuration, if the credential supports token refresh.

        - `ClientID string`

          OAuth client ID.

        - `TokenEndpoint string`

          Token endpoint URL used to refresh the access token.

        - `TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion`

          - `type BetaManagedAgentsTokenEndpointAuthNoneResponse`

            Token endpoint requires no client authentication.

            - `Type BetaManagedAgentsTokenEndpointAuthNoneResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthBasicResponse`

            Token endpoint uses HTTP Basic authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthBasicResponseType`

          - `type BetaManagedAgentsTokenEndpointAuthPostResponse`

            Token endpoint uses POST body authentication with client credentials.

            - `Type BetaManagedAgentsTokenEndpointAuthPostResponseType`

        - `Resource string Optional`

          OAuth resource indicator.

        - `Scope string Optional`

          OAuth scope for the refresh request.

    - `type BetaManagedAgentsStaticBearerAuthResponse`

      Static bearer token credential details for an MCP server.

      - `Type BetaManagedAgentsStaticBearerAuthResponseType`

      - `MCPServerURL string`

        URL of the MCP server this credential authenticates against.

    - `type BetaManagedAgentsEnvironmentVariableAuthResponse`

      Environment variable credential details. The secret value is never returned.

      - `Type BetaManagedAgentsEnvironmentVariableAuthResponseType`

      - `InjectionLocation BetaManagedAgentsInjectionLocationResponse`

        Where in the outbound request the secret value is substituted.

        - `Body bool`

          Whether the placeholder is substituted in the request body.

        - `Header bool`

          Whether the placeholder is substituted in request header values.

      - `Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion`

        Outbound hosts the secret value is substituted on.

        - `type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse`

          The secret is substituted on any host the session's Environment network policy permits egress to.

          - `Type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType`

        - `type BetaManagedAgentsLimitedCredentialNetworkingResponse`

          The secret is substituted only on requests to the listed hosts.

          - `Type BetaManagedAgentsLimitedCredentialNetworkingResponseType`

          - `AllowedHosts []string`

            Hostnames on which the secret will be substituted. An entry matches the request host exactly; a `*.`-prefixed entry matches any subdomain of the named domain but not the domain itself.

      - `SecretName string`

        Name of the environment variable.

  - `CreatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata attached to the credential.

  - `UpdatedAt Time`

    A timestamp in RFC 3339 format

    format: date-time

  - `VaultID string`

    Identifier of the vault this credential belongs to.

  - `DisplayName string Optional`

    Human-readable name for the credential.

#### 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"),
	)
	betaManagedAgentsCredential, err := client.Beta.Vaults.Credentials.Archive(
		context.TODO(),
		"vcrd_011CZkZEMt8gZan2iYPQfSkw",
		anthropic.BetaVaultCredentialArchiveParams{
			VaultID: "vlt_011CZkZDLs7fYzm1hXNPeRjv",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsCredential.ID)
}
```

##### Response (200)

```json
{
  "id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
  "archived_at": null,
  "auth": {
    "mcp_server_url": "https://example-server.modelcontextprotocol.io/sse",
    "type": "static_bearer"
  },
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {
    "environment": "production"
  },
  "type": "vault_credential",
  "updated_at": "2026-03-15T10:00:00Z",
  "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv",
  "display_name": "Example credential"
}
```

### Validate Credential

`client.Beta.Vaults.Credentials.MCPOAuthValidate(ctx, credentialID, params) (*BetaManagedAgentsCredentialValidation, error)`

**POST** `/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate`

Validate Credential

#### Parameters

- `credentialID string` (path parameter)

  Unique identifier of the credential to validate.

- `params BetaVaultCredentialMCPOAuthValidateParams`

  - `VaultID string` (path parameter)

    Identifier of the vault containing the credential.

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

    This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsCredentialValidation`

  Result of live-probing a credential against its configured MCP server.

  - `Type BetaManagedAgentsCredentialValidationType`

  - `CredentialID string`

    Unique identifier of the credential that was validated.

  - `HasRefreshToken bool`

    Whether the credential has a refresh token configured.

  - `MCPProbe BetaManagedAgentsMCPProbe`

    Details of the failing MCP probe step. Null when the probe succeeded.

    - `HTTPResponse BetaManagedAgentsRefreshHTTPResponse`

      The captured HTTP error response. Null when no HTTP response was received (timeout, DNS, TLS).

      - `Body string`

        Response body. May be truncated and has sensitive values scrubbed.

      - `BodyTruncated bool`

        Whether `body` was truncated.

      - `ContentType string`

        Value of the `Content-Type` response header.

      - `StatusCode int64`

        HTTP status code.

        format: int32

    - `Method string`

      The MCP method that failed (for example `initialize` or `tools/list`).

  - `Refresh BetaManagedAgentsRefreshObject`

    Details of the refresh-token exchange attempted on a 401. Null when no refresh was attempted.

    - `HTTPResponse BetaManagedAgentsRefreshHTTPResponse`

      The captured HTTP error response from the token endpoint. Populated only when `status` is `failed`.

    - `Status BetaManagedAgentsRefreshObjectStatus`

      Outcome of the refresh attempt.

      - `const BetaManagedAgentsRefreshObjectStatusSucceeded BetaManagedAgentsRefreshObjectStatus = "succeeded"`

        The token endpoint returned a new access token.

      - `const BetaManagedAgentsRefreshObjectStatusFailed BetaManagedAgentsRefreshObjectStatus = "failed"`

        The token endpoint returned an error response. See `http_response` for detail.

      - `const BetaManagedAgentsRefreshObjectStatusConnectError BetaManagedAgentsRefreshObjectStatus = "connect_error"`

        The token endpoint could not be reached (DNS, TLS, or connection error).

      - `const BetaManagedAgentsRefreshObjectStatusNoRefreshToken BetaManagedAgentsRefreshObjectStatus = "no_refresh_token"`

        No refresh token is stored for the credential, so no exchange was attempted.

  - `Status BetaManagedAgentsCredentialValidationStatus`

    Overall verdict of the validation probe.

    - `const BetaManagedAgentsCredentialValidationStatusValid BetaManagedAgentsCredentialValidationStatus = "valid"`

      The credential successfully authenticated against its MCP server.

    - `const BetaManagedAgentsCredentialValidationStatusInvalid BetaManagedAgentsCredentialValidationStatus = "invalid"`

      The probe reached the MCP server and was rejected, and a refresh (if attempted) did not recover it.

    - `const BetaManagedAgentsCredentialValidationStatusUnknown BetaManagedAgentsCredentialValidationStatus = "unknown"`

      The probe could not determine validity — for example, a transport error or a successful refresh that was not re-probed.

  - `ValidatedAt Time`

    When the validation probe was performed.

    format: date-time

  - `VaultID string`

    Identifier of the vault containing the credential.

#### 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"),
	)
	betaManagedAgentsCredentialValidation, err := client.Beta.Vaults.Credentials.MCPOAuthValidate(
		context.TODO(),
		"vcrd_011CZkZEMt8gZan2iYPQfSkw",
		anthropic.BetaVaultCredentialMCPOAuthValidateParams{
			VaultID: "vlt_011CZkZDLs7fYzm1hXNPeRjv",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsCredentialValidation.CredentialID)
}
```

##### Response (200)

```json
{
  "credential_id": "vcrd_011CZkZEMt8gZan2iYPQfSkw",
  "has_refresh_token": true,
  "mcp_probe": {
    "http_response": {
      "body": "body",
      "body_truncated": true,
      "content_type": "content_type",
      "status_code": 0
    },
    "method": "method"
  },
  "refresh": {
    "http_response": {
      "body": "body",
      "body_truncated": true,
      "content_type": "content_type",
      "status_code": 0
    },
    "status": "succeeded"
  },
  "status": "valid",
  "type": "vault_credential_validation",
  "validated_at": "2026-03-15T10:00:00Z",
  "vault_id": "vlt_011CZkZDLs7fYzm1hXNPeRjv"
}
```

## Beta › Memory Stores

### Create a memory store

`client.Beta.MemoryStores.New(ctx, params) (*BetaManagedAgentsMemoryStore, error)`

**POST** `/v1/memory_stores`

Create a memory store

#### Parameters

- `params BetaMemoryStoreNewParams`

  - `Name string`

    Human-readable name for the store. Required; 1–255 characters; no control characters. The mount-path slug under `/mnt/memory/` is derived from this name (lowercased, non-alphanumeric runs collapsed to a hyphen). Names need not be unique within a workspace.

    minLength: 1, maxLength: 255

  - `Description param.Opt[string] Optional`

    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent.

    maxLength: 1024

  - `Metadata map[string, string] Optional`

    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Not visible to the agent.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryStore`

  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.

  - `Type BetaManagedAgentsMemoryStoreType`

  - `ID string`

    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.

  - `ArchivedAt Time`

    Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.

    format: date-time

  - `CreatedAt Time`

    Timestamp when the store was created.

    format: date-time

  - `Description string`

    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.

  - `Metadata map[string, string]`

    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.

  - `Name string`

    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.

  - `UpdatedAt Time`

    Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.

    format: date-time

#### 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"),
	)
	betaManagedAgentsMemoryStore, err := client.Beta.MemoryStores.New(context.TODO(), anthropic.BetaMemoryStoreNewParams{
		Name: "x",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemoryStore.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "type": "memory_store",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

### List memory stores

`client.Beta.MemoryStores.List(ctx, params) (*PageCursor[BetaManagedAgentsMemoryStore], error)`

**GET** `/v1/memory_stores`

List memory stores

#### Parameters

- `params BetaMemoryStoreListParams`

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return only stores whose `created_at` is at or after this time (inclusive). Sent on the wire as `created_at[gte]`.

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return only stores whose `created_at` is at or before this time (inclusive). Sent on the wire as `created_at[lte]`.

    format: date-time

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    When `true`, archived stores are included in the results. Defaults to `false` (archived stores are excluded).

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of stores to return per page. Must be between 1 and 100. Defaults to 20 when omitted.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous response to fetch the next page; omit for the first page.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryStore`

  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.

  - `Type BetaManagedAgentsMemoryStoreType`

  - `ID string`

    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.

  - `ArchivedAt Time`

    Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.

    format: date-time

  - `CreatedAt Time`

    Timestamp when the store was created.

    format: date-time

  - `Description string`

    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.

  - `Metadata map[string, string]`

    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.

  - `Name string`

    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.

  - `UpdatedAt Time`

    Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.MemoryStores.List(context.TODO(), anthropic.BetaMemoryStoreListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "memstore_01Wf3kQ8tZxB2mVr7HcJ4aNd",
      "archived_at": null,
      "created_at": "2026-03-15T10:00:00Z",
      "description": "Per-user preferences and project context.",
      "metadata": {},
      "name": "User Preferences",
      "type": "memory_store",
      "updated_at": "2026-03-15T10:00:00Z"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Retrieve a memory store

`client.Beta.MemoryStores.Get(ctx, memoryStoreID, query) (*BetaManagedAgentsMemoryStore, error)`

**GET** `/v1/memory_stores/{memory_store_id}`

Retrieve a memory store

#### Parameters

- `memoryStoreID string` (path parameter)

  ID of the memory store to retrieve (a `memstore_...` identifier). Required. Enumerate IDs via `GET /v1/memory_stores`.

- `query BetaMemoryStoreGetParams`

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryStore`

  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.

  - `Type BetaManagedAgentsMemoryStoreType`

  - `ID string`

    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.

  - `ArchivedAt Time`

    Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.

    format: date-time

  - `CreatedAt Time`

    Timestamp when the store was created.

    format: date-time

  - `Description string`

    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.

  - `Metadata map[string, string]`

    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.

  - `Name string`

    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.

  - `UpdatedAt Time`

    Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.

    format: date-time

#### 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"),
	)
	betaManagedAgentsMemoryStore, err := client.Beta.MemoryStores.Get(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemoryStore.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "type": "memory_store",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

### Update a memory store

`client.Beta.MemoryStores.Update(ctx, memoryStoreID, params) (*BetaManagedAgentsMemoryStore, error)`

**POST** `/v1/memory_stores/{memory_store_id}`

Update a memory store

#### Parameters

- `memoryStoreID string` (path parameter)

  ID of the memory store to update (a `memstore_...` identifier). Required. Enumerate IDs via `GET /v1/memory_stores`. Updating an archived store returns 400.

- `params BetaMemoryStoreUpdateParams`

  - `Description param.Opt[string] Optional`

    New description for the store, up to 1024 characters. Pass an empty string to clear it.

    maxLength: 1024

  - `Metadata map[string, string] Optional`

    Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.

  - `Name param.Opt[string] Optional`

    New human-readable name for the store. 1–255 characters; no control characters. Renaming changes the slug used for the store's `mount_path` in sessions created after the update.

    minLength: 1, maxLength: 255

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryStore`

  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.

  - `Type BetaManagedAgentsMemoryStoreType`

  - `ID string`

    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.

  - `ArchivedAt Time`

    Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.

    format: date-time

  - `CreatedAt Time`

    Timestamp when the store was created.

    format: date-time

  - `Description string`

    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.

  - `Metadata map[string, string]`

    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.

  - `Name string`

    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.

  - `UpdatedAt Time`

    Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.

    format: date-time

#### 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"),
	)
	betaManagedAgentsMemoryStore, err := client.Beta.MemoryStores.Update(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemoryStore.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "type": "memory_store",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

### Delete a memory store

`client.Beta.MemoryStores.Delete(ctx, memoryStoreID, body) (*BetaManagedAgentsDeletedMemoryStore, error)`

**DELETE** `/v1/memory_stores/{memory_store_id}`

Delete a memory store

#### Parameters

- `memoryStoreID string` (path parameter)

  ID of the memory store to permanently delete (a `memstore_...` identifier). Required. Deletion cascades to all memories and memory versions in the store and cannot be undone.

- `body BetaMemoryStoreDeleteParams`

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeletedMemoryStore`

  Confirmation that a `memory_store` was deleted.

  - `Type BetaManagedAgentsDeletedMemoryStoreType`

  - `ID string`

    ID of the deleted memory store (a `memstore_...` identifier). The store and all its memories and versions are no longer retrievable.

#### 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"),
	)
	betaManagedAgentsDeletedMemoryStore, err := client.Beta.MemoryStores.Delete(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeletedMemoryStore.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "type": "memory_store_deleted"
}
```

### Archive a memory store

`client.Beta.MemoryStores.Archive(ctx, memoryStoreID, body) (*BetaManagedAgentsMemoryStore, error)`

**POST** `/v1/memory_stores/{memory_store_id}/archive`

Archive a memory store

#### Parameters

- `memoryStoreID string` (path parameter)

  ID of the memory store to archive (a `memstore_...` identifier). Required. Archiving is one-way and idempotent; archived stores cannot be unarchived. Enumerate IDs via `GET /v1/memory_stores`.

- `body BetaMemoryStoreArchiveParams`

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryStore`

  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.

  - `Type BetaManagedAgentsMemoryStoreType`

  - `ID string`

    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.

  - `ArchivedAt Time`

    Timestamp when the store was archived, or `null` if active. Set once and never cleared; archiving is one-way. Archived stores are read-only and cannot be attached to new sessions.

    format: date-time

  - `CreatedAt Time`

    Timestamp when the store was created.

    format: date-time

  - `Description string`

    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.

  - `Metadata map[string, string]`

    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.

  - `Name string`

    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.

  - `UpdatedAt Time`

    Timestamp when the store's `name`, `description`, or `metadata` was last modified. Memory writes inside the store do not advance this.

    format: date-time

#### 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"),
	)
	betaManagedAgentsMemoryStore, err := client.Beta.MemoryStores.Archive(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemoryStore.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "type": "memory_store",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

## Beta › Memory Stores › Memories

### Create a memory

`client.Beta.MemoryStores.Memories.New(ctx, memoryStoreID, params) (*BetaManagedAgentsMemory, error)`

**POST** `/v1/memory_stores/{memory_store_id}/memories`

Create a memory

#### Parameters

- `memoryStoreID string` (path parameter)

  The ID of the memory store to create the memory in (`memstore_...`).

- `params BetaMemoryStoreMemoryNewParams`

  - `Content param.Opt[string]`

    UTF-8 text content for the new memory. Maximum 100 kB (102,400 bytes). Required; pass `""` explicitly to create an empty memory.

  - `Path string`

    Hierarchical path for the new memory, e.g. `/projects/foo/notes.md`. Must start with `/`, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, `.` or `..` segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive.

    minLength: 2, maxLength: 1024

  - `View BetaManagedAgentsMemoryView Optional` (query parameter)

    Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemory`

  A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.

  - `Type BetaManagedAgentsMemoryType`

  - `ID string`

    Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.

  - `ContentSha256 string`

    Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.

  - `ContentSizeBytes int64`

    Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.

    format: int32

  - `CreatedAt Time`

    When this memory was created, in RFC 3339 format.

    format: date-time

  - `MemoryStoreID string`

    ID of the memory store this memory belongs to (a `memstore_...` value).

  - `MemoryVersionID string`

    ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

  - `Path string`

    Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

  - `UpdatedAt Time`

    When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's `created_by` via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

    format: date-time

  - `Content string Optional`

    The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).

#### 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"),
	)
	betaManagedAgentsMemory, err := client.Beta.MemoryStores.Memories.New(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreMemoryNewParams{
			Content: anthropic.String("content"),
			Path:    "xx",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemory.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "content_sha256": "content_sha256",
  "content_size_bytes": 0,
  "created_at": "2019-12-27T18:11:19.117Z",
  "memory_store_id": "memory_store_id",
  "memory_version_id": "memory_version_id",
  "path": "path",
  "type": "memory",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "content": "content"
}
```

### List memories

`client.Beta.MemoryStores.Memories.List(ctx, memoryStoreID, params) (*PageCursor[BetaManagedAgentsMemoryListItemUnion], error)`

**GET** `/v1/memory_stores/{memory_store_id}/memories`

List memories

#### Parameters

- `memoryStoreID string` (path parameter)

  The ID of the memory store to list memories from (`memstore_...`).

- `params BetaMemoryStoreMemoryListParams`

  - `Depth param.Opt[int64] Optional` (query parameter)

    `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1` returns immediate children only; deeper entries roll up as `memory_prefix` items. `depth=1` behaves like `ls`; omitting `depth` behaves like `find`.

    format: int32

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20 when omitted. Capped at 20 when `view=full`. Both `memory` and `memory_prefix` items count toward the limit.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous response to fetch the next page; omit for the first page.

  - `PathPrefix param.Opt[string] Optional` (query parameter)

    Optional path prefix filter. Must end with `/` (segment-aligned), e.g., `/notes/`. This value appears in request URLs. Do not include secrets or personally identifiable information.

  - `View BetaManagedAgentsMemoryView Optional` (query parameter)

    Which projection of each `memory` to return. Defaults to `basic` (content omitted). `full` populates `content` on each item and caps `limit` at 20; use this as the bulk-read path for export and sync.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryListItemUnion interface{…}`

  One item in a [List memories](https://platform.claude.com/docs/en/api/beta/memory_stores/memories/list?sdk_languages=go) response: either a `memory` object or, when `depth` is set, a `memory_prefix` rollup marker.

  - `type BetaManagedAgentsMemory`

    A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.

    - `Type BetaManagedAgentsMemoryType`

    - `ID string`

      Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.

    - `ContentSha256 string`

      Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.

    - `ContentSizeBytes int64`

      Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.

      format: int32

    - `CreatedAt Time`

      When this memory was created, in RFC 3339 format.

      format: date-time

    - `MemoryStoreID string`

      ID of the memory store this memory belongs to (a `memstore_...` value).

    - `MemoryVersionID string`

      ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

    - `Path string`

      Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

    - `UpdatedAt Time`

      When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's `created_by` via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

      format: date-time

    - `Content string Optional`

      The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).

  - `type BetaManagedAgentsMemoryPrefix`

    A rolled-up directory marker returned by [List memories](https://platform.claude.com/docs/en/api/beta/memory_stores/memories/list?sdk_languages=go) when `depth` is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page `limit` and interleaves with `memory` items in path order.

    - `Type BetaManagedAgentsMemoryPrefixType`

    - `Path string`

      The rolled-up path prefix, including a trailing `/` (e.g. `/projects/foo/`). Pass this value as `path_prefix` on a subsequent list call to drill into the directory.

#### 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"),
	)
	page, err := client.Beta.MemoryStores.Memories.List(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreMemoryListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "mem_011CZkZ9X2dpNyB6YbtxvB6e",
      "content_sha256": "ba7936d94c84d948a2232088f78228f175df6a8353b2d5bc9228eee5794a0024",
      "content_size_bytes": 28,
      "created_at": "2026-03-15T10:00:00Z",
      "memory_store_id": "memstore_01Wf3kQ8tZxB2mVr7HcJ4aNd",
      "memory_version_id": "memver_011CZkZBJq5dWxk9fVLNcPht",
      "path": "/preferences/formatting.md",
      "type": "memory",
      "updated_at": "2026-03-15T10:00:00Z",
      "content": null
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Retrieve a memory

`client.Beta.MemoryStores.Memories.Get(ctx, memoryID, params) (*BetaManagedAgentsMemory, error)`

**GET** `/v1/memory_stores/{memory_store_id}/memories/{memory_id}`

Retrieve a memory

#### Parameters

- `memoryID string` (path parameter)

  The ID of the memory to retrieve (`mem_...`).

- `params BetaMemoryStoreMemoryGetParams`

  - `MemoryStoreID string` (path parameter)

    The ID of the memory store that holds the memory (`memstore_...`).

  - `View BetaManagedAgentsMemoryView Optional` (query parameter)

    Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemory`

  A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.

  - `Type BetaManagedAgentsMemoryType`

  - `ID string`

    Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.

  - `ContentSha256 string`

    Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.

  - `ContentSizeBytes int64`

    Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.

    format: int32

  - `CreatedAt Time`

    When this memory was created, in RFC 3339 format.

    format: date-time

  - `MemoryStoreID string`

    ID of the memory store this memory belongs to (a `memstore_...` value).

  - `MemoryVersionID string`

    ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

  - `Path string`

    Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

  - `UpdatedAt Time`

    When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's `created_by` via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

    format: date-time

  - `Content string Optional`

    The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).

#### 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"),
	)
	betaManagedAgentsMemory, err := client.Beta.MemoryStores.Memories.Get(
		context.TODO(),
		"memory_id",
		anthropic.BetaMemoryStoreMemoryGetParams{
			MemoryStoreID: "memory_store_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemory.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "content_sha256": "content_sha256",
  "content_size_bytes": 0,
  "created_at": "2019-12-27T18:11:19.117Z",
  "memory_store_id": "memory_store_id",
  "memory_version_id": "memory_version_id",
  "path": "path",
  "type": "memory",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "content": "content"
}
```

### Update a memory

`client.Beta.MemoryStores.Memories.Update(ctx, memoryID, params) (*BetaManagedAgentsMemory, error)`

**POST** `/v1/memory_stores/{memory_store_id}/memories/{memory_id}`

Update a memory

#### Parameters

- `memoryID string` (path parameter)

  The ID of the memory to update (`mem_...`).

- `params BetaMemoryStoreMemoryUpdateParams`

  - `MemoryStoreID string` (path parameter)

    The ID of the memory store that holds the memory (`memstore_...`).

  - `View BetaManagedAgentsMemoryView Optional` (query parameter)

    Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.

  - `Content param.Opt[string] Optional`

    New UTF-8 text content for the memory. Maximum 100 kB (102,400 bytes). Omit to leave the content unchanged (e.g., for a rename-only update).

  - `Path param.Opt[string] Optional`

    New path for the memory (a rename). Must start with `/`, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, `.` or `..` segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive. The memory's `id` is preserved across renames. Omit to leave the path unchanged.

    minLength: 2, maxLength: 1024

  - `Precondition BetaManagedAgentsPreconditionParam Optional`

    Optional optimistic-concurrency precondition. When supplied, the update applies only if the memory's current state matches; on mismatch the request returns `memory_precondition_failed_error` (HTTP 409). When omitted, the update is unconditional.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemory`

  A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.

  - `Type BetaManagedAgentsMemoryType`

  - `ID string`

    Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.

  - `ContentSha256 string`

    Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.

  - `ContentSizeBytes int64`

    Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.

    format: int32

  - `CreatedAt Time`

    When this memory was created, in RFC 3339 format.

    format: date-time

  - `MemoryStoreID string`

    ID of the memory store this memory belongs to (a `memstore_...` value).

  - `MemoryVersionID string`

    ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

  - `Path string`

    Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.

  - `UpdatedAt Time`

    When this memory was last modified, in RFC 3339 format. Use this as a cheap freshness signal; for who made the change, look up the head version's `created_by` via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go).

    format: date-time

  - `Content string Optional`

    The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).

#### 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"),
	)
	betaManagedAgentsMemory, err := client.Beta.MemoryStores.Memories.Update(
		context.TODO(),
		"memory_id",
		anthropic.BetaMemoryStoreMemoryUpdateParams{
			MemoryStoreID: "memory_store_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemory.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "content_sha256": "content_sha256",
  "content_size_bytes": 0,
  "created_at": "2019-12-27T18:11:19.117Z",
  "memory_store_id": "memory_store_id",
  "memory_version_id": "memory_version_id",
  "path": "path",
  "type": "memory",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "content": "content"
}
```

### Delete a memory

`client.Beta.MemoryStores.Memories.Delete(ctx, memoryID, params) (*BetaManagedAgentsDeletedMemory, error)`

**DELETE** `/v1/memory_stores/{memory_store_id}/memories/{memory_id}`

Delete a memory

#### Parameters

- `memoryID string` (path parameter)

  The ID of the memory to delete (`mem_...`).

- `params BetaMemoryStoreMemoryDeleteParams`

  - `MemoryStoreID string` (path parameter)

    The ID of the memory store that holds the memory (`memstore_...`).

  - `ExpectedContentSha256 param.Opt[string] Optional` (query parameter)

    Delete the memory only if its current `content_sha256` equals this value, given as 64 lowercase hexadecimal characters. Omit it to delete unconditionally.

    If the hashes differ, the request fails with HTTP status 409 and nothing is deleted.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsDeletedMemory`

  Tombstone returned by [Delete a memory](https://platform.claude.com/docs/en/api/beta/memory_stores/memories/delete?sdk_languages=go). Deleting a memory does not erase its version history: its versions remain listable via [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go) while they are retained (each version is kept for at least the version retention period after it was written, unless the store itself is deleted).

  - `Type BetaManagedAgentsDeletedMemoryType`

  - `ID string`

    ID of the deleted memory (a `mem_...` value).

#### 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"),
	)
	betaManagedAgentsDeletedMemory, err := client.Beta.MemoryStores.Memories.Delete(
		context.TODO(),
		"memory_id",
		anthropic.BetaMemoryStoreMemoryDeleteParams{
			MemoryStoreID: "memory_store_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsDeletedMemory.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "type": "memory_deleted"
}
```

## Beta › Memory Stores › Memory Versions

### List memory versions

`client.Beta.MemoryStores.MemoryVersions.List(ctx, memoryStoreID, params) (*PageCursor[BetaManagedAgentsMemoryVersion], error)`

**GET** `/v1/memory_stores/{memory_store_id}/memory_versions`

List memory versions

#### Parameters

- `memoryStoreID string` (path parameter)

  The ID of the memory store whose version history to list (`memstore_...`).

- `params BetaMemoryStoreMemoryVersionListParams`

  - `APIKeyID param.Opt[string] Optional` (query parameter)

    Return only versions written with the API key that has this ID.

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    Return versions created at or after this time (inclusive).

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    Return versions created at or before this time (inclusive).

    format: date-time

  - `Limit param.Opt[int64] Optional` (query parameter)

    The maximum number of versions to return per page. Defaults to 20.

    format: int32

  - `MemoryID param.Opt[string] Optional` (query parameter)

    Return only versions of the memory with this ID (`mem_...`).

    The filter still works after the memory is deleted. The results then include the version whose `operation` is `deleted`.

  - `Operation BetaManagedAgentsMemoryVersionOperation Optional` (query parameter)

    Return only versions that record this kind of change.

  - `Page param.Opt[string] Optional` (query parameter)

    The `next_page` value from a previous response, to get the next page. Omit it to get the first page.

  - `ServiceAccountID param.Opt[string] Optional` (query parameter)

    Return only versions written by the service account with this ID (`svac_...`).

  - `SessionID param.Opt[string] Optional` (query parameter)

    Return only versions written by the session with this ID.

  - `View BetaManagedAgentsMemoryView Optional` (query parameter)

    Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryVersion`

  A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and are not deleted with the memory; each version is retained for at least the version retention period after it was written, unless the store itself is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.

  - `Type BetaManagedAgentsMemoryVersionType`

  - `ID string`

    Unique identifier for this version (a `memver_...` value).

  - `CreatedAt Time`

    When this version was written, in RFC 3339 format.

    format: date-time

  - `MemoryID string`

    ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go) to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained.

  - `MemoryStoreID string`

    ID of the memory store this version belongs to (a `memstore_...` value).

  - `Operation BetaManagedAgentsMemoryVersionOperation`

    The kind of mutation this version records: `created`, `modified`, or `deleted`.

    - `const BetaManagedAgentsMemoryVersionOperationCreated BetaManagedAgentsMemoryVersionOperation = "created"`

      The memory was created. The first version in any memory's lineage.

    - `const BetaManagedAgentsMemoryVersionOperationModified BetaManagedAgentsMemoryVersionOperation = "modified"`

      The memory's `content`, `path`, or both were changed via update. Writes the agent makes through the filesystem mount also appear as `modified`.

    - `const BetaManagedAgentsMemoryVersionOperationDeleted BetaManagedAgentsMemoryVersionOperation = "deleted"`

      The memory was deleted. The `content`, `content_size_bytes`, and `content_sha256` fields are `null` on this version. The preceding version, while it is retained, records the deleted content's size and hash.

  - `Content string Optional`

    The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.

  - `ContentSha256 string Optional`

    Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.

  - `ContentSizeBytes int64 Optional`

    Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.

    format: int32

  - `CreatedBy BetaManagedAgentsActorUnion Optional`

    Who performed this write: one of `session_actor`, `api_actor`, `user_actor`, or `service_account_actor`; `null` when no writer is recorded. Captured at write time and preserved through redaction. A `session_actor` is an agent writing through the store's mounted filesystem at `/mnt/memory/`. The API key that created that session is not recorded on agent writes, so attribution names who made the write, not who is ultimately responsible; look up session provenance via the [Sessions API](https://platform.claude.com/docs/en/api/beta/sessions/retrieve?sdk_languages=go).

    - `type BetaManagedAgentsSessionActor`

      An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session.

      - `Type BetaManagedAgentsSessionActorType`

      - `SessionID string`

        ID of the session (a `sesn_...` value). Look up the session via [Retrieve a session](https://platform.claude.com/docs/en/api/beta/sessions/retrieve?sdk_languages=go) for further provenance.

        minLength: 1

    - `type BetaManagedAgentsAPIActor`

      A direct caller of the public API, identified by the API key that authenticated the request.

      - `Type BetaManagedAgentsAPIActorType`

      - `APIKeyID string`

        ID of the API key (an `apikey_...` value). This identifies the key, not the secret.

        minLength: 1

    - `type BetaManagedAgentsUserActor`

      A human user, for example acting through the Anthropic Console.

      - `Type BetaManagedAgentsUserActorType`

      - `UserID string`

        ID of the user (a `user_...` value).

        minLength: 1

    - `type BetaManagedAgentsServiceAccountActor`

      A workload authenticated as a service account, for example via Workload Identity Federation.

      - `Type ServiceAccountActor`

      - `ServiceAccountID string`

        ID of the service account (a `svac_...` value).

        minLength: 1

  - `Path string Optional`

    The memory's path at the time of this write. `null` if and only if `redacted_at` is set.

  - `RedactedAt Time Optional`

    When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/redact?sdk_languages=go).

    format: date-time

  - `RedactedBy BetaManagedAgentsActorUnion Optional`

    Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor`, `user_actor`, or `service_account_actor` (agents do not have a redact capability).

#### 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"),
	)
	page, err := client.Beta.MemoryStores.MemoryVersions.List(
		context.TODO(),
		"memory_store_id",
		anthropic.BetaMemoryStoreMemoryVersionListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "memver_011CZkZBJq5dWxk9fVLNcPht",
      "created_at": "2026-03-15T10:00:00Z",
      "memory_id": "mem_011CZkZ9X2dpNyB6YbtxvB6e",
      "memory_store_id": "memstore_01Wf3kQ8tZxB2mVr7HcJ4aNd",
      "operation": "created",
      "type": "memory_version",
      "content": null,
      "content_sha256": "ba7936d94c84d948a2232088f78228f175df6a8353b2d5bc9228eee5794a0024",
      "content_size_bytes": 28,
      "created_by": {
        "session_id": "sesn_011CZkZAtmR3yMPDzynEDxu7",
        "type": "session_actor"
      },
      "path": "/preferences/formatting.md",
      "redacted_at": null,
      "redacted_by": {
        "session_id": "x",
        "type": "session_actor"
      }
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Retrieve a memory version

`client.Beta.MemoryStores.MemoryVersions.Get(ctx, memoryVersionID, params) (*BetaManagedAgentsMemoryVersion, error)`

**GET** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}`

Retrieve a memory version

#### Parameters

- `memoryVersionID string` (path parameter)

  The ID of the memory version to retrieve (`memver_...`).

- `params BetaMemoryStoreMemoryVersionGetParams`

  - `MemoryStoreID string` (path parameter)

    The ID of the memory store that holds the version (`memstore_...`).

  - `View BetaManagedAgentsMemoryView Optional` (query parameter)

    Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryVersion`

  A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and are not deleted with the memory; each version is retained for at least the version retention period after it was written, unless the store itself is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.

  - `Type BetaManagedAgentsMemoryVersionType`

  - `ID string`

    Unique identifier for this version (a `memver_...` value).

  - `CreatedAt Time`

    When this version was written, in RFC 3339 format.

    format: date-time

  - `MemoryID string`

    ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go) to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained.

  - `MemoryStoreID string`

    ID of the memory store this version belongs to (a `memstore_...` value).

  - `Operation BetaManagedAgentsMemoryVersionOperation`

    The kind of mutation this version records: `created`, `modified`, or `deleted`.

    - `const BetaManagedAgentsMemoryVersionOperationCreated BetaManagedAgentsMemoryVersionOperation = "created"`

      The memory was created. The first version in any memory's lineage.

    - `const BetaManagedAgentsMemoryVersionOperationModified BetaManagedAgentsMemoryVersionOperation = "modified"`

      The memory's `content`, `path`, or both were changed via update. Writes the agent makes through the filesystem mount also appear as `modified`.

    - `const BetaManagedAgentsMemoryVersionOperationDeleted BetaManagedAgentsMemoryVersionOperation = "deleted"`

      The memory was deleted. The `content`, `content_size_bytes`, and `content_sha256` fields are `null` on this version. The preceding version, while it is retained, records the deleted content's size and hash.

  - `Content string Optional`

    The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.

  - `ContentSha256 string Optional`

    Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.

  - `ContentSizeBytes int64 Optional`

    Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.

    format: int32

  - `CreatedBy BetaManagedAgentsActorUnion Optional`

    Who performed this write: one of `session_actor`, `api_actor`, `user_actor`, or `service_account_actor`; `null` when no writer is recorded. Captured at write time and preserved through redaction. A `session_actor` is an agent writing through the store's mounted filesystem at `/mnt/memory/`. The API key that created that session is not recorded on agent writes, so attribution names who made the write, not who is ultimately responsible; look up session provenance via the [Sessions API](https://platform.claude.com/docs/en/api/beta/sessions/retrieve?sdk_languages=go).

    - `type BetaManagedAgentsSessionActor`

      An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session.

      - `Type BetaManagedAgentsSessionActorType`

      - `SessionID string`

        ID of the session (a `sesn_...` value). Look up the session via [Retrieve a session](https://platform.claude.com/docs/en/api/beta/sessions/retrieve?sdk_languages=go) for further provenance.

        minLength: 1

    - `type BetaManagedAgentsAPIActor`

      A direct caller of the public API, identified by the API key that authenticated the request.

      - `Type BetaManagedAgentsAPIActorType`

      - `APIKeyID string`

        ID of the API key (an `apikey_...` value). This identifies the key, not the secret.

        minLength: 1

    - `type BetaManagedAgentsUserActor`

      A human user, for example acting through the Anthropic Console.

      - `Type BetaManagedAgentsUserActorType`

      - `UserID string`

        ID of the user (a `user_...` value).

        minLength: 1

    - `type BetaManagedAgentsServiceAccountActor`

      A workload authenticated as a service account, for example via Workload Identity Federation.

      - `Type ServiceAccountActor`

      - `ServiceAccountID string`

        ID of the service account (a `svac_...` value).

        minLength: 1

  - `Path string Optional`

    The memory's path at the time of this write. `null` if and only if `redacted_at` is set.

  - `RedactedAt Time Optional`

    When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/redact?sdk_languages=go).

    format: date-time

  - `RedactedBy BetaManagedAgentsActorUnion Optional`

    Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor`, `user_actor`, or `service_account_actor` (agents do not have a redact capability).

#### 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"),
	)
	betaManagedAgentsMemoryVersion, err := client.Beta.MemoryStores.MemoryVersions.Get(
		context.TODO(),
		"memory_version_id",
		anthropic.BetaMemoryStoreMemoryVersionGetParams{
			MemoryStoreID: "memory_store_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemoryVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "memory_id": "memory_id",
  "memory_store_id": "memory_store_id",
  "operation": "created",
  "type": "memory_version",
  "content": "content",
  "content_sha256": "content_sha256",
  "content_size_bytes": 0,
  "created_by": {
    "session_id": "x",
    "type": "session_actor"
  },
  "path": "path",
  "redacted_at": "2019-12-27T18:11:19.117Z",
  "redacted_by": {
    "session_id": "x",
    "type": "session_actor"
  }
}
```

### Redact a memory version

`client.Beta.MemoryStores.MemoryVersions.Redact(ctx, memoryVersionID, params) (*BetaManagedAgentsMemoryVersion, error)`

**POST** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact`

Redact a memory version

#### Parameters

- `memoryVersionID string` (path parameter)

  The ID of the memory version to redact (`memver_...`).

- `params BetaMemoryStoreMemoryVersionRedactParams`

  - `MemoryStoreID string` (path parameter)

    The ID of the memory store that holds the version (`memstore_...`).

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

    This endpoint is in beta: requests must send `agent-memory-2026-07-22` or `managed-agents-2026-04-01` in this header.

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

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

#### Returns

- `type BetaManagedAgentsMemoryVersion`

  A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and are not deleted with the memory; each version is retained for at least the version retention period after it was written, unless the store itself is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.

  - `Type BetaManagedAgentsMemoryVersionType`

  - `ID string`

    Unique identifier for this version (a `memver_...` value).

  - `CreatedAt Time`

    When this version was written, in RFC 3339 format.

    format: date-time

  - `MemoryID string`

    ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/list?sdk_languages=go) to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained.

  - `MemoryStoreID string`

    ID of the memory store this version belongs to (a `memstore_...` value).

  - `Operation BetaManagedAgentsMemoryVersionOperation`

    The kind of mutation this version records: `created`, `modified`, or `deleted`.

    - `const BetaManagedAgentsMemoryVersionOperationCreated BetaManagedAgentsMemoryVersionOperation = "created"`

      The memory was created. The first version in any memory's lineage.

    - `const BetaManagedAgentsMemoryVersionOperationModified BetaManagedAgentsMemoryVersionOperation = "modified"`

      The memory's `content`, `path`, or both were changed via update. Writes the agent makes through the filesystem mount also appear as `modified`.

    - `const BetaManagedAgentsMemoryVersionOperationDeleted BetaManagedAgentsMemoryVersionOperation = "deleted"`

      The memory was deleted. The `content`, `content_size_bytes`, and `content_sha256` fields are `null` on this version. The preceding version, while it is retained, records the deleted content's size and hash.

  - `Content string Optional`

    The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.

  - `ContentSha256 string Optional`

    Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.

  - `ContentSizeBytes int64 Optional`

    Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.

    format: int32

  - `CreatedBy BetaManagedAgentsActorUnion Optional`

    Who performed this write: one of `session_actor`, `api_actor`, `user_actor`, or `service_account_actor`; `null` when no writer is recorded. Captured at write time and preserved through redaction. A `session_actor` is an agent writing through the store's mounted filesystem at `/mnt/memory/`. The API key that created that session is not recorded on agent writes, so attribution names who made the write, not who is ultimately responsible; look up session provenance via the [Sessions API](https://platform.claude.com/docs/en/api/beta/sessions/retrieve?sdk_languages=go).

    - `type BetaManagedAgentsSessionActor`

      An agent acting during a session, for example through the session's mounted filesystem. It names the session itself, not the user or API key that started the session.

      - `Type BetaManagedAgentsSessionActorType`

      - `SessionID string`

        ID of the session (a `sesn_...` value). Look up the session via [Retrieve a session](https://platform.claude.com/docs/en/api/beta/sessions/retrieve?sdk_languages=go) for further provenance.

        minLength: 1

    - `type BetaManagedAgentsAPIActor`

      A direct caller of the public API, identified by the API key that authenticated the request.

      - `Type BetaManagedAgentsAPIActorType`

      - `APIKeyID string`

        ID of the API key (an `apikey_...` value). This identifies the key, not the secret.

        minLength: 1

    - `type BetaManagedAgentsUserActor`

      A human user, for example acting through the Anthropic Console.

      - `Type BetaManagedAgentsUserActorType`

      - `UserID string`

        ID of the user (a `user_...` value).

        minLength: 1

    - `type BetaManagedAgentsServiceAccountActor`

      A workload authenticated as a service account, for example via Workload Identity Federation.

      - `Type ServiceAccountActor`

      - `ServiceAccountID string`

        ID of the service account (a `svac_...` value).

        minLength: 1

  - `Path string Optional`

    The memory's path at the time of this write. `null` if and only if `redacted_at` is set.

  - `RedactedAt Time Optional`

    When this version was redacted, in RFC 3339 format, or `null` if it has not been redacted. When set, `content`, `path`, `content_size_bytes`, and `content_sha256` are all `null`. See [Redact a memory version](https://platform.claude.com/docs/en/api/beta/memory_stores/memory_versions/redact?sdk_languages=go).

    format: date-time

  - `RedactedBy BetaManagedAgentsActorUnion Optional`

    Who redacted this version, or `null` if it has not been redacted. In practice always an `api_actor`, `user_actor`, or `service_account_actor` (agents do not have a redact capability).

#### 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"),
	)
	betaManagedAgentsMemoryVersion, err := client.Beta.MemoryStores.MemoryVersions.Redact(
		context.TODO(),
		"memory_version_id",
		anthropic.BetaMemoryStoreMemoryVersionRedactParams{
			MemoryStoreID: "memory_store_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaManagedAgentsMemoryVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "memory_id": "memory_id",
  "memory_store_id": "memory_store_id",
  "operation": "created",
  "type": "memory_version",
  "content": "content",
  "content_sha256": "content_sha256",
  "content_size_bytes": 0,
  "created_by": {
    "session_id": "x",
    "type": "session_actor"
  },
  "path": "path",
  "redacted_at": "2019-12-27T18:11:19.117Z",
  "redacted_by": {
    "session_id": "x",
    "type": "session_actor"
  }
}
```

## Beta › Files

### Upload File

`client.Beta.Files.Upload(ctx, params) (*BetaFileMetadata, error)`

**POST** `/v1/files`

Upload File

#### Parameters

- `params BetaFileUploadParams`

  - `File Reader`

    The file to upload. Only the final path component of the part's `filename` is kept; an absent or empty `filename` is replaced with `unnamed` plus the extension for the file's stored `mime_type`, when known.

    format: binary

  - `ExpiresInSeconds param.Opt[int64] Optional`

    Seconds from upload until the file expires and its bytes become permanently unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).

    minimum: 3600, maximum: 7776000

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

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

#### Returns

- `type BetaFileMetadata`

  - `Type File`

    Object type.

    For files, this is always `"file"`.

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `CreatedAt Time`

    RFC 3339 datetime string representing when the file was created.

    format: date-time

  - `Filename string`

    Original filename of the uploaded file.

    minLength: 1, maxLength: 500

  - `MimeType string`

    MIME type of the file.

    minLength: 1, maxLength: 255

  - `SizeBytes int64`

    Size of the file in bytes.

    minimum: 0

  - `Downloadable bool Optional`

    Whether the file can be downloaded.

    default: false

  - `ExpiresAt Time Optional`

    RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.

    format: date-time

  - `Scope BetaFileScope Optional`

    The scope of this file, indicating the context in which it was created (e.g., a session).

    - `Type Session`

      The type of scope (e.g., `"session"`).

    - `ID string`

      The ID of the scoping resource (e.g., the session ID).

#### Example

```go
package main

import (
	"bytes"
	"context"
	"fmt"
	"io"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaFileMetadata, err := client.Beta.Files.Upload(context.TODO(), anthropic.BetaFileUploadParams{
		File: io.Reader(bytes.NewBuffer([]byte("Example data"))),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFileMetadata.ID)
}
```

##### Response (200)

```json
{
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "created_at": "2025-04-15T18:37:24.100435Z",
  "filename": "document.pdf",
  "mime_type": "application/pdf",
  "size_bytes": 102400,
  "type": "file",
  "downloadable": false,
  "expires_at": "2025-05-15T18:37:24.100435Z",
  "scope": {
    "id": "id",
    "type": "session"
  }
}
```

### List Files

`client.Beta.Files.List(ctx, params) (*PageCursor[BetaFileMetadata], error)`

**GET** `/v1/files`

List Files

#### Parameters

- `params BetaFileListParams`

  - `IDs []string Optional` (query parameter)

    Restrict the result set to Files whose `id` is in this list. At most 100 entries (after de-duplication). Mutually exclusive with `page` and `limit`. When supplied, the response is always a single page (`next_page` is null). IDs that do not resolve to a visible File — including deleted Files — are silently omitted.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque page cursor returned in a prior list response's `next_page`. Prefixed `page_`.

  - `ScopeID param.Opt[string] Optional` (query parameter)

    Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).

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

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

#### Returns

- `type BetaFileMetadata`

  - `Type File`

    Object type.

    For files, this is always `"file"`.

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `CreatedAt Time`

    RFC 3339 datetime string representing when the file was created.

    format: date-time

  - `Filename string`

    Original filename of the uploaded file.

    minLength: 1, maxLength: 500

  - `MimeType string`

    MIME type of the file.

    minLength: 1, maxLength: 255

  - `SizeBytes int64`

    Size of the file in bytes.

    minimum: 0

  - `Downloadable bool Optional`

    Whether the file can be downloaded.

    default: false

  - `ExpiresAt Time Optional`

    RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.

    format: date-time

  - `Scope BetaFileScope Optional`

    The scope of this file, indicating the context in which it was created (e.g., a session).

    - `Type Session`

      The type of scope (e.g., `"session"`).

    - `ID string`

      The ID of the scoping resource (e.g., the session ID).

#### 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"),
	)
	page, err := client.Beta.Files.List(context.TODO(), anthropic.BetaFileListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "file_011CNha8iCJcU1wXNR6q4V8w",
      "created_at": "2025-04-15T18:37:24.100435Z",
      "filename": "document.pdf",
      "mime_type": "application/pdf",
      "size_bytes": 102400,
      "type": "file",
      "downloadable": false,
      "expires_at": "2025-05-15T18:37:24.100435Z",
      "scope": {
        "id": "id",
        "type": "session"
      }
    }
  ],
  "next_page": "next_page"
}
```

### Download File

`client.Beta.Files.Download(ctx, fileID, query) (*Response, error)`

**GET** `/v1/files/{file_id}/content`

Download File

#### Parameters

- `fileID string` (path parameter)

  ID of the File.

- `query BetaFileDownloadParams`

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

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

#### Returns

- `type BetaFileDownloadResponse interface{…}`

#### 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"),
	)
	response, err := client.Beta.Files.Download(
		context.TODO(),
		"file_id",
		anthropic.BetaFileDownloadParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response)
}
```

### Get File Metadata

`client.Beta.Files.GetMetadata(ctx, fileID, query) (*BetaFileMetadata, error)`

**GET** `/v1/files/{file_id}`

Get File Metadata

#### Parameters

- `fileID string` (path parameter)

  ID of the File.

- `query BetaFileGetMetadataParams`

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

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

#### Returns

- `type BetaFileMetadata`

  - `Type File`

    Object type.

    For files, this is always `"file"`.

  - `ID string`

    Unique object identifier.

    The format and length of IDs may change over time.

  - `CreatedAt Time`

    RFC 3339 datetime string representing when the file was created.

    format: date-time

  - `Filename string`

    Original filename of the uploaded file.

    minLength: 1, maxLength: 500

  - `MimeType string`

    MIME type of the file.

    minLength: 1, maxLength: 255

  - `SizeBytes int64`

    Size of the file in bytes.

    minimum: 0

  - `Downloadable bool Optional`

    Whether the file can be downloaded.

    default: false

  - `ExpiresAt Time Optional`

    RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value.

    format: date-time

  - `Scope BetaFileScope Optional`

    The scope of this file, indicating the context in which it was created (e.g., a session).

    - `Type Session`

      The type of scope (e.g., `"session"`).

    - `ID string`

      The ID of the scoping resource (e.g., the session ID).

#### 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"),
	)
	betaFileMetadata, err := client.Beta.Files.GetMetadata(
		context.TODO(),
		"file_id",
		anthropic.BetaFileGetMetadataParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFileMetadata.ID)
}
```

##### Response (200)

```json
{
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "created_at": "2025-04-15T18:37:24.100435Z",
  "filename": "document.pdf",
  "mime_type": "application/pdf",
  "size_bytes": 102400,
  "type": "file",
  "downloadable": false,
  "expires_at": "2025-05-15T18:37:24.100435Z",
  "scope": {
    "id": "id",
    "type": "session"
  }
}
```

### Delete File

`client.Beta.Files.Delete(ctx, fileID, body) (*BetaDeletedFile, error)`

**DELETE** `/v1/files/{file_id}`

Delete File

#### Parameters

- `fileID string` (path parameter)

  ID of the File.

- `body BetaFileDeleteParams`

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

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

#### Returns

- `type BetaDeletedFile`

  - `Type BetaDeletedFileType Optional`

    Deleted object type.

    For file deletion, this is always `"file_deleted"`.

    default: file_deleted

  - `ID string`

    ID of the deleted file.

#### 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"),
	)
	betaDeletedFile, err := client.Beta.Files.Delete(
		context.TODO(),
		"file_id",
		anthropic.BetaFileDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedFile.ID)
}
```

##### Response (200)

```json
{
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "type": "file_deleted"
}
```

## Beta › Skills

### Create Skill

`client.Beta.Skills.New(ctx, params) (*BetaSkill, error)`

**POST** `/v1/skills`

Create Skill

#### Parameters

- `params BetaSkillNewParams`

  - `Files []Reader`

    Files to upload for the skill.

    All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.

  - `DisplayName param.Opt[string] Optional`

    Human-readable, single-line label for the Skill. Maximum 255 characters.
    Always set: derived from the SKILL.md frontmatter `name` when omitted at
    creation. Not unique.

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

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

#### Returns

- `type BetaSkill`

  - `Type Skill`

    Object type.

    For Skills, this is always `"skill"`.

    default: skill

  - `ID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `CreatedAt Time`

    ISO 8601 timestamp of when the skill was created.

    format: date-time

  - `DisplayName string`

    Human-readable, single-line label for the Skill. Maximum 255 characters.
    Always set: derived from the SKILL.md frontmatter `name` when omitted at
    creation. Not unique.

  - `LatestVersionID string`

    ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version.

  - `Source BetaSkillSource`

    Where the Skill comes from.

    Possible values:

    * `"custom"`: authored by the platform user; private to their workspace
    * `"anthropic"`: published by Anthropic; shared and read-only
    * `"anthropic_example"`: Anthropic-published sample Skill
    * `"plugin"`: resolved from an installed plugin

    - `Type BetaSkillSourceType`

      Where the Skill comes from.

      Possible values:

      * `"custom"`: authored by the platform user; private to their workspace
      * `"anthropic"`: published by Anthropic; shared and read-only
      * `"anthropic_example"`: Anthropic-published sample Skill
      * `"plugin"`: resolved from an installed plugin

      - `const BetaSkillSourceTypeCustom BetaSkillSourceType = "custom"`

      - `const BetaSkillSourceTypeAnthropic BetaSkillSourceType = "anthropic"`

      - `const BetaSkillSourceTypeAnthropicExample BetaSkillSourceType = "anthropic_example"`

      - `const BetaSkillSourceTypePlugin BetaSkillSourceType = "plugin"`

  - `UpdatedAt Time`

    ISO 8601 timestamp of when the skill was last updated.

    format: date-time

#### Example

```go
package main

import (
	"bytes"
	"context"
	"fmt"
	"io"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaSkill, err := client.Beta.Skills.New(context.TODO(), anthropic.BetaSkillNewParams{
		Files: []io.Reader{io.Reader(bytes.NewBuffer([]byte("Example data")))},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSkill.ID)
}
```

##### Response (200)

```json
{
  "id": "skill_01JAbcdefghijklmnopqrstuvw",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "display_name",
  "latest_version_id": "latest_version_id",
  "source": {
    "type": "custom"
  },
  "type": "skill",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### List Skills

`client.Beta.Skills.List(ctx, params) (*PageCursor[BetaSkill], error)`

**GET** `/v1/skills`

List Skills

#### Parameters

- `params BetaSkillListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results to return per page.

    Ranges from `1` to `1000`. Defaults to `20`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Pagination token for fetching a specific page of results.

    Pass the value from a previous response's `next_page` field to get the next page of results.

  - `Source param.Opt[string] Optional` (query parameter)

    Filter skills by source.

    If provided, only skills from the specified source will be returned:

    * `"custom"`: only return user-created skills
    * `"anthropic"`: only return Anthropic-created skills

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

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

#### Returns

- `type BetaSkill`

  - `Type Skill`

    Object type.

    For Skills, this is always `"skill"`.

    default: skill

  - `ID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `CreatedAt Time`

    ISO 8601 timestamp of when the skill was created.

    format: date-time

  - `DisplayName string`

    Human-readable, single-line label for the Skill. Maximum 255 characters.
    Always set: derived from the SKILL.md frontmatter `name` when omitted at
    creation. Not unique.

  - `LatestVersionID string`

    ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version.

  - `Source BetaSkillSource`

    Where the Skill comes from.

    Possible values:

    * `"custom"`: authored by the platform user; private to their workspace
    * `"anthropic"`: published by Anthropic; shared and read-only
    * `"anthropic_example"`: Anthropic-published sample Skill
    * `"plugin"`: resolved from an installed plugin

    - `Type BetaSkillSourceType`

      Where the Skill comes from.

      Possible values:

      * `"custom"`: authored by the platform user; private to their workspace
      * `"anthropic"`: published by Anthropic; shared and read-only
      * `"anthropic_example"`: Anthropic-published sample Skill
      * `"plugin"`: resolved from an installed plugin

      - `const BetaSkillSourceTypeCustom BetaSkillSourceType = "custom"`

      - `const BetaSkillSourceTypeAnthropic BetaSkillSourceType = "anthropic"`

      - `const BetaSkillSourceTypeAnthropicExample BetaSkillSourceType = "anthropic_example"`

      - `const BetaSkillSourceTypePlugin BetaSkillSourceType = "plugin"`

  - `UpdatedAt Time`

    ISO 8601 timestamp of when the skill was last updated.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Skills.List(context.TODO(), anthropic.BetaSkillListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "skill_01JAbcdefghijklmnopqrstuvw",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "display_name": "display_name",
      "latest_version_id": "latest_version_id",
      "source": {
        "type": "custom"
      },
      "type": "skill",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "next_page": "next_page"
}
```

### Get Skill

`client.Beta.Skills.Get(ctx, skillID, query) (*BetaSkill, error)`

**GET** `/v1/skills/{skill_id}`

Get Skill

#### Parameters

- `skillID string` (path parameter)

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `query BetaSkillGetParams`

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

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

#### Returns

- `type BetaSkill`

  - `Type Skill`

    Object type.

    For Skills, this is always `"skill"`.

    default: skill

  - `ID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

  - `CreatedAt Time`

    ISO 8601 timestamp of when the skill was created.

    format: date-time

  - `DisplayName string`

    Human-readable, single-line label for the Skill. Maximum 255 characters.
    Always set: derived from the SKILL.md frontmatter `name` when omitted at
    creation. Not unique.

  - `LatestVersionID string`

    ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version.

  - `Source BetaSkillSource`

    Where the Skill comes from.

    Possible values:

    * `"custom"`: authored by the platform user; private to their workspace
    * `"anthropic"`: published by Anthropic; shared and read-only
    * `"anthropic_example"`: Anthropic-published sample Skill
    * `"plugin"`: resolved from an installed plugin

    - `Type BetaSkillSourceType`

      Where the Skill comes from.

      Possible values:

      * `"custom"`: authored by the platform user; private to their workspace
      * `"anthropic"`: published by Anthropic; shared and read-only
      * `"anthropic_example"`: Anthropic-published sample Skill
      * `"plugin"`: resolved from an installed plugin

      - `const BetaSkillSourceTypeCustom BetaSkillSourceType = "custom"`

      - `const BetaSkillSourceTypeAnthropic BetaSkillSourceType = "anthropic"`

      - `const BetaSkillSourceTypeAnthropicExample BetaSkillSourceType = "anthropic_example"`

      - `const BetaSkillSourceTypePlugin BetaSkillSourceType = "plugin"`

  - `UpdatedAt Time`

    ISO 8601 timestamp of when the skill was last updated.

    format: date-time

#### 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"),
	)
	betaSkill, err := client.Beta.Skills.Get(
		context.TODO(),
		"skill_id",
		anthropic.BetaSkillGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSkill.ID)
}
```

##### Response (200)

```json
{
  "id": "skill_01JAbcdefghijklmnopqrstuvw",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "display_name",
  "latest_version_id": "latest_version_id",
  "source": {
    "type": "custom"
  },
  "type": "skill",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Delete Skill

`client.Beta.Skills.Delete(ctx, skillID, body) (*BetaDeletedSkill, error)`

**DELETE** `/v1/skills/{skill_id}`

Delete Skill

#### Parameters

- `skillID string` (path parameter)

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `body BetaSkillDeleteParams`

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

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

#### Returns

- `type BetaDeletedSkill`

  - `Type SkillDeleted`

    Deleted object type.

    For Skills, this is always `"skill_deleted"`.

    default: skill_deleted

  - `ID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

#### 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"),
	)
	betaDeletedSkill, err := client.Beta.Skills.Delete(
		context.TODO(),
		"skill_id",
		anthropic.BetaSkillDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedSkill.ID)
}
```

##### Response (200)

```json
{
  "id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_deleted"
}
```

## Beta › Skills › Versions

### Create Skill Version

`client.Beta.Skills.Versions.New(ctx, skillID, params) (*BetaSkillVersion, error)`

**POST** `/v1/skills/{skill_id}/versions`

Create Skill Version

#### Parameters

- `skillID string` (path parameter)

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `params BetaSkillVersionNewParams`

  - `Files []Reader`

    Files to upload for the skill.

    All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.

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

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

#### Returns

- `type BetaSkillVersion`

  - `Type SkillVersion`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    default: skill_version

  - `ID string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `CreatedAt Time`

    ISO 8601 timestamp of when the skill was created.

    format: date-time

  - `Description string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `Name string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `SkillID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

#### Example

```go
package main

import (
	"bytes"
	"context"
	"fmt"
	"io"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaSkillVersion, err := client.Beta.Skills.Versions.New(
		context.TODO(),
		"skill_id",
		anthropic.BetaSkillVersionNewParams{
			Files: []io.Reader{io.Reader(bytes.NewBuffer([]byte("Example data")))},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSkillVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "description": "description",
  "name": "name",
  "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_version"
}
```

### List Skill Versions

`client.Beta.Skills.Versions.List(ctx, skillID, params) (*PageCursor[BetaSkillVersion], error)`

**GET** `/v1/skills/{skill_id}/versions`

List Skill Versions

#### Parameters

- `skillID string` (path parameter)

  Unique identifier for the skill.

  The format and length of IDs may change over time.

- `params BetaSkillVersionListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results to return per page.

    Ranges from `1` to `1000`. Defaults to `20`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

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

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

#### Returns

- `type BetaSkillVersion`

  - `Type SkillVersion`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    default: skill_version

  - `ID string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `CreatedAt Time`

    ISO 8601 timestamp of when the skill was created.

    format: date-time

  - `Description string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `Name string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `SkillID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

#### 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"),
	)
	page, err := client.Beta.Skills.Versions.List(
		context.TODO(),
		"skill_id",
		anthropic.BetaSkillVersionListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "description": "description",
      "name": "name",
      "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
      "type": "skill_version"
    }
  ],
  "next_page": "next_page"
}
```

### Download Skill Version Content

`client.Beta.Skills.Versions.Download(ctx, version, params) (*Response, error)`

**GET** `/v1/skills/{skill_id}/versions/{version}/content`

Download a skill version's content as a zip archive.

#### Parameters

- `version string` (path parameter)

  Identifies the skill version by its version ID.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

- `params BetaSkillVersionDownloadParams`

  - `SkillID string` (path parameter)

    Unique identifier for the skill.

    The format and length of IDs may change over time.

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

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

#### Returns

- `type BetaSkillVersionDownloadResponse interface{…}`

#### 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"),
	)
	response, err := client.Beta.Skills.Versions.Download(
		context.TODO(),
		"version",
		anthropic.BetaSkillVersionDownloadParams{
			SkillID: "skill_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response)
}
```

### Get Skill Version

`client.Beta.Skills.Versions.Get(ctx, version, params) (*BetaSkillVersion, error)`

**GET** `/v1/skills/{skill_id}/versions/{version}`

Get Skill Version

#### Parameters

- `version string` (path parameter)

  Identifies the skill version: a version ID, or the literal `latest` for the skill's most recent version.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

- `params BetaSkillVersionGetParams`

  - `SkillID string` (path parameter)

    Unique identifier for the skill.

    The format and length of IDs may change over time.

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

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

#### Returns

- `type BetaSkillVersion`

  - `Type SkillVersion`

    Object type.

    For Skill Versions, this is always `"skill_version"`.

    default: skill_version

  - `ID string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

  - `CreatedAt Time`

    ISO 8601 timestamp of when the skill was created.

    format: date-time

  - `Description string`

    Description of the skill version.

    This is extracted from the SKILL.md file in the skill upload.

  - `Name string`

    The Skill's immutable kebab-case slug, set at creation from the first
    upload's SKILL.md frontmatter `name` (or its enclosing directory). Every
    later upload must resolve to the same value. Also the top-level directory
    of the Skill's mounted files and the base name of a downloaded archive.

  - `SkillID string`

    Unique identifier for the skill.

    The format and length of IDs may change over time.

#### 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"),
	)
	betaSkillVersion, err := client.Beta.Skills.Versions.Get(
		context.TODO(),
		"version",
		anthropic.BetaSkillVersionGetParams{
			SkillID: "skill_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSkillVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "description": "description",
  "name": "name",
  "skill_id": "skill_01JAbcdefghijklmnopqrstuvw",
  "type": "skill_version"
}
```

### Delete Skill Version

`client.Beta.Skills.Versions.Delete(ctx, version, params) (*BetaDeletedSkillVersion, error)`

**DELETE** `/v1/skills/{skill_id}/versions/{version}`

Delete Skill Version

#### Parameters

- `version string` (path parameter)

  Identifies the skill version by its version ID.

  Requests carrying the `skills-2025-10-02` beta header address versions by their Unix epoch timestamp instead (e.g., "1759178010641129").

- `params BetaSkillVersionDeleteParams`

  - `SkillID string` (path parameter)

    Unique identifier for the skill.

    The format and length of IDs may change over time.

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

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

#### Returns

- `type BetaDeletedSkillVersion`

  - `Type SkillVersionDeleted`

    Deleted object type.

    For Skill Versions, this is always `"skill_version_deleted"`.

    default: skill_version_deleted

  - `ID string`

    Unique identifier for this Skill Version. The id addresses the version in
    paths and pins it in references.

#### 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"),
	)
	betaDeletedSkillVersion, err := client.Beta.Skills.Versions.Delete(
		context.TODO(),
		"version",
		anthropic.BetaSkillVersionDeleteParams{
			SkillID: "skill_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedSkillVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "type": "skill_version_deleted"
}
```

## Beta › User Profiles

### Create User Profile

`client.Beta.UserProfiles.New(ctx, params) (*BetaUserProfile, error)`

**POST** `/v1/user_profiles`

Create User Profile

#### Parameters

- `params BetaUserProfileNewParams`

  - `AccessType BetaUserProfileNewParamsAccessType Optional`

    How the platform uses the API for this entity. `application` (default): the profile represents an individual end-user of the platform's product. `passthrough`: the profile identifies a company the platform resells Claude access to.

    - `const BetaUserProfileNewParamsAccessTypeApplication BetaUserProfileNewParamsAccessType = "application"`

      The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default.

    - `const BetaUserProfileNewParamsAccessTypePassthrough BetaUserProfileNewParamsAccessType = "passthrough"`

      The user profile represents a company that the platform resells Claude access to.

  - `ExternalID param.Opt[string] Optional`

    Platform's own identifier for this user. Not enforced unique. Maximum 255 characters. Accepted under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` send `external_user_details.reference_id` instead.

    minLength: 1, maxLength: 255

  - `ExternalUserDetails BetaUserProfileExternalUserDetailsParams Optional`

    Details about the entity this profile represents, as the platform states them. Every field is optional. Accepted under the `user-profiles-2026-09-04` beta header only.

  - `ExternalUserOnboardedAt param.Opt[Time] Optional`

    When the entity this profile represents opened its account with the platform, in RFC 3339 format: for an `application` profile, when the end-user signed up; for a `passthrough` profile, when the company became the platform's customer. Must be a complete timestamp no more than 1 minute in the future. Optional. Accepted under the `user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` send `external_user_details.onboarded_at` instead.

    format: date-time

  - `Metadata map[string, string] Optional`

    Free-form key-value data to attach to this user profile. Maximum 16 keys, with keys up to 64 characters and values up to 512 characters. Values must be non-empty strings.

  - `Name param.Opt[string] Optional`

    Optional for all profiles. Real-world name of the entity this profile represents (company or individual); for a company the platform resells Claude access to (`access_type` `passthrough`), that company's name where known. Maximum 255 characters.

    minLength: 1, maxLength: 255

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

    This endpoint is in beta: requests must send `user-profiles-2026-03-24`, `user-profiles-2026-08-18`, or `user-profiles-2026-09-04` in this header.

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

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

#### Returns

- `type BetaUserProfile`

  A record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.

  A Messages, Message Batches or token counting request can send a profile's `id` in the `anthropic-user-profile-id` header to attribute the request to that entity.

  - `Type BetaUserProfileType`

    Object type. Always `user_profile`.

  - `ID string`

    Unique identifier for this user profile, prefixed `uprof_`.

  - `CreatedAt Time`

    When this user profile was created, in RFC 3339 format.

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `TrustGrants map[string, BetaUserProfileTrustGrant]`

    Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.

    - `Status BetaUserProfileTrustGrantStatus`

      Status of the trust grant.

      - `const BetaUserProfileTrustGrantStatusActive BetaUserProfileTrustGrantStatus = "active"`

      - `const BetaUserProfileTrustGrantStatusPending BetaUserProfileTrustGrantStatus = "pending"`

      - `const BetaUserProfileTrustGrantStatusRejected BetaUserProfileTrustGrantStatus = "rejected"`

  - `UpdatedAt Time`

    When this user profile was last modified, in RFC 3339 format. Trust-grant status changes also bump this timestamp.

    format: date-time

  - `AccessType BetaUserProfileAccessType Optional`

    How the platform uses the API for this entity: `application` (default) or `passthrough`. Present under the `user-profiles-2026-08-18` and later beta headers.

    - `const BetaUserProfileAccessTypeApplication BetaUserProfileAccessType = "application"`

      The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default.

    - `const BetaUserProfileAccessTypePassthrough BetaUserProfileAccessType = "passthrough"`

      The user profile represents a company that the platform resells Claude access to.

  - `ExternalID string Optional`

    Platform's own identifier for this user. Not enforced unique. Present under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` the value is `external_user_details.reference_id`.

  - `ExternalUserDetails BetaUserProfileExternalUserDetails Optional`

    Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Present under the `user-profiles-2026-09-04` beta header, with every field present and `null` until the platform supplies a value; the earlier beta headers serve `reference_id` as the top-level `external_id`, and `user-profiles-2026-08-18` serves `onboarded_at` as `external_user_onboarded_at`.

    - `AccountStatus BetaUserProfileExternalUserDetailsAccountStatus`

      The status of the entity's account on the platform: `active`, `suspended` or `blocked`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsAccountStatusActive BetaUserProfileExternalUserDetailsAccountStatus = "active"`

        The platform has neither restricted nor barred the account of the entity that the user profile represents.

      - `const BetaUserProfileExternalUserDetailsAccountStatusSuspended BetaUserProfileExternalUserDetailsAccountStatus = "suspended"`

        The platform has restricted the account of the entity that the user profile represents and may restore it.

      - `const BetaUserProfileExternalUserDetailsAccountStatusBlocked BetaUserProfileExternalUserDetailsAccountStatus = "blocked"`

        The platform has barred the account of the entity that the user profile represents.

    - `Country string`

      The country the platform associates with the entity, as an ISO 3166-1 alpha-2 code. `null` until the platform supplies one.

    - `EmailHash string`

      The platform-computed hash of the entity's email address. `null` until the platform supplies one.

    - `EntityType BetaUserProfileExternalUserDetailsEntityType`

      What kind of entity the profile represents: `individual`, `business`, `non_profit` or `government`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsEntityTypeIndividual BetaUserProfileExternalUserDetailsEntityType = "individual"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeBusiness BetaUserProfileExternalUserDetailsEntityType = "business"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeNonProfit BetaUserProfileExternalUserDetailsEntityType = "non_profit"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeGovernment BetaUserProfileExternalUserDetailsEntityType = "government"`

    - `NameHash string`

      The platform-computed hash of the entity's name. `null` until the platform supplies one.

    - `OnboardedAt Time`

      When the entity opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one.

      format: date-time

    - `ReferenceID string`

      The platform's own reference for the entity. `null` until the platform supplies one.

  - `ExternalUserOnboardedAt Time Optional`

    When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one. Present under the `user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` the value is `external_user_details.onboarded_at`.

    format: date-time

  - `Name string Optional`

    Real-world name of the entity this profile represents (company or individual). For a company the platform resells Claude access to (`access_type` `passthrough`) this is that company's name.

#### 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"),
	)
	betaUserProfile, err := client.Beta.UserProfiles.New(context.TODO(), anthropic.BetaUserProfileNewParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaUserProfile.ID)
}
```

##### Response (200)

```json
{
  "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {},
  "trust_grants": {
    "cyber": {
      "status": "active"
    }
  },
  "type": "user_profile",
  "updated_at": "2026-03-15T10:00:00Z",
  "access_type": "application",
  "external_id": "user_12345",
  "external_user_details": {
    "account_status": "active",
    "country": "country",
    "email_hash": "email_hash",
    "entity_type": "individual",
    "name_hash": "name_hash",
    "onboarded_at": "2019-12-27T18:11:19.117Z",
    "reference_id": "reference_id"
  },
  "external_user_onboarded_at": "2024-11-02T08:15:00Z",
  "name": "Example User"
}
```

### List User Profiles

`client.Beta.UserProfiles.List(ctx, params) (*PageCursor[BetaUserProfile], error)`

**GET** `/v1/user_profiles`

List User Profiles

#### Parameters

- `params BetaUserProfileListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    The maximum number of user profiles to return, from 1 to 100. Defaults to 20.

    format: int32

  - `Order BetaUserProfileListParamsOrder Optional` (query parameter)

    The sort direction, applied to the field that `order_by` selects. Defaults to `desc`.

    - `const BetaUserProfileListParamsOrderAsc BetaUserProfileListParamsOrder = "asc"`

      Oldest first when `order_by` is `created_at`, or names in ascending order when `order_by` is `name`.

    - `const BetaUserProfileListParamsOrderDesc BetaUserProfileListParamsOrder = "desc"`

      Newest first when `order_by` is `created_at`, or names in descending order when `order_by` is `name`. This is the default.

  - `OrderBy BetaUserProfileListParamsOrderBy Optional` (query parameter)

    The field to sort user profiles by, in the direction that `order` sets. Defaults to `created_at`.

    - `const BetaUserProfileListParamsOrderByCreatedAt BetaUserProfileListParamsOrderBy = "created_at"`

      Sort by when each user profile was created. This is the default.

    - `const BetaUserProfileListParamsOrderByName BetaUserProfileListParamsOrderBy = "name"`

      Sort by `name`, ignoring the case of ASCII letters. Profiles without a name come last in either direction.

  - `Page param.Opt[string] Optional` (query parameter)

    The cursor for the page to return, taken from `next_page` in a previous response.

    Leave it out to get the first page.

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

    This endpoint is in beta: requests must send `user-profiles-2026-03-24`, `user-profiles-2026-08-18`, or `user-profiles-2026-09-04` in this header.

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

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

#### Returns

- `type BetaUserProfile`

  A record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.

  A Messages, Message Batches or token counting request can send a profile's `id` in the `anthropic-user-profile-id` header to attribute the request to that entity.

  - `Type BetaUserProfileType`

    Object type. Always `user_profile`.

  - `ID string`

    Unique identifier for this user profile, prefixed `uprof_`.

  - `CreatedAt Time`

    When this user profile was created, in RFC 3339 format.

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `TrustGrants map[string, BetaUserProfileTrustGrant]`

    Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.

    - `Status BetaUserProfileTrustGrantStatus`

      Status of the trust grant.

      - `const BetaUserProfileTrustGrantStatusActive BetaUserProfileTrustGrantStatus = "active"`

      - `const BetaUserProfileTrustGrantStatusPending BetaUserProfileTrustGrantStatus = "pending"`

      - `const BetaUserProfileTrustGrantStatusRejected BetaUserProfileTrustGrantStatus = "rejected"`

  - `UpdatedAt Time`

    When this user profile was last modified, in RFC 3339 format. Trust-grant status changes also bump this timestamp.

    format: date-time

  - `AccessType BetaUserProfileAccessType Optional`

    How the platform uses the API for this entity: `application` (default) or `passthrough`. Present under the `user-profiles-2026-08-18` and later beta headers.

    - `const BetaUserProfileAccessTypeApplication BetaUserProfileAccessType = "application"`

      The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default.

    - `const BetaUserProfileAccessTypePassthrough BetaUserProfileAccessType = "passthrough"`

      The user profile represents a company that the platform resells Claude access to.

  - `ExternalID string Optional`

    Platform's own identifier for this user. Not enforced unique. Present under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` the value is `external_user_details.reference_id`.

  - `ExternalUserDetails BetaUserProfileExternalUserDetails Optional`

    Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Present under the `user-profiles-2026-09-04` beta header, with every field present and `null` until the platform supplies a value; the earlier beta headers serve `reference_id` as the top-level `external_id`, and `user-profiles-2026-08-18` serves `onboarded_at` as `external_user_onboarded_at`.

    - `AccountStatus BetaUserProfileExternalUserDetailsAccountStatus`

      The status of the entity's account on the platform: `active`, `suspended` or `blocked`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsAccountStatusActive BetaUserProfileExternalUserDetailsAccountStatus = "active"`

        The platform has neither restricted nor barred the account of the entity that the user profile represents.

      - `const BetaUserProfileExternalUserDetailsAccountStatusSuspended BetaUserProfileExternalUserDetailsAccountStatus = "suspended"`

        The platform has restricted the account of the entity that the user profile represents and may restore it.

      - `const BetaUserProfileExternalUserDetailsAccountStatusBlocked BetaUserProfileExternalUserDetailsAccountStatus = "blocked"`

        The platform has barred the account of the entity that the user profile represents.

    - `Country string`

      The country the platform associates with the entity, as an ISO 3166-1 alpha-2 code. `null` until the platform supplies one.

    - `EmailHash string`

      The platform-computed hash of the entity's email address. `null` until the platform supplies one.

    - `EntityType BetaUserProfileExternalUserDetailsEntityType`

      What kind of entity the profile represents: `individual`, `business`, `non_profit` or `government`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsEntityTypeIndividual BetaUserProfileExternalUserDetailsEntityType = "individual"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeBusiness BetaUserProfileExternalUserDetailsEntityType = "business"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeNonProfit BetaUserProfileExternalUserDetailsEntityType = "non_profit"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeGovernment BetaUserProfileExternalUserDetailsEntityType = "government"`

    - `NameHash string`

      The platform-computed hash of the entity's name. `null` until the platform supplies one.

    - `OnboardedAt Time`

      When the entity opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one.

      format: date-time

    - `ReferenceID string`

      The platform's own reference for the entity. `null` until the platform supplies one.

  - `ExternalUserOnboardedAt Time Optional`

    When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one. Present under the `user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` the value is `external_user_details.onboarded_at`.

    format: date-time

  - `Name string Optional`

    Real-world name of the entity this profile represents (company or individual). For a company the platform resells Claude access to (`access_type` `passthrough`) this is that company's name.

#### 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"),
	)
	page, err := client.Beta.UserProfiles.List(context.TODO(), anthropic.BetaUserProfileListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
      "created_at": "2026-03-15T10:00:00Z",
      "metadata": {},
      "trust_grants": {
        "cyber": {
          "status": "active"
        }
      },
      "type": "user_profile",
      "updated_at": "2026-03-15T10:00:00Z",
      "access_type": "application",
      "external_id": "user_12345",
      "external_user_details": {
        "account_status": "active",
        "country": "country",
        "email_hash": "email_hash",
        "entity_type": "individual",
        "name_hash": "name_hash",
        "onboarded_at": "2019-12-27T18:11:19.117Z",
        "reference_id": "reference_id"
      },
      "external_user_onboarded_at": "2024-11-02T08:15:00Z",
      "name": "Example User"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

### Get User Profile

`client.Beta.UserProfiles.Get(ctx, userProfileID, query) (*BetaUserProfile, error)`

**GET** `/v1/user_profiles/{user_profile_id}`

Get User Profile

#### Parameters

- `userProfileID string` (path parameter)

  The ID of the user profile to get (`uprof_...`).

- `query BetaUserProfileGetParams`

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

    This endpoint is in beta: requests must send `user-profiles-2026-03-24`, `user-profiles-2026-08-18`, or `user-profiles-2026-09-04` in this header.

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

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

#### Returns

- `type BetaUserProfile`

  A record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.

  A Messages, Message Batches or token counting request can send a profile's `id` in the `anthropic-user-profile-id` header to attribute the request to that entity.

  - `Type BetaUserProfileType`

    Object type. Always `user_profile`.

  - `ID string`

    Unique identifier for this user profile, prefixed `uprof_`.

  - `CreatedAt Time`

    When this user profile was created, in RFC 3339 format.

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `TrustGrants map[string, BetaUserProfileTrustGrant]`

    Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.

    - `Status BetaUserProfileTrustGrantStatus`

      Status of the trust grant.

      - `const BetaUserProfileTrustGrantStatusActive BetaUserProfileTrustGrantStatus = "active"`

      - `const BetaUserProfileTrustGrantStatusPending BetaUserProfileTrustGrantStatus = "pending"`

      - `const BetaUserProfileTrustGrantStatusRejected BetaUserProfileTrustGrantStatus = "rejected"`

  - `UpdatedAt Time`

    When this user profile was last modified, in RFC 3339 format. Trust-grant status changes also bump this timestamp.

    format: date-time

  - `AccessType BetaUserProfileAccessType Optional`

    How the platform uses the API for this entity: `application` (default) or `passthrough`. Present under the `user-profiles-2026-08-18` and later beta headers.

    - `const BetaUserProfileAccessTypeApplication BetaUserProfileAccessType = "application"`

      The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default.

    - `const BetaUserProfileAccessTypePassthrough BetaUserProfileAccessType = "passthrough"`

      The user profile represents a company that the platform resells Claude access to.

  - `ExternalID string Optional`

    Platform's own identifier for this user. Not enforced unique. Present under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` the value is `external_user_details.reference_id`.

  - `ExternalUserDetails BetaUserProfileExternalUserDetails Optional`

    Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Present under the `user-profiles-2026-09-04` beta header, with every field present and `null` until the platform supplies a value; the earlier beta headers serve `reference_id` as the top-level `external_id`, and `user-profiles-2026-08-18` serves `onboarded_at` as `external_user_onboarded_at`.

    - `AccountStatus BetaUserProfileExternalUserDetailsAccountStatus`

      The status of the entity's account on the platform: `active`, `suspended` or `blocked`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsAccountStatusActive BetaUserProfileExternalUserDetailsAccountStatus = "active"`

        The platform has neither restricted nor barred the account of the entity that the user profile represents.

      - `const BetaUserProfileExternalUserDetailsAccountStatusSuspended BetaUserProfileExternalUserDetailsAccountStatus = "suspended"`

        The platform has restricted the account of the entity that the user profile represents and may restore it.

      - `const BetaUserProfileExternalUserDetailsAccountStatusBlocked BetaUserProfileExternalUserDetailsAccountStatus = "blocked"`

        The platform has barred the account of the entity that the user profile represents.

    - `Country string`

      The country the platform associates with the entity, as an ISO 3166-1 alpha-2 code. `null` until the platform supplies one.

    - `EmailHash string`

      The platform-computed hash of the entity's email address. `null` until the platform supplies one.

    - `EntityType BetaUserProfileExternalUserDetailsEntityType`

      What kind of entity the profile represents: `individual`, `business`, `non_profit` or `government`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsEntityTypeIndividual BetaUserProfileExternalUserDetailsEntityType = "individual"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeBusiness BetaUserProfileExternalUserDetailsEntityType = "business"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeNonProfit BetaUserProfileExternalUserDetailsEntityType = "non_profit"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeGovernment BetaUserProfileExternalUserDetailsEntityType = "government"`

    - `NameHash string`

      The platform-computed hash of the entity's name. `null` until the platform supplies one.

    - `OnboardedAt Time`

      When the entity opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one.

      format: date-time

    - `ReferenceID string`

      The platform's own reference for the entity. `null` until the platform supplies one.

  - `ExternalUserOnboardedAt Time Optional`

    When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one. Present under the `user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` the value is `external_user_details.onboarded_at`.

    format: date-time

  - `Name string Optional`

    Real-world name of the entity this profile represents (company or individual). For a company the platform resells Claude access to (`access_type` `passthrough`) this is that company's name.

#### 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"),
	)
	betaUserProfile, err := client.Beta.UserProfiles.Get(
		context.TODO(),
		"uprof_011CZkZCu8hGbp5mYRQgUmz9",
		anthropic.BetaUserProfileGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaUserProfile.ID)
}
```

##### Response (200)

```json
{
  "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {},
  "trust_grants": {
    "cyber": {
      "status": "active"
    }
  },
  "type": "user_profile",
  "updated_at": "2026-03-15T10:00:00Z",
  "access_type": "application",
  "external_id": "user_12345",
  "external_user_details": {
    "account_status": "active",
    "country": "country",
    "email_hash": "email_hash",
    "entity_type": "individual",
    "name_hash": "name_hash",
    "onboarded_at": "2019-12-27T18:11:19.117Z",
    "reference_id": "reference_id"
  },
  "external_user_onboarded_at": "2024-11-02T08:15:00Z",
  "name": "Example User"
}
```

### Update User Profile

`client.Beta.UserProfiles.Update(ctx, userProfileID, params) (*BetaUserProfile, error)`

**POST** `/v1/user_profiles/{user_profile_id}`

Update User Profile

#### Parameters

- `userProfileID string` (path parameter)

  The ID of the user profile to update (`uprof_...`).

- `params BetaUserProfileUpdateParams`

  - `AccessType BetaUserProfileUpdateParamsAccessType Optional`

    If present, replaces the stored access type. Omit to leave unchanged.

    - `const BetaUserProfileUpdateParamsAccessTypeApplication BetaUserProfileUpdateParamsAccessType = "application"`

      The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default.

    - `const BetaUserProfileUpdateParamsAccessTypePassthrough BetaUserProfileUpdateParamsAccessType = "passthrough"`

      The user profile represents a company that the platform resells Claude access to.

  - `ExternalID param.Opt[string] Optional`

    If present, replaces the stored external_id. Omit to leave unchanged. Maximum 255 characters. Accepted under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` send `external_user_details.reference_id` instead.

    minLength: 1, maxLength: 255

  - `ExternalUserDetails BetaUserProfileExternalUserDetailsParams Optional`

    Details about the entity this profile represents, as the platform states them. Each field sent replaces the stored value; omit a field to leave it unchanged. Once set, a value cannot be cleared and `null` is rejected. Accepted under the `user-profiles-2026-09-04` beta header only.

  - `ExternalUserOnboardedAt param.Opt[Time] Optional`

    If present, replaces the stored account creation time. Omit to leave unchanged; once set, the value cannot be cleared and `null` is rejected. Must be a complete RFC 3339 timestamp no more than 1 minute in the future. Accepted under the `user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` send `external_user_details.onboarded_at` instead.

    format: date-time

  - `Metadata map[string, string] Optional`

    Key-value pairs to merge into the stored metadata. Keys provided overwrite existing values. To remove a key, set its value to an empty string. Keys not provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and values up to 512 characters.

  - `Name param.Opt[string] Optional`

    If present, replaces the stored name. Omit to leave unchanged. Maximum 255 characters.

    minLength: 1, maxLength: 255

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

    This endpoint is in beta: requests must send `user-profiles-2026-03-24`, `user-profiles-2026-08-18`, or `user-profiles-2026-09-04` in this header.

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

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

#### Returns

- `type BetaUserProfile`

  A record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.

  A Messages, Message Batches or token counting request can send a profile's `id` in the `anthropic-user-profile-id` header to attribute the request to that entity.

  - `Type BetaUserProfileType`

    Object type. Always `user_profile`.

  - `ID string`

    Unique identifier for this user profile, prefixed `uprof_`.

  - `CreatedAt Time`

    When this user profile was created, in RFC 3339 format.

    format: date-time

  - `Metadata map[string, string]`

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

  - `TrustGrants map[string, BetaUserProfileTrustGrant]`

    Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.

    - `Status BetaUserProfileTrustGrantStatus`

      Status of the trust grant.

      - `const BetaUserProfileTrustGrantStatusActive BetaUserProfileTrustGrantStatus = "active"`

      - `const BetaUserProfileTrustGrantStatusPending BetaUserProfileTrustGrantStatus = "pending"`

      - `const BetaUserProfileTrustGrantStatusRejected BetaUserProfileTrustGrantStatus = "rejected"`

  - `UpdatedAt Time`

    When this user profile was last modified, in RFC 3339 format. Trust-grant status changes also bump this timestamp.

    format: date-time

  - `AccessType BetaUserProfileAccessType Optional`

    How the platform uses the API for this entity: `application` (default) or `passthrough`. Present under the `user-profiles-2026-08-18` and later beta headers.

    - `const BetaUserProfileAccessTypeApplication BetaUserProfileAccessType = "application"`

      The user profile represents an individual end-user of a product that the platform builds on the API. New profiles get this value by default.

    - `const BetaUserProfileAccessTypePassthrough BetaUserProfileAccessType = "passthrough"`

      The user profile represents a company that the platform resells Claude access to.

  - `ExternalID string Optional`

    Platform's own identifier for this user. Not enforced unique. Present under the `user-profiles-2026-03-24` and `user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` the value is `external_user_details.reference_id`.

  - `ExternalUserDetails BetaUserProfileExternalUserDetails Optional`

    Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Present under the `user-profiles-2026-09-04` beta header, with every field present and `null` until the platform supplies a value; the earlier beta headers serve `reference_id` as the top-level `external_id`, and `user-profiles-2026-08-18` serves `onboarded_at` as `external_user_onboarded_at`.

    - `AccountStatus BetaUserProfileExternalUserDetailsAccountStatus`

      The status of the entity's account on the platform: `active`, `suspended` or `blocked`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsAccountStatusActive BetaUserProfileExternalUserDetailsAccountStatus = "active"`

        The platform has neither restricted nor barred the account of the entity that the user profile represents.

      - `const BetaUserProfileExternalUserDetailsAccountStatusSuspended BetaUserProfileExternalUserDetailsAccountStatus = "suspended"`

        The platform has restricted the account of the entity that the user profile represents and may restore it.

      - `const BetaUserProfileExternalUserDetailsAccountStatusBlocked BetaUserProfileExternalUserDetailsAccountStatus = "blocked"`

        The platform has barred the account of the entity that the user profile represents.

    - `Country string`

      The country the platform associates with the entity, as an ISO 3166-1 alpha-2 code. `null` until the platform supplies one.

    - `EmailHash string`

      The platform-computed hash of the entity's email address. `null` until the platform supplies one.

    - `EntityType BetaUserProfileExternalUserDetailsEntityType`

      What kind of entity the profile represents: `individual`, `business`, `non_profit` or `government`. `null` until the platform supplies one.

      - `const BetaUserProfileExternalUserDetailsEntityTypeIndividual BetaUserProfileExternalUserDetailsEntityType = "individual"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeBusiness BetaUserProfileExternalUserDetailsEntityType = "business"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeNonProfit BetaUserProfileExternalUserDetailsEntityType = "non_profit"`

      - `const BetaUserProfileExternalUserDetailsEntityTypeGovernment BetaUserProfileExternalUserDetailsEntityType = "government"`

    - `NameHash string`

      The platform-computed hash of the entity's name. `null` until the platform supplies one.

    - `OnboardedAt Time`

      When the entity opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one.

      format: date-time

    - `ReferenceID string`

      The platform's own reference for the entity. `null` until the platform supplies one.

  - `ExternalUserOnboardedAt Time Optional`

    When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). `null` until the platform supplies one. Present under the `user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` the value is `external_user_details.onboarded_at`.

    format: date-time

  - `Name string Optional`

    Real-world name of the entity this profile represents (company or individual). For a company the platform resells Claude access to (`access_type` `passthrough`) this is that company's name.

#### 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"),
	)
	betaUserProfile, err := client.Beta.UserProfiles.Update(
		context.TODO(),
		"uprof_011CZkZCu8hGbp5mYRQgUmz9",
		anthropic.BetaUserProfileUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaUserProfile.ID)
}
```

##### Response (200)

```json
{
  "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "created_at": "2026-03-15T10:00:00Z",
  "metadata": {},
  "trust_grants": {
    "cyber": {
      "status": "active"
    }
  },
  "type": "user_profile",
  "updated_at": "2026-03-15T10:00:00Z",
  "access_type": "application",
  "external_id": "user_12345",
  "external_user_details": {
    "account_status": "active",
    "country": "country",
    "email_hash": "email_hash",
    "entity_type": "individual",
    "name_hash": "name_hash",
    "onboarded_at": "2019-12-27T18:11:19.117Z",
    "reference_id": "reference_id"
  },
  "external_user_onboarded_at": "2024-11-02T08:15:00Z",
  "name": "Example User"
}
```

### Create Enrollment URL

`client.Beta.UserProfiles.NewEnrollmentURL(ctx, userProfileID, body) (*BetaUserProfileEnrollmentURL, error)`

**POST** `/v1/user_profiles/{user_profile_id}/enrollment_url`

Create Enrollment URL

#### Parameters

- `userProfileID string` (path parameter)

  The ID of the user profile to create an enrollment URL for (`uprof_...`).

- `body BetaUserProfileNewEnrollmentURLParams`

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

    This endpoint is in beta: requests must send `user-profiles-2026-03-24`, `user-profiles-2026-08-18`, or `user-profiles-2026-09-04` in this header.

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

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

#### Returns

- `type BetaUserProfileEnrollmentURL`

  A URL to give to the entity that a user profile represents, so that the entity can enroll for a trust grant.

  - `Type BetaUserProfileEnrollmentURLType`

    Object type. Always `enrollment_url`.

  - `ExpiresAt Time`

    When this enrollment URL expires, in RFC 3339 format.

    format: date-time

  - `URL string`

    Enrollment URL to send to the end user. Valid until `expires_at`.

#### 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"),
	)
	betaUserProfileEnrollmentURL, err := client.Beta.UserProfiles.NewEnrollmentURL(
		context.TODO(),
		"uprof_011CZkZCu8hGbp5mYRQgUmz9",
		anthropic.BetaUserProfileNewEnrollmentURLParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaUserProfileEnrollmentURL.ExpiresAt)
}
```

##### Response (200)

```json
{
  "expires_at": "2026-03-15T10:15:00Z",
  "type": "enrollment_url",
  "url": "https://platform.claude.com/user-profiles/enrollment/M3J0bGJxZ2ppMnptbnB1"
}
```

## Beta › Dreams

### Create a Dream

`client.Beta.Dreams.New(ctx, params) (*BetaDream, error)`

**POST** `/v1/dreams`

Start an asynchronous job that uses past sessions to produce a reorganized version of a memory store and get back the dream to poll for the result.

By default the dream writes its result to a new memory store and doesn't change the input memory store. The response has `status` set to `pending` and an empty `outputs` array. Poll the dream until `status` is `completed`, `failed`, or `canceled`.

See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#create-a-dream) to learn more about creating dreams.

#### Parameters

- `params BetaDreamNewParams`

  - `Inputs []BetaDreamInputUnionParam`

    The memory store and sessions for the dream to read, as exactly one `memory_store` entry and exactly one `sessions` entry.

    - `type BetaDreamMemoryStoreInput`

      The memory store that a dream reads, given as an entry in `inputs`.

      With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

      - `Type BetaDreamMemoryStoreInputType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to read (`memstore_...`).

        The memory store must be in the same workspace as the dream and must not be archived.

        minLength: 1

    - `type BetaDreamSessionsInput`

      The sessions that a dream reads, given as an entry in `inputs`.

      - `Type BetaDreamSessionsInputType`

      - `SessionIDs []string`

        The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

        Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists all the limits on a dream.

  - `Model BetaDreamNewParamsModelUnion`

    The model that runs a dream, given as a model ID or as an object with `id` and `speed`.

    In the object form, `speed` can only be `standard`.

    The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists the supported models.

    - `string`

    - `type BetaDreamModelConfigParam`

      The object form of `model` in a request to create a dream.

      - `ID string`

        The ID of the model to run the dream with.

        The ID can be 1 to 256 characters long.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists the supported models.

        minLength: 1, maxLength: 256

      - `Speed BetaDreamModelConfigParamSpeed Optional`

        How fast the model generates output for the dream. Defaults to `standard`.

        Dreams accept only `standard`.

        - `const BetaDreamModelConfigParamSpeedStandard BetaDreamModelConfigParamSpeed = "standard"`

        - `const BetaDreamModelConfigParamSpeedFast BetaDreamModelConfigParamSpeed = "fast"`

  - `Instructions param.Opt[string] Optional`

    Guidance that steers how the dream reads the sessions and organizes the output memory store, from 1 to 4,096 characters.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#steer-with-instructions) for what kinds of instructions work well.

    minLength: 1, maxLength: 4096

  - `OutputBehavior BetaOutputBehaviorUnionParam Optional`

    Which memory store a dream writes its result to. Defaults to `create_new` when left out of a create request.

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

    This endpoint is in beta: requests must send `dreaming-2026-04-21` in this header.

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

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

#### Returns

- `type BetaDream`

  An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

  By default the dream writes its result to a new memory store and doesn't change the input memory store. With `output_behavior` set to `update_existing`, it writes its result into the input memory store instead.

  The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

  See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#how-it-works) for what a dream reads and produces.

  - `Type BetaDreamType`

  - `ID string`

    The unique ID of the dream (`drm_...`).

  - `ArchivedAt Time`

    When the dream was archived, in RFC 3339, or `null` if it hasn't been archived.

    format: date-time

  - `CreatedAt Time`

    When the dream was created, in RFC 3339.

    Lists of dreams are sorted by this time, newest first.

    format: date-time

  - `EndedAt Time`

    When the dream reached `completed`, `failed`, or `canceled`, in RFC 3339, or `null` if it is still `pending` or `running`.

    format: date-time

  - `Error BetaDreamError`

    Why the dream failed, or `null` if `status` isn't `failed`.

    - `Type string`

      A code for why the dream failed, such as `timeout` or `internal_error`.

      The [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#errors) lists common error codes and when they occur.

    - `Message string`

      A human-readable explanation of why the dream failed.

  - `Inputs []BetaDreamInputUnion`

    The sources that the dream reads, from the request that created it.

    - `type BetaDreamMemoryStoreInput`

      The memory store that a dream reads, given as an entry in `inputs`.

      With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

      - `Type BetaDreamMemoryStoreInputType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to read (`memstore_...`).

        The memory store must be in the same workspace as the dream and must not be archived.

        minLength: 1

    - `type BetaDreamSessionsInput`

      The sessions that a dream reads, given as an entry in `inputs`.

      - `Type BetaDreamSessionsInputType`

      - `SessionIDs []string`

        The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

        Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists all the limits on a dream.

  - `Instructions string`

    The guidance given when the dream was created, or `null` if none was given.

  - `Model BetaDreamModelConfig`

    The model that runs a dream, from the request that created it.

    The dream uses this model for all of its work. The response always gives the model as an object, even if the request gave only a model ID.

    - `ID string`

      The ID of the model that runs the dream, as given in the request that created it.

      minLength: 1, maxLength: 256

    - `Speed BetaDreamModelConfigSpeed Optional`

      How fast the model generates output for the dream. Always `standard`.

      - `const BetaDreamModelConfigSpeedStandard BetaDreamModelConfigSpeed = "standard"`

      - `const BetaDreamModelConfigSpeedFast BetaDreamModelConfigSpeed = "fast"`

  - `OutputBehavior BetaOutputBehaviorUnion`

    Where the dream writes its result, as set in the request that created the dream. If that request left out `output_behavior`, the dream used the `create_new` behavior.

    - `type BetaOutputBehaviorCreateNew`

      Write the result to a new memory store that starts as a copy of the input memory store. This is the default.

      The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.

      - `Type BetaOutputBehaviorCreateNewType`

    - `type BetaOutputBehaviorUpdateExisting`

      Write the result into the input memory store instead of a new memory store.

      The credential must be allowed to write memory stores, or the request returns a 403 error. While another `update_existing` dream on the same memory store hasn't fully stopped, the request returns a 409 error.

      - `Type BetaOutputBehaviorUpdateExistingType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to write its result to (`memstore_...`). It must be the memory store in the `memory_store` entry of `inputs`.

        minLength: 1

  - `Outputs []BetaDreamOutput`

    The memory store that holds the dream's result, as a one-item array, or an empty array until the dream records that memory store.

    The array is empty while the dream is `pending` and for a short time after it starts `running`. It can stay empty if the dream fails or is canceled before then. The memory store holds the complete result only once `status` is `completed`.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#use-the-output) for how to review and use the result.

    - `Type BetaDreamOutputType`

    - `MemoryStoreID string`

      The ID of the memory store that the dream writes its result to (`memstore_...`).

      With `output_behavior` set to `create_new`, this is a new memory store. With `update_existing`, it is the input memory store.

  - `SessionID string`

    The ID of the session that runs the dream (`sesn_...`), or `null` if that session hasn't started.

    Stream that session's events to follow what the dream reads and writes.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#watch-the-pipeline-run) for how to watch a running dream.

  - `Status BetaDreamStatus`

    Where a dream is in its lifecycle.

    `completed`, `failed`, and `canceled` are final: once a dream has one of these statuses, its status doesn't change again.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#lifecycle) for what each status means.

    - `const BetaDreamStatusPending BetaDreamStatus = "pending"`

      The dream is waiting to start and hasn't read its inputs yet.

      `outputs` is empty and every `usage` count is zero.

    - `const BetaDreamStatusRunning BetaDreamStatus = "running"`

      The dream is reading its inputs and writing its result.

      `usage` updates while the dream has this status.

    - `const BetaDreamStatusCompleted BetaDreamStatus = "completed"`

      The dream finished and its output memory store holds the complete result.

    - `const BetaDreamStatusFailed BetaDreamStatus = "failed"`

      The dream stopped with an error, which `error` describes.

      If `outputs` references a memory store, that memory store keeps what the dream wrote before it stopped.

    - `const BetaDreamStatusCanceled BetaDreamStatus = "canceled"`

      A cancel request stopped the dream before it reached `completed` or `failed`.

      If `outputs` references a memory store, that memory store keeps what the dream wrote. `usage` can keep changing after the cancel.

  - `Usage BetaDreamUsage`

    The dream's token counts, which stop changing once its `status` is `completed` or `failed`. After a cancel, they can keep changing.

    - `CacheCreationInputTokens int64`

      The dream's input tokens that were written to the prompt cache, for both the 5-minute and 1-hour cache durations.

      format: int32

    - `CacheReadInputTokens int64`

      The dream's input tokens that were read from the prompt cache.

      format: int32

    - `InputTokens int64`

      The dream's input tokens that weren't read from or written to the prompt cache.

      format: int32

    - `OutputTokens int64`

      The tokens that the model generated for the dream.

      format: int32

#### 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"),
	)
	betaDream, err := client.Beta.Dreams.New(context.TODO(), anthropic.BetaDreamNewParams{
		Inputs: []anthropic.BetaDreamInputUnionParam{anthropic.BetaDreamInputUnionParam{
			OfMemoryStore: &anthropic.BetaDreamMemoryStoreInputParam{
				MemoryStoreID: "x",
				Type:          anthropic.BetaDreamMemoryStoreInputTypeMemoryStore,
			},
		}},
		Model: anthropic.BetaDreamNewParamsModelUnion{
			OfString: anthropic.String("string"),
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDream.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "ended_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "message": "message",
    "type": "type"
  },
  "inputs": [
    {
      "memory_store_id": "x",
      "type": "memory_store"
    }
  ],
  "instructions": "instructions",
  "model": {
    "id": "x",
    "speed": "standard"
  },
  "output_behavior": {
    "type": "create_new"
  },
  "outputs": [
    {
      "memory_store_id": "memory_store_id",
      "type": "memory_store"
    }
  ],
  "session_id": "session_id",
  "status": "pending",
  "type": "dream",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}
```

### List Dreams

`client.Beta.Dreams.List(ctx, params) (*PageCursor[BetaDream], error)`

**GET** `/v1/dreams`

List the dreams in the workspace, newest first.

Archived dreams are left out unless `include_archived` is `true`.

See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#list-dreams) for how to page through dreams.

#### Parameters

- `params BetaDreamListParams`

  - `CreatedAtGt param.Opt[Time] Optional` (query parameter)

    Return only dreams created after this time (exclusive), in RFC 3339.

    format: date-time

  - `CreatedAtLt param.Opt[Time] Optional` (query parameter)

    Return only dreams created before this time (exclusive), in RFC 3339.

    format: date-time

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Whether to include archived dreams. Defaults to `false`.

  - `Limit param.Opt[int64] Optional` (query parameter)

    The maximum number of dreams to return, from 1 to 100. Defaults to 20.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    The cursor for the page to return, taken from `next_page` in a previous response.

    Leave it out to get the first page.

  - `Statuses []BetaDreamStatus Optional` (query parameter)

    Return only dreams that have one of these statuses.

    Repeat the parameter to give more than one status. Leave it out to return dreams of every status.

    - `const BetaDreamStatusPending BetaDreamStatus = "pending"`

      The dream is waiting to start and hasn't read its inputs yet.

      `outputs` is empty and every `usage` count is zero.

    - `const BetaDreamStatusRunning BetaDreamStatus = "running"`

      The dream is reading its inputs and writing its result.

      `usage` updates while the dream has this status.

    - `const BetaDreamStatusCompleted BetaDreamStatus = "completed"`

      The dream finished and its output memory store holds the complete result.

    - `const BetaDreamStatusFailed BetaDreamStatus = "failed"`

      The dream stopped with an error, which `error` describes.

      If `outputs` references a memory store, that memory store keeps what the dream wrote before it stopped.

    - `const BetaDreamStatusCanceled BetaDreamStatus = "canceled"`

      A cancel request stopped the dream before it reached `completed` or `failed`.

      If `outputs` references a memory store, that memory store keeps what the dream wrote. `usage` can keep changing after the cancel.

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

    This endpoint is in beta: requests must send `dreaming-2026-04-21` in this header.

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

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

#### Returns

- `type BetaDream`

  An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

  By default the dream writes its result to a new memory store and doesn't change the input memory store. With `output_behavior` set to `update_existing`, it writes its result into the input memory store instead.

  The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

  See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#how-it-works) for what a dream reads and produces.

  - `Type BetaDreamType`

  - `ID string`

    The unique ID of the dream (`drm_...`).

  - `ArchivedAt Time`

    When the dream was archived, in RFC 3339, or `null` if it hasn't been archived.

    format: date-time

  - `CreatedAt Time`

    When the dream was created, in RFC 3339.

    Lists of dreams are sorted by this time, newest first.

    format: date-time

  - `EndedAt Time`

    When the dream reached `completed`, `failed`, or `canceled`, in RFC 3339, or `null` if it is still `pending` or `running`.

    format: date-time

  - `Error BetaDreamError`

    Why the dream failed, or `null` if `status` isn't `failed`.

    - `Type string`

      A code for why the dream failed, such as `timeout` or `internal_error`.

      The [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#errors) lists common error codes and when they occur.

    - `Message string`

      A human-readable explanation of why the dream failed.

  - `Inputs []BetaDreamInputUnion`

    The sources that the dream reads, from the request that created it.

    - `type BetaDreamMemoryStoreInput`

      The memory store that a dream reads, given as an entry in `inputs`.

      With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

      - `Type BetaDreamMemoryStoreInputType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to read (`memstore_...`).

        The memory store must be in the same workspace as the dream and must not be archived.

        minLength: 1

    - `type BetaDreamSessionsInput`

      The sessions that a dream reads, given as an entry in `inputs`.

      - `Type BetaDreamSessionsInputType`

      - `SessionIDs []string`

        The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

        Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists all the limits on a dream.

  - `Instructions string`

    The guidance given when the dream was created, or `null` if none was given.

  - `Model BetaDreamModelConfig`

    The model that runs a dream, from the request that created it.

    The dream uses this model for all of its work. The response always gives the model as an object, even if the request gave only a model ID.

    - `ID string`

      The ID of the model that runs the dream, as given in the request that created it.

      minLength: 1, maxLength: 256

    - `Speed BetaDreamModelConfigSpeed Optional`

      How fast the model generates output for the dream. Always `standard`.

      - `const BetaDreamModelConfigSpeedStandard BetaDreamModelConfigSpeed = "standard"`

      - `const BetaDreamModelConfigSpeedFast BetaDreamModelConfigSpeed = "fast"`

  - `OutputBehavior BetaOutputBehaviorUnion`

    Where the dream writes its result, as set in the request that created the dream. If that request left out `output_behavior`, the dream used the `create_new` behavior.

    - `type BetaOutputBehaviorCreateNew`

      Write the result to a new memory store that starts as a copy of the input memory store. This is the default.

      The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.

      - `Type BetaOutputBehaviorCreateNewType`

    - `type BetaOutputBehaviorUpdateExisting`

      Write the result into the input memory store instead of a new memory store.

      The credential must be allowed to write memory stores, or the request returns a 403 error. While another `update_existing` dream on the same memory store hasn't fully stopped, the request returns a 409 error.

      - `Type BetaOutputBehaviorUpdateExistingType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to write its result to (`memstore_...`). It must be the memory store in the `memory_store` entry of `inputs`.

        minLength: 1

  - `Outputs []BetaDreamOutput`

    The memory store that holds the dream's result, as a one-item array, or an empty array until the dream records that memory store.

    The array is empty while the dream is `pending` and for a short time after it starts `running`. It can stay empty if the dream fails or is canceled before then. The memory store holds the complete result only once `status` is `completed`.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#use-the-output) for how to review and use the result.

    - `Type BetaDreamOutputType`

    - `MemoryStoreID string`

      The ID of the memory store that the dream writes its result to (`memstore_...`).

      With `output_behavior` set to `create_new`, this is a new memory store. With `update_existing`, it is the input memory store.

  - `SessionID string`

    The ID of the session that runs the dream (`sesn_...`), or `null` if that session hasn't started.

    Stream that session's events to follow what the dream reads and writes.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#watch-the-pipeline-run) for how to watch a running dream.

  - `Status BetaDreamStatus`

    Where a dream is in its lifecycle.

    `completed`, `failed`, and `canceled` are final: once a dream has one of these statuses, its status doesn't change again.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#lifecycle) for what each status means.

    - `const BetaDreamStatusPending BetaDreamStatus = "pending"`

      The dream is waiting to start and hasn't read its inputs yet.

      `outputs` is empty and every `usage` count is zero.

    - `const BetaDreamStatusRunning BetaDreamStatus = "running"`

      The dream is reading its inputs and writing its result.

      `usage` updates while the dream has this status.

    - `const BetaDreamStatusCompleted BetaDreamStatus = "completed"`

      The dream finished and its output memory store holds the complete result.

    - `const BetaDreamStatusFailed BetaDreamStatus = "failed"`

      The dream stopped with an error, which `error` describes.

      If `outputs` references a memory store, that memory store keeps what the dream wrote before it stopped.

    - `const BetaDreamStatusCanceled BetaDreamStatus = "canceled"`

      A cancel request stopped the dream before it reached `completed` or `failed`.

      If `outputs` references a memory store, that memory store keeps what the dream wrote. `usage` can keep changing after the cancel.

  - `Usage BetaDreamUsage`

    The dream's token counts, which stop changing once its `status` is `completed` or `failed`. After a cancel, they can keep changing.

    - `CacheCreationInputTokens int64`

      The dream's input tokens that were written to the prompt cache, for both the 5-minute and 1-hour cache durations.

      format: int32

    - `CacheReadInputTokens int64`

      The dream's input tokens that were read from the prompt cache.

      format: int32

    - `InputTokens int64`

      The dream's input tokens that weren't read from or written to the prompt cache.

      format: int32

    - `OutputTokens int64`

      The tokens that the model generated for the dream.

      format: int32

#### 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"),
	)
	page, err := client.Beta.Dreams.List(context.TODO(), anthropic.BetaDreamListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "created_at": "2019-12-27T18:11:19.117Z",
      "ended_at": "2019-12-27T18:11:19.117Z",
      "error": {
        "message": "message",
        "type": "type"
      },
      "inputs": [
        {
          "memory_store_id": "x",
          "type": "memory_store"
        }
      ],
      "instructions": "instructions",
      "model": {
        "id": "x",
        "speed": "standard"
      },
      "output_behavior": {
        "type": "create_new"
      },
      "outputs": [
        {
          "memory_store_id": "memory_store_id",
          "type": "memory_store"
        }
      ],
      "session_id": "session_id",
      "status": "pending",
      "type": "dream",
      "usage": {
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "input_tokens": 0,
        "output_tokens": 0
      }
    }
  ],
  "next_page": "next_page"
}
```

### Get a Dream

`client.Beta.Dreams.Get(ctx, dreamID, query) (*BetaDream, error)`

**GET** `/v1/dreams/{dream_id}`

Get a dream by ID to check its status, output memory store, and token usage.

Archived dreams are returned too.

See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#track-progress) for how to poll a dream and what each status means.

#### Parameters

- `dreamID string` (path parameter)

  The ID of the dream to get (`drm_...`).

- `query BetaDreamGetParams`

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

    This endpoint is in beta: requests must send `dreaming-2026-04-21` in this header.

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

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

#### Returns

- `type BetaDream`

  An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

  By default the dream writes its result to a new memory store and doesn't change the input memory store. With `output_behavior` set to `update_existing`, it writes its result into the input memory store instead.

  The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

  See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#how-it-works) for what a dream reads and produces.

  - `Type BetaDreamType`

  - `ID string`

    The unique ID of the dream (`drm_...`).

  - `ArchivedAt Time`

    When the dream was archived, in RFC 3339, or `null` if it hasn't been archived.

    format: date-time

  - `CreatedAt Time`

    When the dream was created, in RFC 3339.

    Lists of dreams are sorted by this time, newest first.

    format: date-time

  - `EndedAt Time`

    When the dream reached `completed`, `failed`, or `canceled`, in RFC 3339, or `null` if it is still `pending` or `running`.

    format: date-time

  - `Error BetaDreamError`

    Why the dream failed, or `null` if `status` isn't `failed`.

    - `Type string`

      A code for why the dream failed, such as `timeout` or `internal_error`.

      The [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#errors) lists common error codes and when they occur.

    - `Message string`

      A human-readable explanation of why the dream failed.

  - `Inputs []BetaDreamInputUnion`

    The sources that the dream reads, from the request that created it.

    - `type BetaDreamMemoryStoreInput`

      The memory store that a dream reads, given as an entry in `inputs`.

      With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

      - `Type BetaDreamMemoryStoreInputType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to read (`memstore_...`).

        The memory store must be in the same workspace as the dream and must not be archived.

        minLength: 1

    - `type BetaDreamSessionsInput`

      The sessions that a dream reads, given as an entry in `inputs`.

      - `Type BetaDreamSessionsInputType`

      - `SessionIDs []string`

        The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

        Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists all the limits on a dream.

  - `Instructions string`

    The guidance given when the dream was created, or `null` if none was given.

  - `Model BetaDreamModelConfig`

    The model that runs a dream, from the request that created it.

    The dream uses this model for all of its work. The response always gives the model as an object, even if the request gave only a model ID.

    - `ID string`

      The ID of the model that runs the dream, as given in the request that created it.

      minLength: 1, maxLength: 256

    - `Speed BetaDreamModelConfigSpeed Optional`

      How fast the model generates output for the dream. Always `standard`.

      - `const BetaDreamModelConfigSpeedStandard BetaDreamModelConfigSpeed = "standard"`

      - `const BetaDreamModelConfigSpeedFast BetaDreamModelConfigSpeed = "fast"`

  - `OutputBehavior BetaOutputBehaviorUnion`

    Where the dream writes its result, as set in the request that created the dream. If that request left out `output_behavior`, the dream used the `create_new` behavior.

    - `type BetaOutputBehaviorCreateNew`

      Write the result to a new memory store that starts as a copy of the input memory store. This is the default.

      The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.

      - `Type BetaOutputBehaviorCreateNewType`

    - `type BetaOutputBehaviorUpdateExisting`

      Write the result into the input memory store instead of a new memory store.

      The credential must be allowed to write memory stores, or the request returns a 403 error. While another `update_existing` dream on the same memory store hasn't fully stopped, the request returns a 409 error.

      - `Type BetaOutputBehaviorUpdateExistingType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to write its result to (`memstore_...`). It must be the memory store in the `memory_store` entry of `inputs`.

        minLength: 1

  - `Outputs []BetaDreamOutput`

    The memory store that holds the dream's result, as a one-item array, or an empty array until the dream records that memory store.

    The array is empty while the dream is `pending` and for a short time after it starts `running`. It can stay empty if the dream fails or is canceled before then. The memory store holds the complete result only once `status` is `completed`.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#use-the-output) for how to review and use the result.

    - `Type BetaDreamOutputType`

    - `MemoryStoreID string`

      The ID of the memory store that the dream writes its result to (`memstore_...`).

      With `output_behavior` set to `create_new`, this is a new memory store. With `update_existing`, it is the input memory store.

  - `SessionID string`

    The ID of the session that runs the dream (`sesn_...`), or `null` if that session hasn't started.

    Stream that session's events to follow what the dream reads and writes.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#watch-the-pipeline-run) for how to watch a running dream.

  - `Status BetaDreamStatus`

    Where a dream is in its lifecycle.

    `completed`, `failed`, and `canceled` are final: once a dream has one of these statuses, its status doesn't change again.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#lifecycle) for what each status means.

    - `const BetaDreamStatusPending BetaDreamStatus = "pending"`

      The dream is waiting to start and hasn't read its inputs yet.

      `outputs` is empty and every `usage` count is zero.

    - `const BetaDreamStatusRunning BetaDreamStatus = "running"`

      The dream is reading its inputs and writing its result.

      `usage` updates while the dream has this status.

    - `const BetaDreamStatusCompleted BetaDreamStatus = "completed"`

      The dream finished and its output memory store holds the complete result.

    - `const BetaDreamStatusFailed BetaDreamStatus = "failed"`

      The dream stopped with an error, which `error` describes.

      If `outputs` references a memory store, that memory store keeps what the dream wrote before it stopped.

    - `const BetaDreamStatusCanceled BetaDreamStatus = "canceled"`

      A cancel request stopped the dream before it reached `completed` or `failed`.

      If `outputs` references a memory store, that memory store keeps what the dream wrote. `usage` can keep changing after the cancel.

  - `Usage BetaDreamUsage`

    The dream's token counts, which stop changing once its `status` is `completed` or `failed`. After a cancel, they can keep changing.

    - `CacheCreationInputTokens int64`

      The dream's input tokens that were written to the prompt cache, for both the 5-minute and 1-hour cache durations.

      format: int32

    - `CacheReadInputTokens int64`

      The dream's input tokens that were read from the prompt cache.

      format: int32

    - `InputTokens int64`

      The dream's input tokens that weren't read from or written to the prompt cache.

      format: int32

    - `OutputTokens int64`

      The tokens that the model generated for the dream.

      format: int32

#### 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"),
	)
	betaDream, err := client.Beta.Dreams.Get(
		context.TODO(),
		"dream_id",
		anthropic.BetaDreamGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDream.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "ended_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "message": "message",
    "type": "type"
  },
  "inputs": [
    {
      "memory_store_id": "x",
      "type": "memory_store"
    }
  ],
  "instructions": "instructions",
  "model": {
    "id": "x",
    "speed": "standard"
  },
  "output_behavior": {
    "type": "create_new"
  },
  "outputs": [
    {
      "memory_store_id": "memory_store_id",
      "type": "memory_store"
    }
  ],
  "session_id": "session_id",
  "status": "pending",
  "type": "dream",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}
```

### Cancel a Dream

`client.Beta.Dreams.Cancel(ctx, dreamID, body) (*BetaDream, error)`

**POST** `/v1/dreams/{dream_id}/cancel`

Stop a `pending` or `running` dream.

The response shows `status` as `canceled`, unless the dream reached `completed` or `failed` first. `usage` can keep changing after the response. Canceling a `canceled` dream returns it unchanged. Canceling a `completed` or `failed` dream returns a 400 error.

See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#cancel-a-dream) to learn more about canceling dreams.

#### Parameters

- `dreamID string` (path parameter)

  The ID of the dream to cancel (`drm_...`).

- `body BetaDreamCancelParams`

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

    This endpoint is in beta: requests must send `dreaming-2026-04-21` in this header.

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

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

#### Returns

- `type BetaDream`

  An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

  By default the dream writes its result to a new memory store and doesn't change the input memory store. With `output_behavior` set to `update_existing`, it writes its result into the input memory store instead.

  The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

  See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#how-it-works) for what a dream reads and produces.

  - `Type BetaDreamType`

  - `ID string`

    The unique ID of the dream (`drm_...`).

  - `ArchivedAt Time`

    When the dream was archived, in RFC 3339, or `null` if it hasn't been archived.

    format: date-time

  - `CreatedAt Time`

    When the dream was created, in RFC 3339.

    Lists of dreams are sorted by this time, newest first.

    format: date-time

  - `EndedAt Time`

    When the dream reached `completed`, `failed`, or `canceled`, in RFC 3339, or `null` if it is still `pending` or `running`.

    format: date-time

  - `Error BetaDreamError`

    Why the dream failed, or `null` if `status` isn't `failed`.

    - `Type string`

      A code for why the dream failed, such as `timeout` or `internal_error`.

      The [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#errors) lists common error codes and when they occur.

    - `Message string`

      A human-readable explanation of why the dream failed.

  - `Inputs []BetaDreamInputUnion`

    The sources that the dream reads, from the request that created it.

    - `type BetaDreamMemoryStoreInput`

      The memory store that a dream reads, given as an entry in `inputs`.

      With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

      - `Type BetaDreamMemoryStoreInputType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to read (`memstore_...`).

        The memory store must be in the same workspace as the dream and must not be archived.

        minLength: 1

    - `type BetaDreamSessionsInput`

      The sessions that a dream reads, given as an entry in `inputs`.

      - `Type BetaDreamSessionsInputType`

      - `SessionIDs []string`

        The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

        Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists all the limits on a dream.

  - `Instructions string`

    The guidance given when the dream was created, or `null` if none was given.

  - `Model BetaDreamModelConfig`

    The model that runs a dream, from the request that created it.

    The dream uses this model for all of its work. The response always gives the model as an object, even if the request gave only a model ID.

    - `ID string`

      The ID of the model that runs the dream, as given in the request that created it.

      minLength: 1, maxLength: 256

    - `Speed BetaDreamModelConfigSpeed Optional`

      How fast the model generates output for the dream. Always `standard`.

      - `const BetaDreamModelConfigSpeedStandard BetaDreamModelConfigSpeed = "standard"`

      - `const BetaDreamModelConfigSpeedFast BetaDreamModelConfigSpeed = "fast"`

  - `OutputBehavior BetaOutputBehaviorUnion`

    Where the dream writes its result, as set in the request that created the dream. If that request left out `output_behavior`, the dream used the `create_new` behavior.

    - `type BetaOutputBehaviorCreateNew`

      Write the result to a new memory store that starts as a copy of the input memory store. This is the default.

      The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.

      - `Type BetaOutputBehaviorCreateNewType`

    - `type BetaOutputBehaviorUpdateExisting`

      Write the result into the input memory store instead of a new memory store.

      The credential must be allowed to write memory stores, or the request returns a 403 error. While another `update_existing` dream on the same memory store hasn't fully stopped, the request returns a 409 error.

      - `Type BetaOutputBehaviorUpdateExistingType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to write its result to (`memstore_...`). It must be the memory store in the `memory_store` entry of `inputs`.

        minLength: 1

  - `Outputs []BetaDreamOutput`

    The memory store that holds the dream's result, as a one-item array, or an empty array until the dream records that memory store.

    The array is empty while the dream is `pending` and for a short time after it starts `running`. It can stay empty if the dream fails or is canceled before then. The memory store holds the complete result only once `status` is `completed`.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#use-the-output) for how to review and use the result.

    - `Type BetaDreamOutputType`

    - `MemoryStoreID string`

      The ID of the memory store that the dream writes its result to (`memstore_...`).

      With `output_behavior` set to `create_new`, this is a new memory store. With `update_existing`, it is the input memory store.

  - `SessionID string`

    The ID of the session that runs the dream (`sesn_...`), or `null` if that session hasn't started.

    Stream that session's events to follow what the dream reads and writes.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#watch-the-pipeline-run) for how to watch a running dream.

  - `Status BetaDreamStatus`

    Where a dream is in its lifecycle.

    `completed`, `failed`, and `canceled` are final: once a dream has one of these statuses, its status doesn't change again.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#lifecycle) for what each status means.

    - `const BetaDreamStatusPending BetaDreamStatus = "pending"`

      The dream is waiting to start and hasn't read its inputs yet.

      `outputs` is empty and every `usage` count is zero.

    - `const BetaDreamStatusRunning BetaDreamStatus = "running"`

      The dream is reading its inputs and writing its result.

      `usage` updates while the dream has this status.

    - `const BetaDreamStatusCompleted BetaDreamStatus = "completed"`

      The dream finished and its output memory store holds the complete result.

    - `const BetaDreamStatusFailed BetaDreamStatus = "failed"`

      The dream stopped with an error, which `error` describes.

      If `outputs` references a memory store, that memory store keeps what the dream wrote before it stopped.

    - `const BetaDreamStatusCanceled BetaDreamStatus = "canceled"`

      A cancel request stopped the dream before it reached `completed` or `failed`.

      If `outputs` references a memory store, that memory store keeps what the dream wrote. `usage` can keep changing after the cancel.

  - `Usage BetaDreamUsage`

    The dream's token counts, which stop changing once its `status` is `completed` or `failed`. After a cancel, they can keep changing.

    - `CacheCreationInputTokens int64`

      The dream's input tokens that were written to the prompt cache, for both the 5-minute and 1-hour cache durations.

      format: int32

    - `CacheReadInputTokens int64`

      The dream's input tokens that were read from the prompt cache.

      format: int32

    - `InputTokens int64`

      The dream's input tokens that weren't read from or written to the prompt cache.

      format: int32

    - `OutputTokens int64`

      The tokens that the model generated for the dream.

      format: int32

#### 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"),
	)
	betaDream, err := client.Beta.Dreams.Cancel(
		context.TODO(),
		"dream_id",
		anthropic.BetaDreamCancelParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDream.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "ended_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "message": "message",
    "type": "type"
  },
  "inputs": [
    {
      "memory_store_id": "x",
      "type": "memory_store"
    }
  ],
  "instructions": "instructions",
  "model": {
    "id": "x",
    "speed": "standard"
  },
  "output_behavior": {
    "type": "create_new"
  },
  "outputs": [
    {
      "memory_store_id": "memory_store_id",
      "type": "memory_store"
    }
  ],
  "session_id": "session_id",
  "status": "pending",
  "type": "dream",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}
```

### Archive a Dream

`client.Beta.Dreams.Archive(ctx, dreamID, body) (*BetaDream, error)`

**POST** `/v1/dreams/{dream_id}/archive`

Hide a `completed`, `failed`, or `canceled` dream from the default list of dreams.

Archiving a `pending` or `running` dream returns a 400 error, so cancel it first. Archiving an archived dream returns it unchanged. An archived dream can still be fetched by ID. Archiving can't be undone.

See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#archive-a-dream) to learn more about archiving dreams.

#### Parameters

- `dreamID string` (path parameter)

  The ID of the dream to archive (`drm_...`).

- `body BetaDreamArchiveParams`

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

    This endpoint is in beta: requests must send `dreaming-2026-04-21` in this header.

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

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

#### Returns

- `type BetaDream`

  An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

  By default the dream writes its result to a new memory store and doesn't change the input memory store. With `output_behavior` set to `update_existing`, it writes its result into the input memory store instead.

  The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

  See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#how-it-works) for what a dream reads and produces.

  - `Type BetaDreamType`

  - `ID string`

    The unique ID of the dream (`drm_...`).

  - `ArchivedAt Time`

    When the dream was archived, in RFC 3339, or `null` if it hasn't been archived.

    format: date-time

  - `CreatedAt Time`

    When the dream was created, in RFC 3339.

    Lists of dreams are sorted by this time, newest first.

    format: date-time

  - `EndedAt Time`

    When the dream reached `completed`, `failed`, or `canceled`, in RFC 3339, or `null` if it is still `pending` or `running`.

    format: date-time

  - `Error BetaDreamError`

    Why the dream failed, or `null` if `status` isn't `failed`.

    - `Type string`

      A code for why the dream failed, such as `timeout` or `internal_error`.

      The [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#errors) lists common error codes and when they occur.

    - `Message string`

      A human-readable explanation of why the dream failed.

  - `Inputs []BetaDreamInputUnion`

    The sources that the dream reads, from the request that created it.

    - `type BetaDreamMemoryStoreInput`

      The memory store that a dream reads, given as an entry in `inputs`.

      With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.

      - `Type BetaDreamMemoryStoreInputType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to read (`memstore_...`).

        The memory store must be in the same workspace as the dream and must not be archived.

        minLength: 1

    - `type BetaDreamSessionsInput`

      The sessions that a dream reads, given as an entry in `inputs`.

      - `Type BetaDreamSessionsInputType`

      - `SessionIDs []string`

        The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

        Give 1 to 100 IDs, with no duplicates. Each session must be in the same workspace as the dream. Responses list the IDs in sorted order.

        The [limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#limits) lists all the limits on a dream.

  - `Instructions string`

    The guidance given when the dream was created, or `null` if none was given.

  - `Model BetaDreamModelConfig`

    The model that runs a dream, from the request that created it.

    The dream uses this model for all of its work. The response always gives the model as an object, even if the request gave only a model ID.

    - `ID string`

      The ID of the model that runs the dream, as given in the request that created it.

      minLength: 1, maxLength: 256

    - `Speed BetaDreamModelConfigSpeed Optional`

      How fast the model generates output for the dream. Always `standard`.

      - `const BetaDreamModelConfigSpeedStandard BetaDreamModelConfigSpeed = "standard"`

      - `const BetaDreamModelConfigSpeedFast BetaDreamModelConfigSpeed = "fast"`

  - `OutputBehavior BetaOutputBehaviorUnion`

    Where the dream writes its result, as set in the request that created the dream. If that request left out `output_behavior`, the dream used the `create_new` behavior.

    - `type BetaOutputBehaviorCreateNew`

      Write the result to a new memory store that starts as a copy of the input memory store. This is the default.

      The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.

      - `Type BetaOutputBehaviorCreateNewType`

    - `type BetaOutputBehaviorUpdateExisting`

      Write the result into the input memory store instead of a new memory store.

      The credential must be allowed to write memory stores, or the request returns a 403 error. While another `update_existing` dream on the same memory store hasn't fully stopped, the request returns a 409 error.

      - `Type BetaOutputBehaviorUpdateExistingType`

      - `MemoryStoreID string`

        The ID of the memory store for the dream to write its result to (`memstore_...`). It must be the memory store in the `memory_store` entry of `inputs`.

        minLength: 1

  - `Outputs []BetaDreamOutput`

    The memory store that holds the dream's result, as a one-item array, or an empty array until the dream records that memory store.

    The array is empty while the dream is `pending` and for a short time after it starts `running`. It can stay empty if the dream fails or is canceled before then. The memory store holds the complete result only once `status` is `completed`.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#use-the-output) for how to review and use the result.

    - `Type BetaDreamOutputType`

    - `MemoryStoreID string`

      The ID of the memory store that the dream writes its result to (`memstore_...`).

      With `output_behavior` set to `create_new`, this is a new memory store. With `update_existing`, it is the input memory store.

  - `SessionID string`

    The ID of the session that runs the dream (`sesn_...`), or `null` if that session hasn't started.

    Stream that session's events to follow what the dream reads and writes.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#watch-the-pipeline-run) for how to watch a running dream.

  - `Status BetaDreamStatus`

    Where a dream is in its lifecycle.

    `completed`, `failed`, and `canceled` are final: once a dream has one of these statuses, its status doesn't change again.

    See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams?sdk_languages=go#lifecycle) for what each status means.

    - `const BetaDreamStatusPending BetaDreamStatus = "pending"`

      The dream is waiting to start and hasn't read its inputs yet.

      `outputs` is empty and every `usage` count is zero.

    - `const BetaDreamStatusRunning BetaDreamStatus = "running"`

      The dream is reading its inputs and writing its result.

      `usage` updates while the dream has this status.

    - `const BetaDreamStatusCompleted BetaDreamStatus = "completed"`

      The dream finished and its output memory store holds the complete result.

    - `const BetaDreamStatusFailed BetaDreamStatus = "failed"`

      The dream stopped with an error, which `error` describes.

      If `outputs` references a memory store, that memory store keeps what the dream wrote before it stopped.

    - `const BetaDreamStatusCanceled BetaDreamStatus = "canceled"`

      A cancel request stopped the dream before it reached `completed` or `failed`.

      If `outputs` references a memory store, that memory store keeps what the dream wrote. `usage` can keep changing after the cancel.

  - `Usage BetaDreamUsage`

    The dream's token counts, which stop changing once its `status` is `completed` or `failed`. After a cancel, they can keep changing.

    - `CacheCreationInputTokens int64`

      The dream's input tokens that were written to the prompt cache, for both the 5-minute and 1-hour cache durations.

      format: int32

    - `CacheReadInputTokens int64`

      The dream's input tokens that were read from the prompt cache.

      format: int32

    - `InputTokens int64`

      The dream's input tokens that weren't read from or written to the prompt cache.

      format: int32

    - `OutputTokens int64`

      The tokens that the model generated for the dream.

      format: int32

#### 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"),
	)
	betaDream, err := client.Beta.Dreams.Archive(
		context.TODO(),
		"dream_id",
		anthropic.BetaDreamArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDream.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "ended_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "message": "message",
    "type": "type"
  },
  "inputs": [
    {
      "memory_store_id": "x",
      "type": "memory_store"
    }
  ],
  "instructions": "instructions",
  "model": {
    "id": "x",
    "speed": "standard"
  },
  "output_behavior": {
    "type": "create_new"
  },
  "outputs": [
    {
      "memory_store_id": "memory_store_id",
      "type": "memory_store"
    }
  ],
  "session_id": "session_id",
  "status": "pending",
  "type": "dream",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}
```

## Beta › Tunnels

### Create Tunnel

`client.Beta.Tunnels.New(ctx, params) (*BetaTunnel, error)`

**POST** `/v1/tunnels`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; it is not idempotent. The new tunnel rejects MCP traffic until at least one CA certificate is added.

#### Parameters

- `params BetaTunnelNewParams`

  - `DisplayName param.Opt[string] Optional`

    Optional human-readable name for the tunnel (1-255 characters).

    minLength: 1, maxLength: 255

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnel`

  An MCP tunnel.

  - `Type Tunnel`

  - `ID string`

    Unique identifier for the tunnel, prefixed with `tnl_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the tunnel was archived. Null if it is not archived.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the tunnel was created.

    format: date-time

  - `DisplayName string`

    Human-readable name for the tunnel (1-255 characters). Null if unset.

  - `Domain string`

    Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

#### 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"),
	)
	betaTunnel, err := client.Beta.Tunnels.New(context.TODO(), anthropic.BetaTunnelNewParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnel.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "display_name": "display_name",
  "domain": "domain",
  "type": "tunnel"
}
```

### Get Tunnel

`client.Beta.Tunnels.Get(ctx, tunnelID, query) (*BetaTunnel, error)`

**GET** `/v1/tunnels/{tunnel_id}`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Fetches a tunnel by ID.

#### Parameters

- `tunnelID string` (path parameter)

  ID of the tunnel (`tnl_...`).

- `query BetaTunnelGetParams`

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnel`

  An MCP tunnel.

  - `Type Tunnel`

  - `ID string`

    Unique identifier for the tunnel, prefixed with `tnl_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the tunnel was archived. Null if it is not archived.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the tunnel was created.

    format: date-time

  - `DisplayName string`

    Human-readable name for the tunnel (1-255 characters). Null if unset.

  - `Domain string`

    Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

#### 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"),
	)
	betaTunnel, err := client.Beta.Tunnels.Get(
		context.TODO(),
		"tunnel_id",
		anthropic.BetaTunnelGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnel.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "display_name": "display_name",
  "domain": "domain",
  "type": "tunnel"
}
```

### List Tunnels

`client.Beta.Tunnels.List(ctx, params) (*PageCursor[BetaTunnel], error)`

**GET** `/v1/tunnels`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Lists tunnels. Results are ordered by creation time, newest first; archived tunnels are excluded unless include_archived is set.

#### Parameters

- `params BetaTunnelListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Whether to include archived tunnels in the results. Defaults to false.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of tunnels to return per page. Defaults to 20, maximum 1000.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor from a previous `list_tunnels` response.

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnel`

  An MCP tunnel.

  - `Type Tunnel`

  - `ID string`

    Unique identifier for the tunnel, prefixed with `tnl_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the tunnel was archived. Null if it is not archived.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the tunnel was created.

    format: date-time

  - `DisplayName string`

    Human-readable name for the tunnel (1-255 characters). Null if unset.

  - `Domain string`

    Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

#### 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"),
	)
	page, err := client.Beta.Tunnels.List(context.TODO(), anthropic.BetaTunnelListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "created_at": "2019-12-27T18:11:19.117Z",
      "display_name": "display_name",
      "domain": "domain",
      "type": "tunnel"
    }
  ],
  "next_page": "next_page"
}
```

### Archive Tunnel

`client.Beta.Tunnels.Archive(ctx, tunnelID, body) (*BetaTunnel, error)`

**POST** `/v1/tunnels/{tunnel_id}/archive`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Archives a tunnel. Archival is irreversible: every non-archived certificate on the tunnel is archived in the same operation, the hostname is retired and never re-allocated, and the tunnel token is invalidated. Retrying against an already-archived tunnel returns the existing record unchanged.

#### Parameters

- `tunnelID string` (path parameter)

  ID of the tunnel (`tnl_...`).

- `body BetaTunnelArchiveParams`

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnel`

  An MCP tunnel.

  - `Type Tunnel`

  - `ID string`

    Unique identifier for the tunnel, prefixed with `tnl_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the tunnel was archived. Null if it is not archived.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the tunnel was created.

    format: date-time

  - `DisplayName string`

    Human-readable name for the tunnel (1-255 characters). Null if unset.

  - `Domain string`

    Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

#### 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"),
	)
	betaTunnel, err := client.Beta.Tunnels.Archive(
		context.TODO(),
		"tunnel_id",
		anthropic.BetaTunnelArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnel.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "display_name": "display_name",
  "domain": "domain",
  "type": "tunnel"
}
```

### Reveal Tunnel Token

`client.Beta.Tunnels.RevealToken(ctx, tunnelID, body) (*BetaTunnelToken, error)`

**POST** `/v1/tunnels/{tunnel_id}/reveal_token`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Reveals a tunnel's connector token. The value is fetched live on each call; Anthropic does not store it. Repeated calls return the same value until the token is rotated. Exposed as POST so the token does not appear in intermediary access logs.

#### Parameters

- `tunnelID string` (path parameter)

  ID of the tunnel (`tnl_...`).

- `body BetaTunnelRevealTokenParams`

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnelToken`

  A tunnel's connector token.

  - `Type TunnelToken`

  - `ID string`

    Stable identifier for the current token value. Changes when the token is rotated.

  - `TunnelToken string`

    The connector token used to run the tunnel. Treat as a credential.

#### 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"),
	)
	betaTunnelToken, err := client.Beta.Tunnels.RevealToken(
		context.TODO(),
		"tunnel_id",
		anthropic.BetaTunnelRevealTokenParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnelToken.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "tunnel_token": "tunnel_token",
  "type": "tunnel_token"
}
```

### Rotate Tunnel Token

`client.Beta.Tunnels.RotateToken(ctx, tunnelID, params) (*BetaTunnelToken, error)`

**POST** `/v1/tunnels/{tunnel_id}/rotate_token`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Rotates a tunnel's connector token. Rotation invalidates the current token for new connections and returns a fresh value; established connections are not severed. A connector restarted after rotation must use the new value.

#### Parameters

- `tunnelID string` (path parameter)

  ID of the tunnel (`tnl_...`).

- `params BetaTunnelRotateTokenParams`

  - `Reason param.Opt[string] Optional`

    Optional free-text reason for the rotation, recorded for audit.

    maxLength: 1024

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnelToken`

  A tunnel's connector token.

  - `Type TunnelToken`

  - `ID string`

    Stable identifier for the current token value. Changes when the token is rotated.

  - `TunnelToken string`

    The connector token used to run the tunnel. Treat as a credential.

#### 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"),
	)
	betaTunnelToken, err := client.Beta.Tunnels.RotateToken(
		context.TODO(),
		"tunnel_id",
		anthropic.BetaTunnelRotateTokenParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnelToken.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "tunnel_token": "tunnel_token",
  "type": "tunnel_token"
}
```

## Beta › Tunnels › Certificates

### Create Tunnel Certificate

`client.Beta.Tunnels.Certificates.New(ctx, tunnelID, params) (*BetaTunnelCertificate, error)`

**POST** `/v1/tunnels/{tunnel_id}/certificates`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Registers a public CA certificate on a tunnel. Anthropic verifies the gateway's server certificate against this CA when it terminates the inner TLS session. A tunnel holds at most two non-archived certificates.

#### Parameters

- `tunnelID string` (path parameter)

  ID of the tunnel (`tnl_...`).

- `params BetaTunnelCertificateNewParams`

  - `CACertificatePEM string`

    PEM-encoded X.509 CA certificate. Must contain exactly one certificate and no private-key material. Maximum 8KB.

    maxLength: 8192

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnelCertificate`

  A CA certificate attached to a tunnel.

  - `Type TunnelCertificate`

  - `ID string`

    Unique identifier for the certificate, prefixed with `tcrt_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the certificate was archived. Null if it is still in the trusted set.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the certificate was registered.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the certificate expires, or `null` if it does not expire.

    format: date-time

  - `Fingerprint string`

    Lowercase hex SHA-256 fingerprint of the certificate's DER encoding.

  - `TunnelID string`

    ID of the tunnel the certificate is registered against.

#### 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"),
	)
	betaTunnelCertificate, err := client.Beta.Tunnels.Certificates.New(
		context.TODO(),
		"tunnel_id",
		anthropic.BetaTunnelCertificateNewParams{
			CACertificatePEM: "ca_certificate_pem",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnelCertificate.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "fingerprint": "fingerprint",
  "tunnel_id": "tunnel_id",
  "type": "tunnel_certificate"
}
```

### Get Tunnel Certificate

`client.Beta.Tunnels.Certificates.Get(ctx, certificateID, params) (*BetaTunnelCertificate, error)`

**GET** `/v1/tunnels/{tunnel_id}/certificates/{certificate_id}`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Fetches a tunnel certificate by ID.

#### Parameters

- `certificateID string` (path parameter)

  ID of the certificate (`tcrt_...`).

- `params BetaTunnelCertificateGetParams`

  - `TunnelID string` (path parameter)

    ID of the tunnel (`tnl_...`).

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnelCertificate`

  A CA certificate attached to a tunnel.

  - `Type TunnelCertificate`

  - `ID string`

    Unique identifier for the certificate, prefixed with `tcrt_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the certificate was archived. Null if it is still in the trusted set.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the certificate was registered.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the certificate expires, or `null` if it does not expire.

    format: date-time

  - `Fingerprint string`

    Lowercase hex SHA-256 fingerprint of the certificate's DER encoding.

  - `TunnelID string`

    ID of the tunnel the certificate is registered against.

#### 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"),
	)
	betaTunnelCertificate, err := client.Beta.Tunnels.Certificates.Get(
		context.TODO(),
		"certificate_id",
		anthropic.BetaTunnelCertificateGetParams{
			TunnelID: "tunnel_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnelCertificate.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "fingerprint": "fingerprint",
  "tunnel_id": "tunnel_id",
  "type": "tunnel_certificate"
}
```

### List Tunnel Certificates

`client.Beta.Tunnels.Certificates.List(ctx, tunnelID, params) (*PageCursor[BetaTunnelCertificate], error)`

**GET** `/v1/tunnels/{tunnel_id}/certificates`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Lists the certificates registered on a tunnel. Archived certificates are excluded unless include_archived is set.

#### Parameters

- `tunnelID string` (path parameter)

  ID of the tunnel (`tnl_...`).

- `params BetaTunnelCertificateListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Whether to include archived certificates in the results. Defaults to false.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of certificates to return per page. Defaults to 20, maximum 1000.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque pagination cursor from a previous `list_tunnel_certificates` response.

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnelCertificate`

  A CA certificate attached to a tunnel.

  - `Type TunnelCertificate`

  - `ID string`

    Unique identifier for the certificate, prefixed with `tcrt_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the certificate was archived. Null if it is still in the trusted set.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the certificate was registered.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the certificate expires, or `null` if it does not expire.

    format: date-time

  - `Fingerprint string`

    Lowercase hex SHA-256 fingerprint of the certificate's DER encoding.

  - `TunnelID string`

    ID of the tunnel the certificate is registered against.

#### 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"),
	)
	page, err := client.Beta.Tunnels.Certificates.List(
		context.TODO(),
		"tunnel_id",
		anthropic.BetaTunnelCertificateListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "created_at": "2019-12-27T18:11:19.117Z",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "fingerprint": "fingerprint",
      "tunnel_id": "tunnel_id",
      "type": "tunnel_certificate"
    }
  ],
  "next_page": "next_page"
}
```

### Archive Tunnel Certificate

`client.Beta.Tunnels.Certificates.Archive(ctx, certificateID, params) (*BetaTunnelCertificate, error)`

**POST** `/v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive`

The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Archives a tunnel certificate, removing it from the set Anthropic trusts for the tunnel. The certificate record is retained. Archiving the last non-archived certificate is permitted; the tunnel rejects MCP traffic until a new certificate is added.

#### Parameters

- `certificateID string` (path parameter)

  ID of the certificate to archive (`tcrt_...`).

- `params BetaTunnelCertificateArchiveParams`

  - `TunnelID string` (path parameter)

    ID of the tunnel (`tnl_...`).

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

    This endpoint is in beta: requests must send `mcp-tunnels-2026-06-22` in this header.

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

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

#### Returns

- `type BetaTunnelCertificate`

  A CA certificate attached to a tunnel.

  - `Type TunnelCertificate`

  - `ID string`

    Unique identifier for the certificate, prefixed with `tcrt_`.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the certificate was archived. Null if it is still in the trusted set.

    format: date-time

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the certificate was registered.

    format: date-time

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the certificate expires, or `null` if it does not expire.

    format: date-time

  - `Fingerprint string`

    Lowercase hex SHA-256 fingerprint of the certificate's DER encoding.

  - `TunnelID string`

    ID of the tunnel the certificate is registered against.

#### 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"),
	)
	betaTunnelCertificate, err := client.Beta.Tunnels.Certificates.Archive(
		context.TODO(),
		"certificate_id",
		anthropic.BetaTunnelCertificateArchiveParams{
			TunnelID: "tunnel_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTunnelCertificate.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "fingerprint": "fingerprint",
  "tunnel_id": "tunnel_id",
  "type": "tunnel_certificate"
}
```

## Beta › Organization

### Get Current Organization

`client.Beta.Organization.Get(ctx) (*BetaOrganization, error)`

**GET** `/v1/organizations/me`

Retrieve information about the organization associated with the authenticated API key.

#### Returns

- `type BetaOrganization`

  - `Type Organization`

    Object type.

    For Organizations, this is always `"organization"`.

    default: organization

  - `ID string`

    ID of the Organization.

    format: uuid

  - `Name string`

    Name of the Organization.

#### 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"),
	)
	betaOrganization, err := client.Beta.Organization.Get(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaOrganization.ID)
}
```

##### Response (200)

```json
{
  "id": "12345678-1234-5678-1234-567812345678",
  "name": "Organization Name",
  "type": "organization"
}
```

## Beta › Organization › API Keys

### List API Keys

`client.Beta.Organization.APIKeys.List(ctx, query) (*Page[BetaAPIKey], error)`

**GET** `/v1/organizations/api_keys`

List API Keys

#### Parameters

- `query BetaOrganizationAPIKeyListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `CreatedByUserID param.Opt[string] Optional` (query parameter)

    Filter by the ID of the User who created the object.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Status BetaOrganizationAPIKeyListParamsStatus Optional` (query parameter)

    Filter by API key status.

    - `const BetaOrganizationAPIKeyListParamsStatusActive BetaOrganizationAPIKeyListParamsStatus = "active"`

    - `const BetaOrganizationAPIKeyListParamsStatusArchived BetaOrganizationAPIKeyListParamsStatus = "archived"`

    - `const BetaOrganizationAPIKeyListParamsStatusExpired BetaOrganizationAPIKeyListParamsStatus = "expired"`

    - `const BetaOrganizationAPIKeyListParamsStatusInactive BetaOrganizationAPIKeyListParamsStatus = "inactive"`

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

    Filter by Workspace ID.

#### Returns

- `type BetaAPIKey`

  - `Type APIKey`

    Object type.

    For API Keys, this is always `"api_key"`.

    default: api_key

  - `ID string`

    ID of the API key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the API Key was created.

    format: date-time

  - `CreatedBy BetaAPIKeyCreatedBy`

    The ID and type of the actor that created the API key, or `null` when the
    creator is not recorded (legacy, workload-identity-federated, or
    system-created keys).

    - `Type BetaAPIKeyCreatedByType`

      Type of the actor that created the object.

      - `const BetaAPIKeyCreatedByTypeServiceAccount BetaAPIKeyCreatedByType = "service_account"`

      - `const BetaAPIKeyCreatedByTypeUser BetaAPIKeyCreatedByType = "user"`

    - `ID string`

      ID of the actor that created the object.

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the API Key expires, or `null` if it never expires.

    format: date-time

  - `Name string`

    Name of the API key.

  - `PartialKeyHint string`

    Partially redacted hint for the API key.

  - `Principal BetaAPIKeyPrincipalUnion`

    The principal the API key acts as (a User or a Service Account), or `null` if the API key is not bound to a principal.

    - `type BetaAPIKeyUserActor`

      - `Type UserActor`

        Principal type. Always `"user_actor"` for a User.

        default: user_actor

      - `UserID string`

        ID of the User the API key acts as.

    - `type BetaAPIKeyServiceAccountActor`

      - `Type ServiceAccountActor`

        Principal type. Always `"service_account_actor"` for a Service Account.

        default: service_account_actor

      - `ServiceAccountID string`

        ID of the Service Account the API key acts as.

  - `Scope BetaAPIKeyScopeUnion`

    Where the API key belongs: its Workspace (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's real ID even when it is the organization's default Workspace), or the organization (`{"type": "organization"}`) for a principal-bound API key that has no Workspace.

    - `type BetaAPIKeyOrganizationScope`

      - `Type Organization`

        Scope type. Always `"organization"`: the API key has no Workspace. Only a principal-bound API key can have this scope.

        default: organization

    - `type BetaAPIKeyWorkspaceScope`

      - `Type Workspace`

        Scope type. Always `"workspace"`: the API key belongs to one Workspace.

        default: workspace

      - `WorkspaceID string`

        ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.

  - `Status BetaAPIKeyStatus`

    Status of the API key.

    - `const BetaAPIKeyStatusActive BetaAPIKeyStatus = "active"`

    - `const BetaAPIKeyStatusArchived BetaAPIKeyStatus = "archived"`

    - `const BetaAPIKeyStatusExpired BetaAPIKeyStatus = "expired"`

    - `const BetaAPIKeyStatusInactive BetaAPIKeyStatus = "inactive"`

  - `WorkspaceID string`

    **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.

    Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.

#### 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"),
	)
	page, err := client.Beta.Organization.APIKeys.List(context.TODO(), anthropic.BetaOrganizationAPIKeyListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "apikey_01Rj2N8SVvo6BePZj99NhmiT",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "created_by": {
        "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
        "type": "user"
      },
      "expires_at": "2024-10-30T23:58:27.427722Z",
      "name": "Developer Key",
      "partial_key_hint": "sk-ant-api03-R2D...igAA",
      "principal": {
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "scope": {
        "type": "workspace",
        "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
      },
      "status": "active",
      "type": "api_key",
      "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Retrieve API Key (Admin API)

`client.Beta.Organization.APIKeys.Get(ctx, apiKeyID) (*BetaAPIKey, error)`

**GET** `/v1/organizations/api_keys/{api_key_id}`

Retrieve information about a single API key in your organization, looked up by its ID. This Admin API endpoint requires an Admin API key, is intended for programmatic key management, and never returns the key's secret value. To view or create your own API keys, go to [API keys](https://platform.claude.com/settings/keys) in the Claude Console.

#### Parameters

- `apiKeyID string` (path parameter)

  ID of the API key.

#### Returns

- `type BetaAPIKey`

  - `Type APIKey`

    Object type.

    For API Keys, this is always `"api_key"`.

    default: api_key

  - `ID string`

    ID of the API key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the API Key was created.

    format: date-time

  - `CreatedBy BetaAPIKeyCreatedBy`

    The ID and type of the actor that created the API key, or `null` when the
    creator is not recorded (legacy, workload-identity-federated, or
    system-created keys).

    - `Type BetaAPIKeyCreatedByType`

      Type of the actor that created the object.

      - `const BetaAPIKeyCreatedByTypeServiceAccount BetaAPIKeyCreatedByType = "service_account"`

      - `const BetaAPIKeyCreatedByTypeUser BetaAPIKeyCreatedByType = "user"`

    - `ID string`

      ID of the actor that created the object.

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the API Key expires, or `null` if it never expires.

    format: date-time

  - `Name string`

    Name of the API key.

  - `PartialKeyHint string`

    Partially redacted hint for the API key.

  - `Principal BetaAPIKeyPrincipalUnion`

    The principal the API key acts as (a User or a Service Account), or `null` if the API key is not bound to a principal.

    - `type BetaAPIKeyUserActor`

      - `Type UserActor`

        Principal type. Always `"user_actor"` for a User.

        default: user_actor

      - `UserID string`

        ID of the User the API key acts as.

    - `type BetaAPIKeyServiceAccountActor`

      - `Type ServiceAccountActor`

        Principal type. Always `"service_account_actor"` for a Service Account.

        default: service_account_actor

      - `ServiceAccountID string`

        ID of the Service Account the API key acts as.

  - `Scope BetaAPIKeyScopeUnion`

    Where the API key belongs: its Workspace (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's real ID even when it is the organization's default Workspace), or the organization (`{"type": "organization"}`) for a principal-bound API key that has no Workspace.

    - `type BetaAPIKeyOrganizationScope`

      - `Type Organization`

        Scope type. Always `"organization"`: the API key has no Workspace. Only a principal-bound API key can have this scope.

        default: organization

    - `type BetaAPIKeyWorkspaceScope`

      - `Type Workspace`

        Scope type. Always `"workspace"`: the API key belongs to one Workspace.

        default: workspace

      - `WorkspaceID string`

        ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.

  - `Status BetaAPIKeyStatus`

    Status of the API key.

    - `const BetaAPIKeyStatusActive BetaAPIKeyStatus = "active"`

    - `const BetaAPIKeyStatusArchived BetaAPIKeyStatus = "archived"`

    - `const BetaAPIKeyStatusExpired BetaAPIKeyStatus = "expired"`

    - `const BetaAPIKeyStatusInactive BetaAPIKeyStatus = "inactive"`

  - `WorkspaceID string`

    **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.

    Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.

#### 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"),
	)
	betaAPIKey, err := client.Beta.Organization.APIKeys.Get(context.TODO(), "api_key_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaAPIKey.ID)
}
```

##### Response (200)

```json
{
  "id": "apikey_01Rj2N8SVvo6BePZj99NhmiT",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by": {
    "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
    "type": "user"
  },
  "expires_at": "2024-10-30T23:58:27.427722Z",
  "name": "Developer Key",
  "partial_key_hint": "sk-ant-api03-R2D...igAA",
  "principal": {
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "scope": {
    "type": "workspace",
    "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  },
  "status": "active",
  "type": "api_key",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
}
```

### Update API Key

`client.Beta.Organization.APIKeys.Update(ctx, apiKeyID, body) (*BetaAPIKey, error)`

**POST** `/v1/organizations/api_keys/{api_key_id}`

Update API Key

#### Parameters

- `apiKeyID string` (path parameter)

  ID of the API key.

- `body BetaOrganizationAPIKeyUpdateParams`

  - `Name param.Opt[string] Optional`

    Name of the API key.

    minLength: 1, maxLength: 500

  - `Status BetaOrganizationAPIKeyUpdateParamsStatus Optional`

    Status of the API key.

    - `const BetaOrganizationAPIKeyUpdateParamsStatusActive BetaOrganizationAPIKeyUpdateParamsStatus = "active"`

    - `const BetaOrganizationAPIKeyUpdateParamsStatusArchived BetaOrganizationAPIKeyUpdateParamsStatus = "archived"`

    - `const BetaOrganizationAPIKeyUpdateParamsStatusInactive BetaOrganizationAPIKeyUpdateParamsStatus = "inactive"`

#### Returns

- `type BetaAPIKey`

  - `Type APIKey`

    Object type.

    For API Keys, this is always `"api_key"`.

    default: api_key

  - `ID string`

    ID of the API key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the API Key was created.

    format: date-time

  - `CreatedBy BetaAPIKeyCreatedBy`

    The ID and type of the actor that created the API key, or `null` when the
    creator is not recorded (legacy, workload-identity-federated, or
    system-created keys).

    - `Type BetaAPIKeyCreatedByType`

      Type of the actor that created the object.

      - `const BetaAPIKeyCreatedByTypeServiceAccount BetaAPIKeyCreatedByType = "service_account"`

      - `const BetaAPIKeyCreatedByTypeUser BetaAPIKeyCreatedByType = "user"`

    - `ID string`

      ID of the actor that created the object.

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the API Key expires, or `null` if it never expires.

    format: date-time

  - `Name string`

    Name of the API key.

  - `PartialKeyHint string`

    Partially redacted hint for the API key.

  - `Principal BetaAPIKeyPrincipalUnion`

    The principal the API key acts as (a User or a Service Account), or `null` if the API key is not bound to a principal.

    - `type BetaAPIKeyUserActor`

      - `Type UserActor`

        Principal type. Always `"user_actor"` for a User.

        default: user_actor

      - `UserID string`

        ID of the User the API key acts as.

    - `type BetaAPIKeyServiceAccountActor`

      - `Type ServiceAccountActor`

        Principal type. Always `"service_account_actor"` for a Service Account.

        default: service_account_actor

      - `ServiceAccountID string`

        ID of the Service Account the API key acts as.

  - `Scope BetaAPIKeyScopeUnion`

    Where the API key belongs: its Workspace (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's real ID even when it is the organization's default Workspace), or the organization (`{"type": "organization"}`) for a principal-bound API key that has no Workspace.

    - `type BetaAPIKeyOrganizationScope`

      - `Type Organization`

        Scope type. Always `"organization"`: the API key has no Workspace. Only a principal-bound API key can have this scope.

        default: organization

    - `type BetaAPIKeyWorkspaceScope`

      - `Type Workspace`

        Scope type. Always `"workspace"`: the API key belongs to one Workspace.

        default: workspace

      - `WorkspaceID string`

        ID of the Workspace the API key belongs to. Unlike the deprecated top-level `workspace_id`, this is the Workspace's real ID even for the organization's default Workspace.

  - `Status BetaAPIKeyStatus`

    Status of the API key.

    - `const BetaAPIKeyStatusActive BetaAPIKeyStatus = "active"`

    - `const BetaAPIKeyStatusArchived BetaAPIKeyStatus = "archived"`

    - `const BetaAPIKeyStatusExpired BetaAPIKeyStatus = "expired"`

    - `const BetaAPIKeyStatusInactive BetaAPIKeyStatus = "inactive"`

  - `WorkspaceID string`

    **Deprecated**: Use `scope` instead. `workspace_id` is `null` both for an API key in the default Workspace and for a principal-bound API key that has no Workspace.

    Deprecated: use `scope` instead. ID of the Workspace associated with the API key, or `null` if the API key belongs to the default Workspace. Also `null` for a principal-bound API key that has no Workspace; `scope` tells the two apart.

#### 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"),
	)
	betaAPIKey, err := client.Beta.Organization.APIKeys.Update(
		context.TODO(),
		"api_key_id",
		anthropic.BetaOrganizationAPIKeyUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaAPIKey.ID)
}
```

##### Response (200)

```json
{
  "id": "apikey_01Rj2N8SVvo6BePZj99NhmiT",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by": {
    "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
    "type": "user"
  },
  "expires_at": "2024-10-30T23:58:27.427722Z",
  "name": "Developer Key",
  "partial_key_hint": "sk-ant-api03-R2D...igAA",
  "principal": {
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "scope": {
    "type": "workspace",
    "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  },
  "status": "active",
  "type": "api_key",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
}
```

## Beta › Organization › External Keys

### Create External Key

`client.Beta.Organization.ExternalKeys.New(ctx, body) (*BetaExternalKey, error)`

**POST** `/v1/organizations/external_keys`

Create an external key config owned by the caller's organization.

#### Parameters

- `body BetaOrganizationExternalKeyNewParams`

  - `ProviderConfig BetaOrganizationExternalKeyNewParamsProviderConfigUnion`

    KMS provider identity and auth coordinates.

    - `type BetaAWSExternalKeyConfig`

      - `Type AWS`

      - `KMSARN string`

        Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

        maxLength: 2048

      - `Region string Optional`

        AWS region. Derived from `kms_arn` if omitted.

      - `RoleARN string Optional`

        **Deprecated**

        IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

    - `type BetaGCPExternalKeyConfig`

      - `Type GCP`

      - `KeyName string`

        Full resource name of the Cloud KMS key.

    - `type BetaAzureExternalKeyConfigParam`

      Azure Key Vault provider configuration.

      - `Type Azure`

      - `KeyName string`

        Name of the key within the vault.

      - `TenantID string`

        Azure AD tenant ID.

      - `VaultURI string`

        Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or `https://{hsm-name}.managedhsm.azure.net`.

      - `ClientID string Optional`

        Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

  - `DisplayName param.Opt[string] Optional`

    Human-friendly display name.

    minLength: 1, maxLength: 255

  - `Geo BetaOrganizationExternalKeyNewParamsGeo Optional`

    Data residency geo. Only `us` is supported.

    - `const BetaOrganizationExternalKeyNewParamsGeoUs BetaOrganizationExternalKeyNewParamsGeo = "us"`

#### Returns

- `type BetaExternalKey`

  CMEK external key config belonging to the caller's organization.

  Configs are organization-scoped. Workspaces attach to a config; once any
  workspace references it, the provider fields become effectively immutable
  (existing encrypted data needs the config for decrypt).

  - `Type ExternalKey`

    default: external_key

  - `ID string`

    Identifier of the external key config. A tagged ID prefixed `ekey_`, or — for organizations on the Claude Platform on AWS — the AWS KMS key ARN.

  - `Attachment BetaExternalKeyAttachmentUnion`

    Whether any workspace uses this config to encrypt its data — counting live and archived workspaces (an archived workspace's data remains encrypted under the config), excluding deleted ones. Only an attached config is used by the encryption path; an `unattached` config is inert and can be deleted.

    - `type BetaExternalKeyAttachedAttachment`

      - `Type Attached`

        default: attached

    - `type BetaExternalKeyUnattachedAttachment`

      - `Type Unattached`

        default: unattached

  - `CreatedAt Time`

    format: date-time

  - `DisplayName string`

    Human-friendly display name. Null if none was set.

  - `Geo string`

    Data residency geo. Selects which regional validator handles this key's encrypt/decrypt roundtrips.

  - `ProviderConfig BetaExternalKeyProviderConfigUnion`

    KMS provider identity and auth coordinates.

    - `type BetaAWSExternalKeyConfig`

      - `Type AWS`

      - `KMSARN string`

        Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

        maxLength: 2048

      - `Region string Optional`

        AWS region. Derived from `kms_arn` if omitted.

      - `RoleARN string Optional`

        **Deprecated**

        IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

    - `type BetaGCPExternalKeyConfig`

      - `Type GCP`

      - `KeyName string`

        Full resource name of the Cloud KMS key.

    - `type BetaAzureExternalKeyConfig`

      - `Type Azure`

      - `KeyName string`

        Name of the key within the vault.

      - `TenantID string`

        Azure AD tenant ID.

      - `VaultURI string`

        Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or `https://{hsm-name}.managedhsm.azure.net`.

      - `ClientID string Optional`

        Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

  - `UpdatedAt Time`

    format: date-time

#### 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"),
	)
	betaExternalKey, err := client.Beta.Organization.ExternalKeys.New(context.TODO(), anthropic.BetaOrganizationExternalKeyNewParams{
		ProviderConfig: anthropic.BetaOrganizationExternalKeyNewParamsProviderConfigUnion{
			OfAWS: &anthropic.BetaAWSExternalKeyConfigParam{
				KMSARN: "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
			},
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaExternalKey.ID)
}
```

##### Response (200)

```json
{
  "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "attachment": {
    "type": "attached"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "prod-us-key",
  "geo": "us",
  "provider_config": {
    "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
    "type": "aws",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
  },
  "type": "external_key",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### List External Keys

`client.Beta.Organization.ExternalKeys.List(ctx, query) (*PageCursor[BetaExternalKey], error)`

**GET** `/v1/organizations/external_keys`

List external key configs in the caller's organization.

Results are ordered by creation time (newest first). Use the
`next_page` cursor from the response to fetch subsequent pages.

#### Parameters

- `query BetaOrganizationExternalKeyListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

#### Returns

- `type BetaExternalKey`

  CMEK external key config belonging to the caller's organization.

  Configs are organization-scoped. Workspaces attach to a config; once any
  workspace references it, the provider fields become effectively immutable
  (existing encrypted data needs the config for decrypt).

  - `Type ExternalKey`

    default: external_key

  - `ID string`

    Identifier of the external key config. A tagged ID prefixed `ekey_`, or — for organizations on the Claude Platform on AWS — the AWS KMS key ARN.

  - `Attachment BetaExternalKeyAttachmentUnion`

    Whether any workspace uses this config to encrypt its data — counting live and archived workspaces (an archived workspace's data remains encrypted under the config), excluding deleted ones. Only an attached config is used by the encryption path; an `unattached` config is inert and can be deleted.

    - `type BetaExternalKeyAttachedAttachment`

      - `Type Attached`

        default: attached

    - `type BetaExternalKeyUnattachedAttachment`

      - `Type Unattached`

        default: unattached

  - `CreatedAt Time`

    format: date-time

  - `DisplayName string`

    Human-friendly display name. Null if none was set.

  - `Geo string`

    Data residency geo. Selects which regional validator handles this key's encrypt/decrypt roundtrips.

  - `ProviderConfig BetaExternalKeyProviderConfigUnion`

    KMS provider identity and auth coordinates.

    - `type BetaAWSExternalKeyConfig`

      - `Type AWS`

      - `KMSARN string`

        Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

        maxLength: 2048

      - `Region string Optional`

        AWS region. Derived from `kms_arn` if omitted.

      - `RoleARN string Optional`

        **Deprecated**

        IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

    - `type BetaGCPExternalKeyConfig`

      - `Type GCP`

      - `KeyName string`

        Full resource name of the Cloud KMS key.

    - `type BetaAzureExternalKeyConfig`

      - `Type Azure`

      - `KeyName string`

        Name of the key within the vault.

      - `TenantID string`

        Azure AD tenant ID.

      - `VaultURI string`

        Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or `https://{hsm-name}.managedhsm.azure.net`.

      - `ClientID string Optional`

        Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

  - `UpdatedAt Time`

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Organization.ExternalKeys.List(context.TODO(), anthropic.BetaOrganizationExternalKeyListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
      "attachment": {
        "type": "attached"
      },
      "created_at": "2024-10-30T23:58:27.427722Z",
      "display_name": "prod-us-key",
      "geo": "us",
      "provider_config": {
        "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
        "type": "aws",
        "region": "us-east-1",
        "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
      },
      "type": "external_key",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "next_page": "next_page"
}
```

### Get External Key

`client.Beta.Organization.ExternalKeys.Get(ctx, externalKeyID) (*BetaExternalKey, error)`

**GET** `/v1/organizations/external_keys/{external_key_id}`

Retrieve a single external key config in the caller's organization by ID.

#### Parameters

- `externalKeyID string` (path parameter)

  ID of the External Key.

  maxLength: 2048

#### Returns

- `type BetaExternalKey`

  CMEK external key config belonging to the caller's organization.

  Configs are organization-scoped. Workspaces attach to a config; once any
  workspace references it, the provider fields become effectively immutable
  (existing encrypted data needs the config for decrypt).

  - `Type ExternalKey`

    default: external_key

  - `ID string`

    Identifier of the external key config. A tagged ID prefixed `ekey_`, or — for organizations on the Claude Platform on AWS — the AWS KMS key ARN.

  - `Attachment BetaExternalKeyAttachmentUnion`

    Whether any workspace uses this config to encrypt its data — counting live and archived workspaces (an archived workspace's data remains encrypted under the config), excluding deleted ones. Only an attached config is used by the encryption path; an `unattached` config is inert and can be deleted.

    - `type BetaExternalKeyAttachedAttachment`

      - `Type Attached`

        default: attached

    - `type BetaExternalKeyUnattachedAttachment`

      - `Type Unattached`

        default: unattached

  - `CreatedAt Time`

    format: date-time

  - `DisplayName string`

    Human-friendly display name. Null if none was set.

  - `Geo string`

    Data residency geo. Selects which regional validator handles this key's encrypt/decrypt roundtrips.

  - `ProviderConfig BetaExternalKeyProviderConfigUnion`

    KMS provider identity and auth coordinates.

    - `type BetaAWSExternalKeyConfig`

      - `Type AWS`

      - `KMSARN string`

        Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

        maxLength: 2048

      - `Region string Optional`

        AWS region. Derived from `kms_arn` if omitted.

      - `RoleARN string Optional`

        **Deprecated**

        IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

    - `type BetaGCPExternalKeyConfig`

      - `Type GCP`

      - `KeyName string`

        Full resource name of the Cloud KMS key.

    - `type BetaAzureExternalKeyConfig`

      - `Type Azure`

      - `KeyName string`

        Name of the key within the vault.

      - `TenantID string`

        Azure AD tenant ID.

      - `VaultURI string`

        Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or `https://{hsm-name}.managedhsm.azure.net`.

      - `ClientID string Optional`

        Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

  - `UpdatedAt Time`

    format: date-time

#### 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"),
	)
	betaExternalKey, err := client.Beta.Organization.ExternalKeys.Get(context.TODO(), "external_key_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaExternalKey.ID)
}
```

##### Response (200)

```json
{
  "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "attachment": {
    "type": "attached"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "prod-us-key",
  "geo": "us",
  "provider_config": {
    "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
    "type": "aws",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
  },
  "type": "external_key",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Update External Key

`client.Beta.Organization.ExternalKeys.Update(ctx, externalKeyID, body) (*BetaExternalKey, error)`

**POST** `/v1/organizations/external_keys/{external_key_id}`

Partially update an external key config. Omitted fields are left unchanged.

`display_name` is always editable. `geo` and `provider_config` cannot
be changed once any workspace references this config, because previously
encrypted data requires the original key identity to decrypt.

#### Parameters

- `externalKeyID string` (path parameter)

  ID of the External Key.

  maxLength: 2048

- `body BetaOrganizationExternalKeyUpdateParams`

  - `DisplayName param.Opt[string] Optional`

    Human-friendly display name.

    minLength: 1, maxLength: 255

  - `Geo BetaOrganizationExternalKeyUpdateParamsGeo Optional`

    Data residency geo. Only `us` is supported.

    - `const BetaOrganizationExternalKeyUpdateParamsGeoUs BetaOrganizationExternalKeyUpdateParamsGeo = "us"`

  - `ProviderConfig BetaOrganizationExternalKeyUpdateParamsProviderConfigUnion Optional`

    KMS provider identity and auth coordinates.

    - `type BetaAWSExternalKeyConfig`

      - `Type AWS`

      - `KMSARN string`

        Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

        maxLength: 2048

      - `Region string Optional`

        AWS region. Derived from `kms_arn` if omitted.

      - `RoleARN string Optional`

        **Deprecated**

        IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

    - `type BetaGCPExternalKeyConfig`

      - `Type GCP`

      - `KeyName string`

        Full resource name of the Cloud KMS key.

    - `type BetaAzureExternalKeyConfigParam`

      Azure Key Vault provider configuration.

      - `Type Azure`

      - `KeyName string`

        Name of the key within the vault.

      - `TenantID string`

        Azure AD tenant ID.

      - `VaultURI string`

        Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or `https://{hsm-name}.managedhsm.azure.net`.

      - `ClientID string Optional`

        Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

#### Returns

- `type BetaExternalKey`

  CMEK external key config belonging to the caller's organization.

  Configs are organization-scoped. Workspaces attach to a config; once any
  workspace references it, the provider fields become effectively immutable
  (existing encrypted data needs the config for decrypt).

  - `Type ExternalKey`

    default: external_key

  - `ID string`

    Identifier of the external key config. A tagged ID prefixed `ekey_`, or — for organizations on the Claude Platform on AWS — the AWS KMS key ARN.

  - `Attachment BetaExternalKeyAttachmentUnion`

    Whether any workspace uses this config to encrypt its data — counting live and archived workspaces (an archived workspace's data remains encrypted under the config), excluding deleted ones. Only an attached config is used by the encryption path; an `unattached` config is inert and can be deleted.

    - `type BetaExternalKeyAttachedAttachment`

      - `Type Attached`

        default: attached

    - `type BetaExternalKeyUnattachedAttachment`

      - `Type Unattached`

        default: unattached

  - `CreatedAt Time`

    format: date-time

  - `DisplayName string`

    Human-friendly display name. Null if none was set.

  - `Geo string`

    Data residency geo. Selects which regional validator handles this key's encrypt/decrypt roundtrips.

  - `ProviderConfig BetaExternalKeyProviderConfigUnion`

    KMS provider identity and auth coordinates.

    - `type BetaAWSExternalKeyConfig`

      - `Type AWS`

      - `KMSARN string`

        Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

        maxLength: 2048

      - `Region string Optional`

        AWS region. Derived from `kms_arn` if omitted.

      - `RoleARN string Optional`

        **Deprecated**

        IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

    - `type BetaGCPExternalKeyConfig`

      - `Type GCP`

      - `KeyName string`

        Full resource name of the Cloud KMS key.

    - `type BetaAzureExternalKeyConfig`

      - `Type Azure`

      - `KeyName string`

        Name of the key within the vault.

      - `TenantID string`

        Azure AD tenant ID.

      - `VaultURI string`

        Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or `https://{hsm-name}.managedhsm.azure.net`.

      - `ClientID string Optional`

        Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

  - `UpdatedAt Time`

    format: date-time

#### 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"),
	)
	betaExternalKey, err := client.Beta.Organization.ExternalKeys.Update(
		context.TODO(),
		"external_key_id",
		anthropic.BetaOrganizationExternalKeyUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaExternalKey.ID)
}
```

##### Response (200)

```json
{
  "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "attachment": {
    "type": "attached"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "prod-us-key",
  "geo": "us",
  "provider_config": {
    "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
    "type": "aws",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
  },
  "type": "external_key",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Delete External Key

`client.Beta.Organization.ExternalKeys.Delete(ctx, externalKeyID) (*BetaOrganizationExternalKeyDeleteResponse, error)`

**DELETE** `/v1/organizations/external_keys/{external_key_id}`

Delete an external key config.

The request is rejected if any workspace still references this config.

#### Parameters

- `externalKeyID string` (path parameter)

  ID of the External Key.

  maxLength: 2048

#### Returns

- `type BetaOrganizationExternalKeyDeleteResponse`

  - `Type ExternalKeyDeleted`

    default: external_key_deleted

  - `ID string`

    ID of the deleted External Key.

#### 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"),
	)
	externalKey, err := client.Beta.Organization.ExternalKeys.Delete(context.TODO(), "external_key_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", externalKey.ID)
}
```

##### Response (200)

```json
{
  "id": "ekey_01AbCdEfGhIjKlMnOpQrStUv",
  "type": "external_key_deleted"
}
```

### Validate External Key

`client.Beta.Organization.ExternalKeys.Validate(ctx, externalKeyID) (*BetaOrganizationExternalKeyValidateResponse, error)`

**POST** `/v1/organizations/external_keys/{external_key_id}/validate`

Validate an external key config against the customer's KMS.

Anthropic performs an encrypt/decrypt roundtrip against the configured
KMS key and waits up to 30 seconds for the result. The response status is
`success` if the roundtrip succeeded, or `failure` with an error
message if it failed or timed out.

#### Parameters

- `externalKeyID string` (path parameter)

  ID of the External Key.

  maxLength: 2048

#### Returns

- `type BetaOrganizationExternalKeyValidateResponse`

  Result of a validation roundtrip against the customer's KMS.

  HTTP 200 for both outcomes — the operation completed; `status` says
  whether the key works.

  - `Type ExternalKeyValidation`

    default: external_key_validation

  - `Error string`

    Error message when status is `failure`. Null otherwise.

  - `Status BetaOrganizationExternalKeyValidateResponseStatus`

    `success` — encrypt/decrypt roundtrip succeeded. `failure` — the roundtrip failed or timed out; see `error`.

    - `const BetaOrganizationExternalKeyValidateResponseStatusFailure BetaOrganizationExternalKeyValidateResponseStatus = "failure"`

    - `const BetaOrganizationExternalKeyValidateResponseStatusSuccess BetaOrganizationExternalKeyValidateResponseStatus = "success"`

#### 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"),
	)
	response, err := client.Beta.Organization.ExternalKeys.Validate(context.TODO(), "external_key_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.Error)
}
```

##### Response (200)

```json
{
  "error": "error",
  "status": "failure",
  "type": "external_key_validation"
}
```

## Beta › Organization › Federation › Issuers

### Create Federation Issuer

`client.Beta.Organization.Federation.Issuers.New(ctx, params) (*BetaFederationIssuer, error)`

**POST** `/v1/organizations/federation_issuers`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Register an OIDC issuer that Anthropic will trust for workload identity
federation in your organization.

The `jwks` field controls how the issuer's signing keys are obtained and
takes one of three shapes selected by `type`: `discovery` (resolve keys
through OIDC discovery), `explicit_url` (fetch keys from a fixed JWKS
URL), or `inline` (provide a static key set). When `jwks.type` is
`discovery` and no `discovery_base` is set, the issuer URL must be
publicly reachable over HTTPS so Anthropic can fetch the discovery
document; for `explicit_url` and `inline` modes the issuer URL is only
matched as the JWT's `iss` claim and is not fetched.

#### Parameters

- `params BetaOrganizationFederationIssuerNewParams`

  - `IssuerURL string`

    The `iss` claim value to match against.

    minLength: 1

  - `Name string`

    Slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.

    minLength: 1, maxLength: 255

  - `CheckJTI param.Opt[bool] Optional`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Defaults to true. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `JWKS BetaOrganizationFederationIssuerNewParamsJWKSUnion Optional`

    How signing keys are obtained. Defaults to OIDC discovery.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `MaxJWTLifetimeSeconds param.Opt[int64] Optional`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Defaults to 3600 (1h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

    minimum: 1, maximum: 176400

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

#### Returns

- `type BetaFederationIssuer`

  Registered external OIDC identity provider.

  Records an external IdP the organization trusts for the RFC 7523
  jwt-bearer grant. The `issuer_url` must match the JWT `iss` claim exactly.

  - `Type FederationIssuer`

    default: federation_issuer

  - `ID string`

    Tagged ID of the federation issuer.

  - `ArchivedAt Time`

    If set, all rules referencing this issuer reject token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this issuer.

  - `CheckJTI bool`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `CreatedAt Time`

    When this issuer was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this issuer.

  - `IssuerURL string`

    The `iss` claim value. Incoming JWTs must match exactly.

  - `JWKS BetaFederationIssuerJWKSUnion`

    How signing keys are obtained for signature verification.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `JWKSPollingDisabledAt Time`

    If set, Anthropic's JWKS poller has paused polling for this issuer after repeated fetch failures. Re-enable by sending `jwks_polling_disabled: false` via the issuer update endpoint (POST) once the upstream JWKS endpoint is fixed. An OAuth caller cannot send this when the issuer backs a rule with any scope other than `workspace:developer` or `workspace:inference`; use a Console session.

    format: date-time

  - `MaxJWTLifetimeSeconds int64`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

  - `Name string`

    Admin-chosen slug identifier.

  - `PollStatus BetaFederationIssuerPollStatus`

    Live state of Anthropic's JWKS polling for this issuer. Populated on both single-issuer retrieval and list responses, including archived issuers. Typically null for inline-key issuers (no polling), or when poll status is temporarily unavailable or polling has not started yet.

    - `ConsecutiveFailures int64`

      Consecutive fetch failures since the last success.

    - `LastFetchedAt Time`

      When the last successful fetch completed.

      format: date-time

    - `NextPollAt Time`

      When the next fetch is scheduled. Null if paused.

      format: date-time

  - `UpdatedAt Time`

    When this issuer was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this issuer.

#### 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"),
	)
	betaFederationIssuer, err := client.Beta.Organization.Federation.Issuers.New(context.TODO(), anthropic.BetaOrganizationFederationIssuerNewParams{
		IssuerURL: "x",
		Name:      "x",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationIssuer.ID)
}
```

##### Response (200)

```json
{
  "id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "check_jti": true,
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "issuer_url": "https://token.actions.githubusercontent.com",
  "jwks": {
    "type": "discovery",
    "ca_cert_pem": "ca_cert_pem",
    "discovery_base": "discovery_base"
  },
  "jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
  "max_jwt_lifetime_seconds": 0,
  "name": "github-actions",
  "poll_status": {
    "consecutive_failures": 0,
    "last_fetched_at": "2019-12-27T18:11:19.117Z",
    "next_poll_at": "2019-12-27T18:11:19.117Z"
  },
  "type": "federation_issuer",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

### List Federation Issuers

`client.Beta.Organization.Federation.Issuers.List(ctx, params) (*PageCursor[BetaFederationIssuer], error)`

**GET** `/v1/organizations/federation_issuers`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

List federation issuers in your organization.

Archived issuers are excluded unless `include_archived=true`.

#### Parameters

- `params BetaOrganizationFederationIssuerListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Include archived resources. Defaults to false.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

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

#### Returns

- `type BetaFederationIssuer`

  Registered external OIDC identity provider.

  Records an external IdP the organization trusts for the RFC 7523
  jwt-bearer grant. The `issuer_url` must match the JWT `iss` claim exactly.

  - `Type FederationIssuer`

    default: federation_issuer

  - `ID string`

    Tagged ID of the federation issuer.

  - `ArchivedAt Time`

    If set, all rules referencing this issuer reject token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this issuer.

  - `CheckJTI bool`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `CreatedAt Time`

    When this issuer was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this issuer.

  - `IssuerURL string`

    The `iss` claim value. Incoming JWTs must match exactly.

  - `JWKS BetaFederationIssuerJWKSUnion`

    How signing keys are obtained for signature verification.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `JWKSPollingDisabledAt Time`

    If set, Anthropic's JWKS poller has paused polling for this issuer after repeated fetch failures. Re-enable by sending `jwks_polling_disabled: false` via the issuer update endpoint (POST) once the upstream JWKS endpoint is fixed. An OAuth caller cannot send this when the issuer backs a rule with any scope other than `workspace:developer` or `workspace:inference`; use a Console session.

    format: date-time

  - `MaxJWTLifetimeSeconds int64`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

  - `Name string`

    Admin-chosen slug identifier.

  - `PollStatus BetaFederationIssuerPollStatus`

    Live state of Anthropic's JWKS polling for this issuer. Populated on both single-issuer retrieval and list responses, including archived issuers. Typically null for inline-key issuers (no polling), or when poll status is temporarily unavailable or polling has not started yet.

    - `ConsecutiveFailures int64`

      Consecutive fetch failures since the last success.

    - `LastFetchedAt Time`

      When the last successful fetch completed.

      format: date-time

    - `NextPollAt Time`

      When the next fetch is scheduled. Null if paused.

      format: date-time

  - `UpdatedAt Time`

    When this issuer was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this issuer.

#### 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"),
	)
	page, err := client.Beta.Organization.Federation.Issuers.List(context.TODO(), anthropic.BetaOrganizationFederationIssuerListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "archived_by_actor_id": "archived_by_actor_id",
      "check_jti": true,
      "created_at": "2024-10-30T23:58:27.427722Z",
      "created_by_actor_id": "created_by_actor_id",
      "issuer_url": "https://token.actions.githubusercontent.com",
      "jwks": {
        "type": "discovery",
        "ca_cert_pem": "ca_cert_pem",
        "discovery_base": "discovery_base"
      },
      "jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
      "max_jwt_lifetime_seconds": 0,
      "name": "github-actions",
      "poll_status": {
        "consecutive_failures": 0,
        "last_fetched_at": "2019-12-27T18:11:19.117Z",
        "next_poll_at": "2019-12-27T18:11:19.117Z"
      },
      "type": "federation_issuer",
      "updated_at": "2024-10-30T23:58:27.427722Z",
      "updated_by_actor_id": "updated_by_actor_id"
    }
  ],
  "next_page": "next_page"
}
```

### Get Federation Issuer

`client.Beta.Organization.Federation.Issuers.Get(ctx, federationIssuerID, query) (*BetaFederationIssuer, error)`

**GET** `/v1/organizations/federation_issuers/{federation_issuer_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Retrieve a federation issuer by its ID (`fdis_...`).

#### Parameters

- `federationIssuerID string` (path parameter)

  ID of the federation issuer.

- `query BetaOrganizationFederationIssuerGetParams`

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

#### Returns

- `type BetaFederationIssuer`

  Registered external OIDC identity provider.

  Records an external IdP the organization trusts for the RFC 7523
  jwt-bearer grant. The `issuer_url` must match the JWT `iss` claim exactly.

  - `Type FederationIssuer`

    default: federation_issuer

  - `ID string`

    Tagged ID of the federation issuer.

  - `ArchivedAt Time`

    If set, all rules referencing this issuer reject token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this issuer.

  - `CheckJTI bool`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `CreatedAt Time`

    When this issuer was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this issuer.

  - `IssuerURL string`

    The `iss` claim value. Incoming JWTs must match exactly.

  - `JWKS BetaFederationIssuerJWKSUnion`

    How signing keys are obtained for signature verification.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `JWKSPollingDisabledAt Time`

    If set, Anthropic's JWKS poller has paused polling for this issuer after repeated fetch failures. Re-enable by sending `jwks_polling_disabled: false` via the issuer update endpoint (POST) once the upstream JWKS endpoint is fixed. An OAuth caller cannot send this when the issuer backs a rule with any scope other than `workspace:developer` or `workspace:inference`; use a Console session.

    format: date-time

  - `MaxJWTLifetimeSeconds int64`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

  - `Name string`

    Admin-chosen slug identifier.

  - `PollStatus BetaFederationIssuerPollStatus`

    Live state of Anthropic's JWKS polling for this issuer. Populated on both single-issuer retrieval and list responses, including archived issuers. Typically null for inline-key issuers (no polling), or when poll status is temporarily unavailable or polling has not started yet.

    - `ConsecutiveFailures int64`

      Consecutive fetch failures since the last success.

    - `LastFetchedAt Time`

      When the last successful fetch completed.

      format: date-time

    - `NextPollAt Time`

      When the next fetch is scheduled. Null if paused.

      format: date-time

  - `UpdatedAt Time`

    When this issuer was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this issuer.

#### 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"),
	)
	betaFederationIssuer, err := client.Beta.Organization.Federation.Issuers.Get(
		context.TODO(),
		"federation_issuer_id",
		anthropic.BetaOrganizationFederationIssuerGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationIssuer.ID)
}
```

##### Response (200)

```json
{
  "id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "check_jti": true,
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "issuer_url": "https://token.actions.githubusercontent.com",
  "jwks": {
    "type": "discovery",
    "ca_cert_pem": "ca_cert_pem",
    "discovery_base": "discovery_base"
  },
  "jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
  "max_jwt_lifetime_seconds": 0,
  "name": "github-actions",
  "poll_status": {
    "consecutive_failures": 0,
    "last_fetched_at": "2019-12-27T18:11:19.117Z",
    "next_poll_at": "2019-12-27T18:11:19.117Z"
  },
  "type": "federation_issuer",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

### Update Federation Issuer

`client.Beta.Organization.Federation.Issuers.Update(ctx, federationIssuerID, params) (*BetaFederationIssuer, error)`

**POST** `/v1/organizations/federation_issuers/{federation_issuer_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Partially update a federation issuer.

Setting `jwks` replaces the full JWKS shape at once. Archived issuers
cannot be updated; this returns 400. Create a new issuer instead.

Updating an issuer that backs a rule with a scope outside
`workspace:developer` or `workspace:inference` requires a Console
session.

#### Parameters

- `federationIssuerID string` (path parameter)

  ID of the federation issuer to update.

- `params BetaOrganizationFederationIssuerUpdateParams`

  - `CheckJTI param.Opt[bool] Optional`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `IssuerURL param.Opt[string] Optional`

    Replaces the `iss` claim value to match against. For discovery-mode issuers without a `discovery_base`, this is also the URL Anthropic fetches the OIDC discovery document and signing keys from, so changing it repoints the JWKS source. Changing the issuer URL to a well-known shared platform is rejected while any live rule under this issuer would not constrain tenant identity.

    minLength: 1

  - `JWKS BetaOrganizationFederationIssuerUpdateParamsJWKSUnion Optional`

    Replaces the entire JWKS configuration.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `JWKSPollingDisabled param.Opt[bool] Optional`

    Only `false` is accepted, to re-enable polling after the system pauses it. Polling is paused automatically; sending `true` is rejected.

  - `MaxJWTLifetimeSeconds param.Opt[int64] Optional`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

    minimum: 1, maximum: 176400

  - `Name param.Opt[string] Optional`

    Replaces the slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.

    minLength: 1, maxLength: 255

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

#### Returns

- `type BetaFederationIssuer`

  Registered external OIDC identity provider.

  Records an external IdP the organization trusts for the RFC 7523
  jwt-bearer grant. The `issuer_url` must match the JWT `iss` claim exactly.

  - `Type FederationIssuer`

    default: federation_issuer

  - `ID string`

    Tagged ID of the federation issuer.

  - `ArchivedAt Time`

    If set, all rules referencing this issuer reject token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this issuer.

  - `CheckJTI bool`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `CreatedAt Time`

    When this issuer was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this issuer.

  - `IssuerURL string`

    The `iss` claim value. Incoming JWTs must match exactly.

  - `JWKS BetaFederationIssuerJWKSUnion`

    How signing keys are obtained for signature verification.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `JWKSPollingDisabledAt Time`

    If set, Anthropic's JWKS poller has paused polling for this issuer after repeated fetch failures. Re-enable by sending `jwks_polling_disabled: false` via the issuer update endpoint (POST) once the upstream JWKS endpoint is fixed. An OAuth caller cannot send this when the issuer backs a rule with any scope other than `workspace:developer` or `workspace:inference`; use a Console session.

    format: date-time

  - `MaxJWTLifetimeSeconds int64`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

  - `Name string`

    Admin-chosen slug identifier.

  - `PollStatus BetaFederationIssuerPollStatus`

    Live state of Anthropic's JWKS polling for this issuer. Populated on both single-issuer retrieval and list responses, including archived issuers. Typically null for inline-key issuers (no polling), or when poll status is temporarily unavailable or polling has not started yet.

    - `ConsecutiveFailures int64`

      Consecutive fetch failures since the last success.

    - `LastFetchedAt Time`

      When the last successful fetch completed.

      format: date-time

    - `NextPollAt Time`

      When the next fetch is scheduled. Null if paused.

      format: date-time

  - `UpdatedAt Time`

    When this issuer was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this issuer.

#### 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"),
	)
	betaFederationIssuer, err := client.Beta.Organization.Federation.Issuers.Update(
		context.TODO(),
		"federation_issuer_id",
		anthropic.BetaOrganizationFederationIssuerUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationIssuer.ID)
}
```

##### Response (200)

```json
{
  "id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "check_jti": true,
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "issuer_url": "https://token.actions.githubusercontent.com",
  "jwks": {
    "type": "discovery",
    "ca_cert_pem": "ca_cert_pem",
    "discovery_base": "discovery_base"
  },
  "jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
  "max_jwt_lifetime_seconds": 0,
  "name": "github-actions",
  "poll_status": {
    "consecutive_failures": 0,
    "last_fetched_at": "2019-12-27T18:11:19.117Z",
    "next_poll_at": "2019-12-27T18:11:19.117Z"
  },
  "type": "federation_issuer",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

### Archive Federation Issuer

`client.Beta.Organization.Federation.Issuers.Archive(ctx, federationIssuerID, body) (*BetaFederationIssuer, error)`

**POST** `/v1/organizations/federation_issuers/{federation_issuer_id}/archive`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Archive a federation issuer.

Idempotent; re-archiving returns the issuer with its original
`archived_at`. Rejected with 400 if any live (non-archived) federation
rule still references the issuer; archive those rules first (a rule's
issuer cannot be changed), or recreate them against another issuer.

#### Parameters

- `federationIssuerID string` (path parameter)

  ID of the federation issuer to archive.

- `body BetaOrganizationFederationIssuerArchiveParams`

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

#### Returns

- `type BetaFederationIssuer`

  Registered external OIDC identity provider.

  Records an external IdP the organization trusts for the RFC 7523
  jwt-bearer grant. The `issuer_url` must match the JWT `iss` claim exactly.

  - `Type FederationIssuer`

    default: federation_issuer

  - `ID string`

    Tagged ID of the federation issuer.

  - `ArchivedAt Time`

    If set, all rules referencing this issuer reject token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this issuer.

  - `CheckJTI bool`

    Whether the jwt-bearer exchange enforces JTI single-use (replay protection) for tokens from this issuer. Applies only to assertions carrying a `jti` claim; tokens without one are accepted without single-use enforcement.

  - `CreatedAt Time`

    When this issuer was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this issuer.

  - `IssuerURL string`

    The `iss` claim value. Incoming JWTs must match exactly.

  - `JWKS BetaFederationIssuerJWKSUnion`

    How signing keys are obtained for signature verification.

    - `type BetaJWKSDiscovery`

      JWKS via the issuer's OIDC discovery document.

      - `Type Discovery`

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

      - `DiscoveryBase string Optional`

        Set when the discovery URL differs from `issuer_url`.

    - `type BetaJWKSExplicitURL`

      JWKS fetched from a fixed endpoint.

      - `Type ExplicitURL`

      - `URL string`

        JWKS endpoint.

        minLength: 1

      - `CACertPEM string Optional`

        Optional custom CA (PEM) for TLS verification of the JWKS fetch.

        maxLength: 8192

    - `type BetaJWKSInline`

      JWKS supplied directly; no network fetch.

      - `Type Inline`

      - `Keys []map[string, any]`

        Inline JWK objects.

        minItems: 1

  - `JWKSPollingDisabledAt Time`

    If set, Anthropic's JWKS poller has paused polling for this issuer after repeated fetch failures. Re-enable by sending `jwks_polling_disabled: false` via the issuer update endpoint (POST) once the upstream JWKS endpoint is fixed. An OAuth caller cannot send this when the issuer backs a rule with any scope other than `workspace:developer` or `workspace:inference`; use a Console session.

    format: date-time

  - `MaxJWTLifetimeSeconds int64`

    Maximum allowed iat→exp spread for assertions from this issuer (1-176400 seconds, i.e. up to 49h). Assertions must carry both `iat` and `exp`; a missing `iat` is rejected.

  - `Name string`

    Admin-chosen slug identifier.

  - `PollStatus BetaFederationIssuerPollStatus`

    Live state of Anthropic's JWKS polling for this issuer. Populated on both single-issuer retrieval and list responses, including archived issuers. Typically null for inline-key issuers (no polling), or when poll status is temporarily unavailable or polling has not started yet.

    - `ConsecutiveFailures int64`

      Consecutive fetch failures since the last success.

    - `LastFetchedAt Time`

      When the last successful fetch completed.

      format: date-time

    - `NextPollAt Time`

      When the next fetch is scheduled. Null if paused.

      format: date-time

  - `UpdatedAt Time`

    When this issuer was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this issuer.

#### 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"),
	)
	betaFederationIssuer, err := client.Beta.Organization.Federation.Issuers.Archive(
		context.TODO(),
		"federation_issuer_id",
		anthropic.BetaOrganizationFederationIssuerArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationIssuer.ID)
}
```

##### Response (200)

```json
{
  "id": "fdis_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "check_jti": true,
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "issuer_url": "https://token.actions.githubusercontent.com",
  "jwks": {
    "type": "discovery",
    "ca_cert_pem": "ca_cert_pem",
    "discovery_base": "discovery_base"
  },
  "jwks_polling_disabled_at": "2019-12-27T18:11:19.117Z",
  "max_jwt_lifetime_seconds": 0,
  "name": "github-actions",
  "poll_status": {
    "consecutive_failures": 0,
    "last_fetched_at": "2019-12-27T18:11:19.117Z",
    "next_poll_at": "2019-12-27T18:11:19.117Z"
  },
  "type": "federation_issuer",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

## Beta › Organization › Federation › Rules

### Create Federation Rule

`client.Beta.Organization.Federation.Rules.New(ctx, params) (*BetaFederationRule, error)`

**POST** `/v1/organizations/federation_rules`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Create a federation rule owned by your organization.

The referenced issuer and the target service account must already exist
in the same organization; invalid references are rejected with a 400
error. The workspace reference is validated. Membership is not checked
at rule creation: token exchange resolves a single enabled workspace per
call and is rejected unless the target service account is a member of
that workspace (it is implicitly a member of the default workspace).
Rules on well-known shared issuers (GitHub Actions, GitLab, Buildkite,
Terraform Cloud, Google) must constrain tenant identity via an
identity-bearing claim, a tenant-pinning subject prefix (such as
`repo:YOUR_ORG/...`), or a CEL condition referencing one of those
identity claims (e.g. `claims.repository_owner`). OAuth callers may only
manage rules whose `oauth_scope` is `workspace:developer` or
`workspace:inference`; other scopes require a Console session.

#### Parameters

- `params BetaOrganizationFederationRuleNewParams`

  - `IssuerID string`

    Tagged ID of the federation issuer.

  - `Match BetaFederationRuleMatchParam`

    Conditions the verified JWT must satisfy for this rule to apply. At least one of `subject_prefix` (other than a wildcard-only value like `*`), `claims`, or `condition` is required; `audience` alone is not sufficient.

  - `Name string`

    Slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.

    minLength: 1, maxLength: 255

  - `OAuthScope string`

    Space-separated OAuth scopes. OAuth callers may only set `workspace:developer` or `workspace:inference`; other scopes (such as `org:admin`) require a Console session.

    minLength: 1

  - `Target BetaServiceAccountTargetParam`

    Identity that tokens minted via this rule act as. Currently always a `service_account` target.

  - `AppliesToAllWorkspaces param.Opt[bool] Optional`

    When true, enable this rule for every workspace in the org (including workspaces created later).

  - `Attributes map[string, string] Optional`

    CEL expressions `{name: expr}` extracting named values from claims. Not yet supported; any non-empty value is rejected with 400.

  - `Description param.Opt[string] Optional`

    Optional free-text description.

    maxLength: 2000

  - `TokenLifetimeSeconds param.Opt[int64] Optional`

    Lifetime in seconds for access tokens minted via this rule (60-86400). Defaults to 3600 (1h). Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

    minimum: 60, maximum: 86400

  - `WorkspaceID param.Opt[string] Optional`

    Tagged ID of the workspace to enable this rule for. Required unless `applies_to_all_workspaces` is true. Additional workspaces can be added via the `/federation_rules/{federation_rule_id}/workspaces` sub-resource.

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

#### Returns

- `type BetaFederationRule`

  Authorization rule binding an external OIDC identity to Anthropic.

  Evaluates the match conditions and mints an OAuth access token for the
  resolved target, scoped to a single workspace where the rule is enabled
  (chosen by the caller at exchange time when the rule is enabled for more
  than one). For rules enabled via `workspace_ids` or
  `applies_to_all_workspaces`, the target service account must be a member
  of that workspace (it is implicitly a member of the default workspace);
  rules carrying only the legacy `workspace_id` binding do not enforce
  this.

  - `Type FederationRule`

    default: federation_rule

  - `ID string`

    Tagged ID of the federation rule.

  - `AppliesToAllWorkspaces bool`

    When true, this rule is enabled for every workspace in the org (including ones created after the rule). `workspace_ids` is ignored at exchange time.

  - `ArchivedAt Time`

    If set, this rule is archived and rejects token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this rule.

  - `Attributes map[string, string]`

    CEL expressions extracting named values from claims. Not yet supported; always null.

  - `CreatedAt Time`

    When this rule was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this rule.

  - `Description string`

    Optional free-text description.

  - `IssuerID string`

    Tagged ID of the issuer whose tokens this rule accepts.

  - `IssuerName string`

    Issuer's display name at read time.

  - `Match BetaFederationRuleMatch`

    Conditions the verified JWT must satisfy for this rule to apply. All populated matcher fields must pass.

    - `Audience string Optional`

      Exact match against the `aud` claim (any element if array). When omitted, the JWT's `aud` must still equal Anthropic's expected audience for the issuer; setting this field overrides that default.

      maxLength: 1024

    - `Claims map[string, string] Optional`

      Exact-match `{claim: value}` pairs against top-level claims. Only string-valued claims can be matched; use `condition` for non-string claims.

    - `Condition string Optional`

      CEL expression over claims for logic the structural fields can't express. Must evaluate to a boolean and may reference only the `claims` variable; a constant-true expression (such as `true`) is rejected with 400.

      maxLength: 4096

    - `SubjectPrefix string Optional`

      Match the verified JWT `sub` claim. Exact match unless the value ends with `*`, in which case it is a prefix match. Example: `repo:my-org/my-repo:ref:refs/heads/main`.

      maxLength: 1024

  - `Name string`

    Admin-chosen slug identifier.

  - `OAuthScope string`

    Space-separated OAuth scopes granted on the minted token.

  - `Target BetaServiceAccountTarget`

    What this rule targets. Check `type` before reading the other fields. Tokens minted via a rule whose target `type` is `service_account` act as that service account.

    - `Type ServiceAccount`

    - `ServiceAccountID string`

      Tagged ID of the service account to mint tokens for.

    - `ServiceAccountName string Optional`

      Service account's display name at read time. Ignored on writes.

  - `TokenLifetimeSeconds int64`

    Lifetime in seconds of access tokens minted via this rule. Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

  - `UpdatedAt Time`

    When this rule was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this rule.

  - `WorkspaceID string`

    Legacy single-workspace binding. Prefer `workspace_ids` and the `/federation_rules/{federation_rule_id}/workspaces` sub-resource for managing workspace enablement.

  - `WorkspaceIDs []string`

    Tagged IDs of the workspaces this rule is enabled for. May be empty for older rules that only carry the legacy `workspace_id` binding. Ignored at exchange time when `applies_to_all_workspaces` is true (the list may still be non-empty).

#### 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"),
	)
	betaFederationRule, err := client.Beta.Organization.Federation.Rules.New(context.TODO(), anthropic.BetaOrganizationFederationRuleNewParams{
		IssuerID:   "issuer_id",
		Match:      anthropic.BetaFederationRuleMatchParam{},
		Name:       "x",
		OAuthScope: "x",
		Target: anthropic.BetaServiceAccountTargetParam{
			ServiceAccountID: "svac_01SDCCSbTxrXDpWc1phhtcfK",
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationRule.ID)
}
```

##### Response (200)

```json
{
  "id": "fdrl_01SDCCSbTxrXDpWc1phhtcfK",
  "applies_to_all_workspaces": true,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "attributes": {
    "foo": "string"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "issuer_id": "issuer_id",
  "issuer_name": "issuer_name",
  "match": {
    "audience": "audience",
    "claims": {
      "foo": "string"
    },
    "condition": "condition",
    "subject_prefix": "subject_prefix"
  },
  "name": "prod-deploy-pipeline",
  "oauth_scope": "oauth_scope",
  "target": {
    "service_account_id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
    "type": "service_account",
    "service_account_name": "service_account_name"
  },
  "token_lifetime_seconds": 0,
  "type": "federation_rule",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id",
  "workspace_id": "workspace_id",
  "workspace_ids": [
    "string"
  ]
}
```

### List Federation Rules

`client.Beta.Organization.Federation.Rules.List(ctx, params) (*PageCursor[BetaFederationRule], error)`

**GET** `/v1/organizations/federation_rules`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

List federation rules in your organization.

Optionally filter by issuer with `issuer_id`. Archived rules are excluded
unless `include_archived=true`.

#### Parameters

- `params BetaOrganizationFederationRuleListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Include archived resources. Defaults to false.

  - `IssuerID param.Opt[string] Optional` (query parameter)

    Filter to rules referencing this federation issuer.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

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

#### Returns

- `type BetaFederationRule`

  Authorization rule binding an external OIDC identity to Anthropic.

  Evaluates the match conditions and mints an OAuth access token for the
  resolved target, scoped to a single workspace where the rule is enabled
  (chosen by the caller at exchange time when the rule is enabled for more
  than one). For rules enabled via `workspace_ids` or
  `applies_to_all_workspaces`, the target service account must be a member
  of that workspace (it is implicitly a member of the default workspace);
  rules carrying only the legacy `workspace_id` binding do not enforce
  this.

  - `Type FederationRule`

    default: federation_rule

  - `ID string`

    Tagged ID of the federation rule.

  - `AppliesToAllWorkspaces bool`

    When true, this rule is enabled for every workspace in the org (including ones created after the rule). `workspace_ids` is ignored at exchange time.

  - `ArchivedAt Time`

    If set, this rule is archived and rejects token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this rule.

  - `Attributes map[string, string]`

    CEL expressions extracting named values from claims. Not yet supported; always null.

  - `CreatedAt Time`

    When this rule was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this rule.

  - `Description string`

    Optional free-text description.

  - `IssuerID string`

    Tagged ID of the issuer whose tokens this rule accepts.

  - `IssuerName string`

    Issuer's display name at read time.

  - `Match BetaFederationRuleMatch`

    Conditions the verified JWT must satisfy for this rule to apply. All populated matcher fields must pass.

    - `Audience string Optional`

      Exact match against the `aud` claim (any element if array). When omitted, the JWT's `aud` must still equal Anthropic's expected audience for the issuer; setting this field overrides that default.

      maxLength: 1024

    - `Claims map[string, string] Optional`

      Exact-match `{claim: value}` pairs against top-level claims. Only string-valued claims can be matched; use `condition` for non-string claims.

    - `Condition string Optional`

      CEL expression over claims for logic the structural fields can't express. Must evaluate to a boolean and may reference only the `claims` variable; a constant-true expression (such as `true`) is rejected with 400.

      maxLength: 4096

    - `SubjectPrefix string Optional`

      Match the verified JWT `sub` claim. Exact match unless the value ends with `*`, in which case it is a prefix match. Example: `repo:my-org/my-repo:ref:refs/heads/main`.

      maxLength: 1024

  - `Name string`

    Admin-chosen slug identifier.

  - `OAuthScope string`

    Space-separated OAuth scopes granted on the minted token.

  - `Target BetaServiceAccountTarget`

    What this rule targets. Check `type` before reading the other fields. Tokens minted via a rule whose target `type` is `service_account` act as that service account.

    - `Type ServiceAccount`

    - `ServiceAccountID string`

      Tagged ID of the service account to mint tokens for.

    - `ServiceAccountName string Optional`

      Service account's display name at read time. Ignored on writes.

  - `TokenLifetimeSeconds int64`

    Lifetime in seconds of access tokens minted via this rule. Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

  - `UpdatedAt Time`

    When this rule was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this rule.

  - `WorkspaceID string`

    Legacy single-workspace binding. Prefer `workspace_ids` and the `/federation_rules/{federation_rule_id}/workspaces` sub-resource for managing workspace enablement.

  - `WorkspaceIDs []string`

    Tagged IDs of the workspaces this rule is enabled for. May be empty for older rules that only carry the legacy `workspace_id` binding. Ignored at exchange time when `applies_to_all_workspaces` is true (the list may still be non-empty).

#### 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"),
	)
	page, err := client.Beta.Organization.Federation.Rules.List(context.TODO(), anthropic.BetaOrganizationFederationRuleListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "fdrl_01SDCCSbTxrXDpWc1phhtcfK",
      "applies_to_all_workspaces": true,
      "archived_at": "2019-12-27T18:11:19.117Z",
      "archived_by_actor_id": "archived_by_actor_id",
      "attributes": {
        "foo": "string"
      },
      "created_at": "2024-10-30T23:58:27.427722Z",
      "created_by_actor_id": "created_by_actor_id",
      "description": "description",
      "issuer_id": "issuer_id",
      "issuer_name": "issuer_name",
      "match": {
        "audience": "audience",
        "claims": {
          "foo": "string"
        },
        "condition": "condition",
        "subject_prefix": "subject_prefix"
      },
      "name": "prod-deploy-pipeline",
      "oauth_scope": "oauth_scope",
      "target": {
        "service_account_id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
        "type": "service_account",
        "service_account_name": "service_account_name"
      },
      "token_lifetime_seconds": 0,
      "type": "federation_rule",
      "updated_at": "2024-10-30T23:58:27.427722Z",
      "updated_by_actor_id": "updated_by_actor_id",
      "workspace_id": "workspace_id",
      "workspace_ids": [
        "string"
      ]
    }
  ],
  "next_page": "next_page"
}
```

### Get Federation Rule

`client.Beta.Organization.Federation.Rules.Get(ctx, federationRuleID, query) (*BetaFederationRule, error)`

**GET** `/v1/organizations/federation_rules/{federation_rule_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Retrieve a federation rule by its ID (`fdrl_...`).

#### Parameters

- `federationRuleID string` (path parameter)

  ID of the federation rule.

- `query BetaOrganizationFederationRuleGetParams`

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

#### Returns

- `type BetaFederationRule`

  Authorization rule binding an external OIDC identity to Anthropic.

  Evaluates the match conditions and mints an OAuth access token for the
  resolved target, scoped to a single workspace where the rule is enabled
  (chosen by the caller at exchange time when the rule is enabled for more
  than one). For rules enabled via `workspace_ids` or
  `applies_to_all_workspaces`, the target service account must be a member
  of that workspace (it is implicitly a member of the default workspace);
  rules carrying only the legacy `workspace_id` binding do not enforce
  this.

  - `Type FederationRule`

    default: federation_rule

  - `ID string`

    Tagged ID of the federation rule.

  - `AppliesToAllWorkspaces bool`

    When true, this rule is enabled for every workspace in the org (including ones created after the rule). `workspace_ids` is ignored at exchange time.

  - `ArchivedAt Time`

    If set, this rule is archived and rejects token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this rule.

  - `Attributes map[string, string]`

    CEL expressions extracting named values from claims. Not yet supported; always null.

  - `CreatedAt Time`

    When this rule was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this rule.

  - `Description string`

    Optional free-text description.

  - `IssuerID string`

    Tagged ID of the issuer whose tokens this rule accepts.

  - `IssuerName string`

    Issuer's display name at read time.

  - `Match BetaFederationRuleMatch`

    Conditions the verified JWT must satisfy for this rule to apply. All populated matcher fields must pass.

    - `Audience string Optional`

      Exact match against the `aud` claim (any element if array). When omitted, the JWT's `aud` must still equal Anthropic's expected audience for the issuer; setting this field overrides that default.

      maxLength: 1024

    - `Claims map[string, string] Optional`

      Exact-match `{claim: value}` pairs against top-level claims. Only string-valued claims can be matched; use `condition` for non-string claims.

    - `Condition string Optional`

      CEL expression over claims for logic the structural fields can't express. Must evaluate to a boolean and may reference only the `claims` variable; a constant-true expression (such as `true`) is rejected with 400.

      maxLength: 4096

    - `SubjectPrefix string Optional`

      Match the verified JWT `sub` claim. Exact match unless the value ends with `*`, in which case it is a prefix match. Example: `repo:my-org/my-repo:ref:refs/heads/main`.

      maxLength: 1024

  - `Name string`

    Admin-chosen slug identifier.

  - `OAuthScope string`

    Space-separated OAuth scopes granted on the minted token.

  - `Target BetaServiceAccountTarget`

    What this rule targets. Check `type` before reading the other fields. Tokens minted via a rule whose target `type` is `service_account` act as that service account.

    - `Type ServiceAccount`

    - `ServiceAccountID string`

      Tagged ID of the service account to mint tokens for.

    - `ServiceAccountName string Optional`

      Service account's display name at read time. Ignored on writes.

  - `TokenLifetimeSeconds int64`

    Lifetime in seconds of access tokens minted via this rule. Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

  - `UpdatedAt Time`

    When this rule was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this rule.

  - `WorkspaceID string`

    Legacy single-workspace binding. Prefer `workspace_ids` and the `/federation_rules/{federation_rule_id}/workspaces` sub-resource for managing workspace enablement.

  - `WorkspaceIDs []string`

    Tagged IDs of the workspaces this rule is enabled for. May be empty for older rules that only carry the legacy `workspace_id` binding. Ignored at exchange time when `applies_to_all_workspaces` is true (the list may still be non-empty).

#### 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"),
	)
	betaFederationRule, err := client.Beta.Organization.Federation.Rules.Get(
		context.TODO(),
		"federation_rule_id",
		anthropic.BetaOrganizationFederationRuleGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationRule.ID)
}
```

##### Response (200)

```json
{
  "id": "fdrl_01SDCCSbTxrXDpWc1phhtcfK",
  "applies_to_all_workspaces": true,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "attributes": {
    "foo": "string"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "issuer_id": "issuer_id",
  "issuer_name": "issuer_name",
  "match": {
    "audience": "audience",
    "claims": {
      "foo": "string"
    },
    "condition": "condition",
    "subject_prefix": "subject_prefix"
  },
  "name": "prod-deploy-pipeline",
  "oauth_scope": "oauth_scope",
  "target": {
    "service_account_id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
    "type": "service_account",
    "service_account_name": "service_account_name"
  },
  "token_lifetime_seconds": 0,
  "type": "federation_rule",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id",
  "workspace_id": "workspace_id",
  "workspace_ids": [
    "string"
  ]
}
```

### Update Federation Rule

`client.Beta.Organization.Federation.Rules.Update(ctx, federationRuleID, params) (*BetaFederationRule, error)`

**POST** `/v1/organizations/federation_rules/{federation_rule_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Partially update a federation rule.

`issuer_id` is immutable. `match` and `target` are replaced as whole
objects when set. Referenced service accounts and workspaces must exist
in your organization; invalid references are rejected with a 400 error.
Archived rules cannot be updated; this returns 400. Create a new rule
instead. Rules on well-known shared issuers (GitHub Actions, GitLab,
Buildkite, Terraform Cloud, Google) must constrain tenant identity via
an identity-bearing claim, a tenant-pinning subject prefix (such as
`repo:YOUR_ORG/...`), or a CEL condition referencing one of those
identity claims (e.g. `claims.repository_owner`). On these issuers the
requirement is re-checked on every update; if an existing rule's stored
match does not yet constrain tenant identity, any update (even a rename
or description change) must also supply a conforming `match` in the same
request. OAuth callers may only manage rules whose `oauth_scope` is
`workspace:developer` or `workspace:inference`; other scopes require a
Console session.

#### Parameters

- `federationRuleID string` (path parameter)

  ID of the federation rule to update.

- `params BetaOrganizationFederationRuleUpdateParams`

  - `AppliesToAllWorkspaces param.Opt[bool] Optional`

    When true, enables this rule for every workspace in the org (including workspaces created later). Setting `false` is rejected with 400 if no workspace would remain enabled; a rule with only a legacy `workspace_id` binding continues to mint.

  - `Attributes map[string, string] Optional`

    Replaces the CEL expressions `{name: expr}` extracting named values from claims. Send null to clear them. Not yet supported; any non-empty value is rejected with 400.

  - `Description param.Opt[string] Optional`

    Replaces the description. Omit to leave unchanged; send `null` to clear (the field is stored as an empty string).

    maxLength: 2000

  - `Match BetaFederationRuleMatchParam Optional`

    Replaces the entire match object. All populated matcher fields must pass.

  - `Name param.Opt[string] Optional`

    Replaces the slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.

    minLength: 1, maxLength: 255

  - `OAuthScope param.Opt[string] Optional`

    Replaces the space-separated OAuth scopes granted on minted tokens. OAuth callers may only set `workspace:developer` or `workspace:inference`; other scopes (such as `org:admin`) require a Console session.

    minLength: 1

  - `Target BetaServiceAccountTargetParam Optional`

    Replaces the entire target object. Currently always a `service_account` target.

  - `TokenLifetimeSeconds param.Opt[int64] Optional`

    Replaces the lifetime in seconds for access tokens minted via this rule (60-86400). Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

    minimum: 60, maximum: 86400

  - `WorkspaceID param.Opt[string] Optional`

    Replaces the existing single workspace enablement (the previous one is removed). Rejected with 400 if the rule is enabled for more than one workspace; use the `/federation_rules/{federation_rule_id}/workspaces` sub-resource instead.

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

#### Returns

- `type BetaFederationRule`

  Authorization rule binding an external OIDC identity to Anthropic.

  Evaluates the match conditions and mints an OAuth access token for the
  resolved target, scoped to a single workspace where the rule is enabled
  (chosen by the caller at exchange time when the rule is enabled for more
  than one). For rules enabled via `workspace_ids` or
  `applies_to_all_workspaces`, the target service account must be a member
  of that workspace (it is implicitly a member of the default workspace);
  rules carrying only the legacy `workspace_id` binding do not enforce
  this.

  - `Type FederationRule`

    default: federation_rule

  - `ID string`

    Tagged ID of the federation rule.

  - `AppliesToAllWorkspaces bool`

    When true, this rule is enabled for every workspace in the org (including ones created after the rule). `workspace_ids` is ignored at exchange time.

  - `ArchivedAt Time`

    If set, this rule is archived and rejects token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this rule.

  - `Attributes map[string, string]`

    CEL expressions extracting named values from claims. Not yet supported; always null.

  - `CreatedAt Time`

    When this rule was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this rule.

  - `Description string`

    Optional free-text description.

  - `IssuerID string`

    Tagged ID of the issuer whose tokens this rule accepts.

  - `IssuerName string`

    Issuer's display name at read time.

  - `Match BetaFederationRuleMatch`

    Conditions the verified JWT must satisfy for this rule to apply. All populated matcher fields must pass.

    - `Audience string Optional`

      Exact match against the `aud` claim (any element if array). When omitted, the JWT's `aud` must still equal Anthropic's expected audience for the issuer; setting this field overrides that default.

      maxLength: 1024

    - `Claims map[string, string] Optional`

      Exact-match `{claim: value}` pairs against top-level claims. Only string-valued claims can be matched; use `condition` for non-string claims.

    - `Condition string Optional`

      CEL expression over claims for logic the structural fields can't express. Must evaluate to a boolean and may reference only the `claims` variable; a constant-true expression (such as `true`) is rejected with 400.

      maxLength: 4096

    - `SubjectPrefix string Optional`

      Match the verified JWT `sub` claim. Exact match unless the value ends with `*`, in which case it is a prefix match. Example: `repo:my-org/my-repo:ref:refs/heads/main`.

      maxLength: 1024

  - `Name string`

    Admin-chosen slug identifier.

  - `OAuthScope string`

    Space-separated OAuth scopes granted on the minted token.

  - `Target BetaServiceAccountTarget`

    What this rule targets. Check `type` before reading the other fields. Tokens minted via a rule whose target `type` is `service_account` act as that service account.

    - `Type ServiceAccount`

    - `ServiceAccountID string`

      Tagged ID of the service account to mint tokens for.

    - `ServiceAccountName string Optional`

      Service account's display name at read time. Ignored on writes.

  - `TokenLifetimeSeconds int64`

    Lifetime in seconds of access tokens minted via this rule. Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

  - `UpdatedAt Time`

    When this rule was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this rule.

  - `WorkspaceID string`

    Legacy single-workspace binding. Prefer `workspace_ids` and the `/federation_rules/{federation_rule_id}/workspaces` sub-resource for managing workspace enablement.

  - `WorkspaceIDs []string`

    Tagged IDs of the workspaces this rule is enabled for. May be empty for older rules that only carry the legacy `workspace_id` binding. Ignored at exchange time when `applies_to_all_workspaces` is true (the list may still be non-empty).

#### 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"),
	)
	betaFederationRule, err := client.Beta.Organization.Federation.Rules.Update(
		context.TODO(),
		"federation_rule_id",
		anthropic.BetaOrganizationFederationRuleUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationRule.ID)
}
```

##### Response (200)

```json
{
  "id": "fdrl_01SDCCSbTxrXDpWc1phhtcfK",
  "applies_to_all_workspaces": true,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "attributes": {
    "foo": "string"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "issuer_id": "issuer_id",
  "issuer_name": "issuer_name",
  "match": {
    "audience": "audience",
    "claims": {
      "foo": "string"
    },
    "condition": "condition",
    "subject_prefix": "subject_prefix"
  },
  "name": "prod-deploy-pipeline",
  "oauth_scope": "oauth_scope",
  "target": {
    "service_account_id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
    "type": "service_account",
    "service_account_name": "service_account_name"
  },
  "token_lifetime_seconds": 0,
  "type": "federation_rule",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id",
  "workspace_id": "workspace_id",
  "workspace_ids": [
    "string"
  ]
}
```

### Archive Federation Rule

`client.Beta.Organization.Federation.Rules.Archive(ctx, federationRuleID, body) (*BetaFederationRule, error)`

**POST** `/v1/organizations/federation_rules/{federation_rule_id}/archive`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Archive a federation rule.

Token exchange through this rule stops immediately. Idempotent;
re-archiving returns the rule with its original `archived_at`. Archiving
clears the rule's workspace targeting (`workspace_id` and
`workspace_ids` are emptied). Tokens already minted before archive
remain valid until they expire. OAuth callers may only manage rules
whose `oauth_scope` is `workspace:developer` or `workspace:inference`;
other scopes require a Console session.

#### Parameters

- `federationRuleID string` (path parameter)

  ID of the federation rule to archive.

- `body BetaOrganizationFederationRuleArchiveParams`

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

#### Returns

- `type BetaFederationRule`

  Authorization rule binding an external OIDC identity to Anthropic.

  Evaluates the match conditions and mints an OAuth access token for the
  resolved target, scoped to a single workspace where the rule is enabled
  (chosen by the caller at exchange time when the rule is enabled for more
  than one). For rules enabled via `workspace_ids` or
  `applies_to_all_workspaces`, the target service account must be a member
  of that workspace (it is implicitly a member of the default workspace);
  rules carrying only the legacy `workspace_id` binding do not enforce
  this.

  - `Type FederationRule`

    default: federation_rule

  - `ID string`

    Tagged ID of the federation rule.

  - `AppliesToAllWorkspaces bool`

    When true, this rule is enabled for every workspace in the org (including ones created after the rule). `workspace_ids` is ignored at exchange time.

  - `ArchivedAt Time`

    If set, this rule is archived and rejects token exchange.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this rule.

  - `Attributes map[string, string]`

    CEL expressions extracting named values from claims. Not yet supported; always null.

  - `CreatedAt Time`

    When this rule was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this rule.

  - `Description string`

    Optional free-text description.

  - `IssuerID string`

    Tagged ID of the issuer whose tokens this rule accepts.

  - `IssuerName string`

    Issuer's display name at read time.

  - `Match BetaFederationRuleMatch`

    Conditions the verified JWT must satisfy for this rule to apply. All populated matcher fields must pass.

    - `Audience string Optional`

      Exact match against the `aud` claim (any element if array). When omitted, the JWT's `aud` must still equal Anthropic's expected audience for the issuer; setting this field overrides that default.

      maxLength: 1024

    - `Claims map[string, string] Optional`

      Exact-match `{claim: value}` pairs against top-level claims. Only string-valued claims can be matched; use `condition` for non-string claims.

    - `Condition string Optional`

      CEL expression over claims for logic the structural fields can't express. Must evaluate to a boolean and may reference only the `claims` variable; a constant-true expression (such as `true`) is rejected with 400.

      maxLength: 4096

    - `SubjectPrefix string Optional`

      Match the verified JWT `sub` claim. Exact match unless the value ends with `*`, in which case it is a prefix match. Example: `repo:my-org/my-repo:ref:refs/heads/main`.

      maxLength: 1024

  - `Name string`

    Admin-chosen slug identifier.

  - `OAuthScope string`

    Space-separated OAuth scopes granted on the minted token.

  - `Target BetaServiceAccountTarget`

    What this rule targets. Check `type` before reading the other fields. Tokens minted via a rule whose target `type` is `service_account` act as that service account.

    - `Type ServiceAccount`

    - `ServiceAccountID string`

      Tagged ID of the service account to mint tokens for.

    - `ServiceAccountName string Optional`

      Service account's display name at read time. Ignored on writes.

  - `TokenLifetimeSeconds int64`

    Lifetime in seconds of access tokens minted via this rule. Minted tokens are capped at `max(60, min(this value, 2 × remaining assertion validity))` seconds.

  - `UpdatedAt Time`

    When this rule was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this rule.

  - `WorkspaceID string`

    Legacy single-workspace binding. Prefer `workspace_ids` and the `/federation_rules/{federation_rule_id}/workspaces` sub-resource for managing workspace enablement.

  - `WorkspaceIDs []string`

    Tagged IDs of the workspaces this rule is enabled for. May be empty for older rules that only carry the legacy `workspace_id` binding. Ignored at exchange time when `applies_to_all_workspaces` is true (the list may still be non-empty).

#### 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"),
	)
	betaFederationRule, err := client.Beta.Organization.Federation.Rules.Archive(
		context.TODO(),
		"federation_rule_id",
		anthropic.BetaOrganizationFederationRuleArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationRule.ID)
}
```

##### Response (200)

```json
{
  "id": "fdrl_01SDCCSbTxrXDpWc1phhtcfK",
  "applies_to_all_workspaces": true,
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "attributes": {
    "foo": "string"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "issuer_id": "issuer_id",
  "issuer_name": "issuer_name",
  "match": {
    "audience": "audience",
    "claims": {
      "foo": "string"
    },
    "condition": "condition",
    "subject_prefix": "subject_prefix"
  },
  "name": "prod-deploy-pipeline",
  "oauth_scope": "oauth_scope",
  "target": {
    "service_account_id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
    "type": "service_account",
    "service_account_name": "service_account_name"
  },
  "token_lifetime_seconds": 0,
  "type": "federation_rule",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id",
  "workspace_id": "workspace_id",
  "workspace_ids": [
    "string"
  ]
}
```

## Beta › Organization › Federation › Rules › Workspaces

### Add Federation Rule Workspace

`client.Beta.Organization.Federation.Rules.Workspaces.Add(ctx, federationRuleID, params) (*BetaFederationRuleWorkspace, error)`

**POST** `/v1/organizations/federation_rules/{federation_rule_id}/workspaces`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Enable a federation rule for a workspace.

Idempotent; re-enabling returns the existing enablement. The rule and
workspace must both belong to your organization. Membership of the
rule's target service account in this workspace is not checked at
enablement: token exchange into this workspace is rejected unless the
target is a member (it is implicitly a member of the default workspace).
Archived rules are rejected with 400. OAuth callers may only manage rules
whose `oauth_scope` is `workspace:developer` or `workspace:inference`;
other scopes require a Console session.

#### Parameters

- `federationRuleID string` (path parameter)

  ID of the federation rule.

- `params BetaOrganizationFederationRuleWorkspaceAddParams`

  - `WorkspaceID string`

    Tagged ID of the workspace to enable this rule for.

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

#### Returns

- `type BetaFederationRuleWorkspace`

  - `Type FederationRuleWorkspace`

    default: federation_rule_workspace

  - `CreatedAt Time`

    When this workspace was enabled for the rule.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_...` or `svac_...`) of the actor that enabled this workspace for the rule, if known.

  - `FederationRuleID string`

    Tagged ID of the federation rule.

  - `WorkspaceID string`

    Tagged ID of the workspace this rule is enabled for.

  - `WorkspaceName string`

    Workspace display name. Populated when listing; null in the enable response.

#### 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"),
	)
	betaFederationRuleWorkspace, err := client.Beta.Organization.Federation.Rules.Workspaces.Add(
		context.TODO(),
		"federation_rule_id",
		anthropic.BetaOrganizationFederationRuleWorkspaceAddParams{
			WorkspaceID: "workspace_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaFederationRuleWorkspace.CreatedByActorID)
}
```

##### Response (200)

```json
{
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "federation_rule_id": "federation_rule_id",
  "type": "federation_rule_workspace",
  "workspace_id": "workspace_id",
  "workspace_name": "workspace_name"
}
```

### List Federation Rule Workspaces

`client.Beta.Organization.Federation.Rules.Workspaces.List(ctx, federationRuleID, params) (*PageCursor[BetaFederationRuleWorkspace], error)`

**GET** `/v1/organizations/federation_rules/{federation_rule_id}/workspaces`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

List workspaces where this federation rule is enabled.

Returns all workspace enablements in a single response; the `limit` and
`page` parameters are accepted but have no effect, and `next_page` is
always `null`. Returns explicit per-workspace enablements only; for
rules with `applies_to_all_workspaces` or a legacy single
`workspace_id`, check those fields on the rule itself.

#### Parameters

- `federationRuleID string` (path parameter)

  ID of the federation rule.

- `params BetaOrganizationFederationRuleWorkspaceListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

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

#### Returns

- `type BetaFederationRuleWorkspace`

  - `Type FederationRuleWorkspace`

    default: federation_rule_workspace

  - `CreatedAt Time`

    When this workspace was enabled for the rule.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_...` or `svac_...`) of the actor that enabled this workspace for the rule, if known.

  - `FederationRuleID string`

    Tagged ID of the federation rule.

  - `WorkspaceID string`

    Tagged ID of the workspace this rule is enabled for.

  - `WorkspaceName string`

    Workspace display name. Populated when listing; null in the enable response.

#### 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"),
	)
	page, err := client.Beta.Organization.Federation.Rules.Workspaces.List(
		context.TODO(),
		"federation_rule_id",
		anthropic.BetaOrganizationFederationRuleWorkspaceListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "created_at": "2024-10-30T23:58:27.427722Z",
      "created_by_actor_id": "created_by_actor_id",
      "federation_rule_id": "federation_rule_id",
      "type": "federation_rule_workspace",
      "workspace_id": "workspace_id",
      "workspace_name": "workspace_name"
    }
  ],
  "next_page": "next_page"
}
```

### Remove Federation Rule Workspace

`client.Beta.Organization.Federation.Rules.Workspaces.Remove(ctx, workspaceID, params) (*BetaOrganizationFederationRuleWorkspaceRemoveResponse, error)`

**DELETE** `/v1/organizations/federation_rules/{federation_rule_id}/workspaces/{workspace_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Disable a federation rule for a workspace.

Idempotent; succeeds even if the enablement was already removed. OAuth
callers may only manage rules whose `oauth_scope` is
`workspace:developer` or `workspace:inference`; other scopes require a
Console session.

#### Parameters

- `workspaceID string` (path parameter)

  ID of the workspace to disable for.

- `params BetaOrganizationFederationRuleWorkspaceRemoveParams`

  - `FederationRuleID string` (path parameter)

    ID of the federation rule.

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

#### Returns

- `type BetaOrganizationFederationRuleWorkspaceRemoveResponse`

  - `Type FederationRuleWorkspaceDeleted`

    default: federation_rule_workspace_deleted

  - `FederationRuleID string`

    Tagged ID of the federation rule.

  - `WorkspaceID string`

    Tagged ID of the workspace named in the delete request. Removal is idempotent.

#### 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"),
	)
	workspace, err := client.Beta.Organization.Federation.Rules.Workspaces.Remove(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationFederationRuleWorkspaceRemoveParams{
			FederationRuleID: "federation_rule_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", workspace.FederationRuleID)
}
```

##### Response (200)

```json
{
  "federation_rule_id": "federation_rule_id",
  "type": "federation_rule_workspace_deleted",
  "workspace_id": "workspace_id"
}
```

## Beta › Organization › Invites

### Create Invite

`client.Beta.Organization.Invites.New(ctx, body) (*BetaOrganizationInvite, error)`

**POST** `/v1/organizations/invites`

Invite a user to join the organization by email.

On plans that draw members from a finite pool of purchased seats, the invite automatically consumes a seat from the lowest tier with availability; there is no seat-tier parameter. When no seat is free the request fails with a 400 error rather than purchasing a seat.

#### Parameters

- `body BetaOrganizationInviteNewParams`

  - `Email string`

    Email of the User.

    format: email

  - `Role BetaOrganizationInviteNewParamsRole`

    Role for the invited User.

    The accepted values depend on the organization type. Console and API organizations accept `user`, `developer`, `billing`, and `claude_code_user`; `admin` cannot be assigned through the API. Claude Enterprise organizations accept `user` and `managed`; inviting with the `managed` role requires the `write:rbac_groups` scope in addition to `write:members`.

    - `const BetaOrganizationInviteNewParamsRoleBilling BetaOrganizationInviteNewParamsRole = "billing"`

    - `const BetaOrganizationInviteNewParamsRoleClaudeCodeUser BetaOrganizationInviteNewParamsRole = "claude_code_user"`

    - `const BetaOrganizationInviteNewParamsRoleDeveloper BetaOrganizationInviteNewParamsRole = "developer"`

    - `const BetaOrganizationInviteNewParamsRoleManaged BetaOrganizationInviteNewParamsRole = "managed"`

    - `const BetaOrganizationInviteNewParamsRoleUser BetaOrganizationInviteNewParamsRole = "user"`

  - `RBACGroupIDs []string Optional`

    RBAC group IDs to assign to the User when the Invite is accepted. A non-empty array is accepted only for a Claude Enterprise organization with RBAC groups, and requires the key to carry the `write:rbac_groups` scope.

    maxItems: 100

#### Returns

- `type BetaOrganizationInvite`

  - `Type Invite`

    Object type.

    For Invites, this is always `"invite"`.

    default: invite

  - `ID string`

    ID of the Invite.

  - `AcceptedAt Time`

    RFC 3339 datetime string indicating when the Invite was accepted, or null.

    format: date-time

  - `Email string`

    Email of the User being invited.

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the Invite expires.

    format: date-time

  - `InvitedAt Time`

    RFC 3339 datetime string indicating when the Invite was created.

    format: date-time

  - `RBACGroupIDs []string`

    RBAC group IDs recorded on the Invite (Claude Enterprise organizations), to be assigned to the User when the Invite is accepted. `[]` when none.

  - `Role BetaOrganizationRole`

    Organization role of the User.

    - `const BetaOrganizationRoleAdmin BetaOrganizationRole = "admin"`

    - `const BetaOrganizationRoleBilling BetaOrganizationRole = "billing"`

    - `const BetaOrganizationRoleClaudeCodeUser BetaOrganizationRole = "claude_code_user"`

    - `const BetaOrganizationRoleDeveloper BetaOrganizationRole = "developer"`

    - `const BetaOrganizationRoleManaged BetaOrganizationRole = "managed"`

    - `const BetaOrganizationRoleMembershipAdmin BetaOrganizationRole = "membership_admin"`

    - `const BetaOrganizationRoleOwner BetaOrganizationRole = "owner"`

    - `const BetaOrganizationRolePrimaryOwner BetaOrganizationRole = "primary_owner"`

    - `const BetaOrganizationRoleUser BetaOrganizationRole = "user"`

  - `Status BetaOrganizationInviteStatus`

    Status of the Invite.

    - `const BetaOrganizationInviteStatusAccepted BetaOrganizationInviteStatus = "accepted"`

    - `const BetaOrganizationInviteStatusDeleted BetaOrganizationInviteStatus = "deleted"`

    - `const BetaOrganizationInviteStatusExpired BetaOrganizationInviteStatus = "expired"`

    - `const BetaOrganizationInviteStatusPending BetaOrganizationInviteStatus = "pending"`

#### 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"),
	)
	betaOrganizationInvite, err := client.Beta.Organization.Invites.New(context.TODO(), anthropic.BetaOrganizationInviteNewParams{
		Email: "user@emaildomain.com",
		Role:  anthropic.BetaOrganizationInviteNewParamsRoleUser,
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaOrganizationInvite.ID)
}
```

##### Response (200)

```json
{
  "id": "invite_015gWxCN9Hfg2QhZwTK7Mdeu",
  "accepted_at": "2019-12-27T18:11:19.117Z",
  "email": "user@emaildomain.com",
  "expires_at": "2024-11-20T23:58:27.427722Z",
  "invited_at": "2024-10-30T23:58:27.427722Z",
  "rbac_group_ids": [
    "string"
  ],
  "role": "admin",
  "status": "pending",
  "type": "invite"
}
```

### List Invites

`client.Beta.Organization.Invites.List(ctx, query) (*Page[BetaOrganizationInvite], error)`

**GET** `/v1/organizations/invites`

List the organization's invites.

#### Parameters

- `query BetaOrganizationInviteListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `Email param.Opt[string] Optional` (query parameter)

    Filter by the email address the Invite was sent to. Matches the same way as the Users list's `email` filter (normalized, case-insensitive).

    format: email

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Roles []string Optional` (query parameter)

    Filter to items whose `role` equals one of the supplied values. Repeatable; values are OR'ed together.

    Accepted values depend on the organization type: Console and API organizations accept `user`, `developer`, `billing`, `admin`, and `claude_code_user`; Claude Enterprise organizations accept `user`, `owner`, `primary_owner`, `membership_admin`, and `managed`.

  - `Statuses []string Optional` (query parameter)

    Filter by Invite status. Repeatable; values are OR'ed together. Omit to return `pending`, `accepted`, and `expired` Invites alike.

    - `const BetaOrganizationInviteListParamsStatusAccepted BetaOrganizationInviteListParamsStatus = "accepted"`

    - `const BetaOrganizationInviteListParamsStatusExpired BetaOrganizationInviteListParamsStatus = "expired"`

    - `const BetaOrganizationInviteListParamsStatusPending BetaOrganizationInviteListParamsStatus = "pending"`

#### Returns

- `type BetaOrganizationInvite`

  - `Type Invite`

    Object type.

    For Invites, this is always `"invite"`.

    default: invite

  - `ID string`

    ID of the Invite.

  - `AcceptedAt Time`

    RFC 3339 datetime string indicating when the Invite was accepted, or null.

    format: date-time

  - `Email string`

    Email of the User being invited.

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the Invite expires.

    format: date-time

  - `InvitedAt Time`

    RFC 3339 datetime string indicating when the Invite was created.

    format: date-time

  - `RBACGroupIDs []string`

    RBAC group IDs recorded on the Invite (Claude Enterprise organizations), to be assigned to the User when the Invite is accepted. `[]` when none.

  - `Role BetaOrganizationRole`

    Organization role of the User.

    - `const BetaOrganizationRoleAdmin BetaOrganizationRole = "admin"`

    - `const BetaOrganizationRoleBilling BetaOrganizationRole = "billing"`

    - `const BetaOrganizationRoleClaudeCodeUser BetaOrganizationRole = "claude_code_user"`

    - `const BetaOrganizationRoleDeveloper BetaOrganizationRole = "developer"`

    - `const BetaOrganizationRoleManaged BetaOrganizationRole = "managed"`

    - `const BetaOrganizationRoleMembershipAdmin BetaOrganizationRole = "membership_admin"`

    - `const BetaOrganizationRoleOwner BetaOrganizationRole = "owner"`

    - `const BetaOrganizationRolePrimaryOwner BetaOrganizationRole = "primary_owner"`

    - `const BetaOrganizationRoleUser BetaOrganizationRole = "user"`

  - `Status BetaOrganizationInviteStatus`

    Status of the Invite.

    - `const BetaOrganizationInviteStatusAccepted BetaOrganizationInviteStatus = "accepted"`

    - `const BetaOrganizationInviteStatusDeleted BetaOrganizationInviteStatus = "deleted"`

    - `const BetaOrganizationInviteStatusExpired BetaOrganizationInviteStatus = "expired"`

    - `const BetaOrganizationInviteStatusPending BetaOrganizationInviteStatus = "pending"`

#### 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"),
	)
	page, err := client.Beta.Organization.Invites.List(context.TODO(), anthropic.BetaOrganizationInviteListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "invite_015gWxCN9Hfg2QhZwTK7Mdeu",
      "accepted_at": "2019-12-27T18:11:19.117Z",
      "email": "user@emaildomain.com",
      "expires_at": "2024-11-20T23:58:27.427722Z",
      "invited_at": "2024-10-30T23:58:27.427722Z",
      "rbac_group_ids": [
        "string"
      ],
      "role": "admin",
      "status": "pending",
      "type": "invite"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Get Invite

`client.Beta.Organization.Invites.Get(ctx, inviteID) (*BetaOrganizationInvite, error)`

**GET** `/v1/organizations/invites/{invite_id}`

Retrieve an invite by ID.

#### Parameters

- `inviteID string` (path parameter)

  ID of the Invite.

#### Returns

- `type BetaOrganizationInvite`

  - `Type Invite`

    Object type.

    For Invites, this is always `"invite"`.

    default: invite

  - `ID string`

    ID of the Invite.

  - `AcceptedAt Time`

    RFC 3339 datetime string indicating when the Invite was accepted, or null.

    format: date-time

  - `Email string`

    Email of the User being invited.

  - `ExpiresAt Time`

    RFC 3339 datetime string indicating when the Invite expires.

    format: date-time

  - `InvitedAt Time`

    RFC 3339 datetime string indicating when the Invite was created.

    format: date-time

  - `RBACGroupIDs []string`

    RBAC group IDs recorded on the Invite (Claude Enterprise organizations), to be assigned to the User when the Invite is accepted. `[]` when none.

  - `Role BetaOrganizationRole`

    Organization role of the User.

    - `const BetaOrganizationRoleAdmin BetaOrganizationRole = "admin"`

    - `const BetaOrganizationRoleBilling BetaOrganizationRole = "billing"`

    - `const BetaOrganizationRoleClaudeCodeUser BetaOrganizationRole = "claude_code_user"`

    - `const BetaOrganizationRoleDeveloper BetaOrganizationRole = "developer"`

    - `const BetaOrganizationRoleManaged BetaOrganizationRole = "managed"`

    - `const BetaOrganizationRoleMembershipAdmin BetaOrganizationRole = "membership_admin"`

    - `const BetaOrganizationRoleOwner BetaOrganizationRole = "owner"`

    - `const BetaOrganizationRolePrimaryOwner BetaOrganizationRole = "primary_owner"`

    - `const BetaOrganizationRoleUser BetaOrganizationRole = "user"`

  - `Status BetaOrganizationInviteStatus`

    Status of the Invite.

    - `const BetaOrganizationInviteStatusAccepted BetaOrganizationInviteStatus = "accepted"`

    - `const BetaOrganizationInviteStatusDeleted BetaOrganizationInviteStatus = "deleted"`

    - `const BetaOrganizationInviteStatusExpired BetaOrganizationInviteStatus = "expired"`

    - `const BetaOrganizationInviteStatusPending BetaOrganizationInviteStatus = "pending"`

#### 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"),
	)
	betaOrganizationInvite, err := client.Beta.Organization.Invites.Get(context.TODO(), "invite_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaOrganizationInvite.ID)
}
```

##### Response (200)

```json
{
  "id": "invite_015gWxCN9Hfg2QhZwTK7Mdeu",
  "accepted_at": "2019-12-27T18:11:19.117Z",
  "email": "user@emaildomain.com",
  "expires_at": "2024-11-20T23:58:27.427722Z",
  "invited_at": "2024-10-30T23:58:27.427722Z",
  "rbac_group_ids": [
    "string"
  ],
  "role": "admin",
  "status": "pending",
  "type": "invite"
}
```

### Delete Invite

`client.Beta.Organization.Invites.Delete(ctx, inviteID) (*BetaOrganizationInviteDeleteResponse, error)`

**DELETE** `/v1/organizations/invites/{invite_id}`

Delete a pending invite.

#### Parameters

- `inviteID string` (path parameter)

  ID of the Invite.

#### Returns

- `type BetaOrganizationInviteDeleteResponse`

  - `Type InviteDeleted`

    Deleted object type.

    For Invites, this is always `"invite_deleted"`.

    default: invite_deleted

  - `ID string`

    ID of the Invite.

#### 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"),
	)
	invite, err := client.Beta.Organization.Invites.Delete(context.TODO(), "invite_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", invite.ID)
}
```

##### Response (200)

```json
{
  "id": "invite_015gWxCN9Hfg2QhZwTK7Mdeu",
  "type": "invite_deleted"
}
```

## Beta › Organization › Service Accounts

### Create Service Account

`client.Beta.Organization.ServiceAccounts.New(ctx, params) (*BetaServiceAccount, error)`

**POST** `/v1/organizations/service_accounts`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Create a service account.

A service account is a named workload identity that federation rules
target. `organization_role` is `developer` (default) or `admin`; a rule
may only be created or retargeted to grant `org:admin` scope when the
target's `organization_role` is `admin`. Creating an `admin`-role service
account requires an interactive credential (a user OAuth token or a
Console session) — a workload may only create `developer`-role service
accounts.

#### Parameters

- `params BetaOrganizationServiceAccountNewParams`

  - `Name string`

    Slug identifier (lowercase, digits, hyphens). Unique within the organization; a duplicate name returns 409.

    minLength: 1, maxLength: 255

  - `Description param.Opt[string] Optional`

    Optional free-text description.

    maxLength: 2000

  - `OrganizationRole BetaOrganizationServiceAccountNewParamsOrganizationRole Optional`

    Org-level role. Defaults to `developer`.

    - `const BetaOrganizationServiceAccountNewParamsOrganizationRoleAdmin BetaOrganizationServiceAccountNewParamsOrganizationRole = "admin"`

    - `const BetaOrganizationServiceAccountNewParamsOrganizationRoleDeveloper BetaOrganizationServiceAccountNewParamsOrganizationRole = "developer"`

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

#### Returns

- `type BetaServiceAccount`

  Named non-human identity within the caller's organization.

  A service account is a pure identity: name + org. Authorization lives on
  whatever references it (federation rules).

  - `Type ServiceAccount`

    default: service_account

  - `ID string`

    Tagged ID of the service account.

  - `ArchivedAt Time`

    If set, this service account is archived.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.

  - `CreatedAt Time`

    When this service account was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this service account.

  - `Description string`

    Optional free-text description.

  - `Name string`

    Admin-chosen slug identifier.

  - `OrganizationRole BetaServiceAccountOrganizationRole`

    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.

    - `const BetaServiceAccountOrganizationRoleAdmin BetaServiceAccountOrganizationRole = "admin"`

    - `const BetaServiceAccountOrganizationRoleDeveloper BetaServiceAccountOrganizationRole = "developer"`

  - `UpdatedAt Time`

    When this service account was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.

#### 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"),
	)
	betaServiceAccount, err := client.Beta.Organization.ServiceAccounts.New(context.TODO(), anthropic.BetaOrganizationServiceAccountNewParams{
		Name: "ci-deploy-bot",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccount.ID)
}
```

##### Response (200)

```json
{
  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "name": "ci-deploy-bot",
  "organization_role": "admin",
  "type": "service_account",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

### List Service Accounts

`client.Beta.Organization.ServiceAccounts.List(ctx, params) (*PageCursor[BetaServiceAccount], error)`

**GET** `/v1/organizations/service_accounts`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

List service accounts in the caller's organization.

Results are ordered by creation time, newest first. Use `limit` and the
`next_page` cursor to paginate; set `include_archived=true` to include
archived service accounts.

#### Parameters

- `params BetaOrganizationServiceAccountListParams`

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Include archived resources. Defaults to false.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

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

#### Returns

- `type BetaServiceAccount`

  Named non-human identity within the caller's organization.

  A service account is a pure identity: name + org. Authorization lives on
  whatever references it (federation rules).

  - `Type ServiceAccount`

    default: service_account

  - `ID string`

    Tagged ID of the service account.

  - `ArchivedAt Time`

    If set, this service account is archived.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.

  - `CreatedAt Time`

    When this service account was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this service account.

  - `Description string`

    Optional free-text description.

  - `Name string`

    Admin-chosen slug identifier.

  - `OrganizationRole BetaServiceAccountOrganizationRole`

    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.

    - `const BetaServiceAccountOrganizationRoleAdmin BetaServiceAccountOrganizationRole = "admin"`

    - `const BetaServiceAccountOrganizationRoleDeveloper BetaServiceAccountOrganizationRole = "developer"`

  - `UpdatedAt Time`

    When this service account was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.

#### 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"),
	)
	page, err := client.Beta.Organization.ServiceAccounts.List(context.TODO(), anthropic.BetaOrganizationServiceAccountListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "archived_by_actor_id": "archived_by_actor_id",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "created_by_actor_id": "created_by_actor_id",
      "description": "description",
      "name": "ci-deploy-bot",
      "organization_role": "admin",
      "type": "service_account",
      "updated_at": "2024-10-30T23:58:27.427722Z",
      "updated_by_actor_id": "updated_by_actor_id"
    }
  ],
  "next_page": "next_page"
}
```

### Get Service Account

`client.Beta.Organization.ServiceAccounts.Get(ctx, serviceAccountID, query) (*BetaServiceAccount, error)`

**GET** `/v1/organizations/service_accounts/{service_account_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Retrieve a service account by its ID (`svac_...`).

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account.

- `query BetaOrganizationServiceAccountGetParams`

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

#### Returns

- `type BetaServiceAccount`

  Named non-human identity within the caller's organization.

  A service account is a pure identity: name + org. Authorization lives on
  whatever references it (federation rules).

  - `Type ServiceAccount`

    default: service_account

  - `ID string`

    Tagged ID of the service account.

  - `ArchivedAt Time`

    If set, this service account is archived.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.

  - `CreatedAt Time`

    When this service account was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this service account.

  - `Description string`

    Optional free-text description.

  - `Name string`

    Admin-chosen slug identifier.

  - `OrganizationRole BetaServiceAccountOrganizationRole`

    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.

    - `const BetaServiceAccountOrganizationRoleAdmin BetaServiceAccountOrganizationRole = "admin"`

    - `const BetaServiceAccountOrganizationRoleDeveloper BetaServiceAccountOrganizationRole = "developer"`

  - `UpdatedAt Time`

    When this service account was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.

#### 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"),
	)
	betaServiceAccount, err := client.Beta.Organization.ServiceAccounts.Get(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationServiceAccountGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccount.ID)
}
```

##### Response (200)

```json
{
  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "name": "ci-deploy-bot",
  "organization_role": "admin",
  "type": "service_account",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

### Update Service Account

`client.Beta.Organization.ServiceAccounts.Update(ctx, serviceAccountID, params) (*BetaServiceAccount, error)`

**POST** `/v1/organizations/service_accounts/{service_account_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Update a service account.

Only `description` and `organization_role` are mutable; `name` cannot be
changed. Archived service accounts cannot be updated; this returns 400.
Setting `organization_role` to `admin` (even when unchanged) requires an
interactive credential (a user OAuth token or a Console session).

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account to update.

- `params BetaOrganizationServiceAccountUpdateParams`

  - `Description param.Opt[string] Optional`

    Replaces the description. Omit to leave unchanged; send `null` to clear (the field is stored as an empty string).

    maxLength: 2000

  - `OrganizationRole BetaOrganizationServiceAccountUpdateParamsOrganizationRole Optional`

    Replaces the org-level role. Omit or send `null` to leave unchanged.

    - `const BetaOrganizationServiceAccountUpdateParamsOrganizationRoleAdmin BetaOrganizationServiceAccountUpdateParamsOrganizationRole = "admin"`

    - `const BetaOrganizationServiceAccountUpdateParamsOrganizationRoleDeveloper BetaOrganizationServiceAccountUpdateParamsOrganizationRole = "developer"`

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

#### Returns

- `type BetaServiceAccount`

  Named non-human identity within the caller's organization.

  A service account is a pure identity: name + org. Authorization lives on
  whatever references it (federation rules).

  - `Type ServiceAccount`

    default: service_account

  - `ID string`

    Tagged ID of the service account.

  - `ArchivedAt Time`

    If set, this service account is archived.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.

  - `CreatedAt Time`

    When this service account was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this service account.

  - `Description string`

    Optional free-text description.

  - `Name string`

    Admin-chosen slug identifier.

  - `OrganizationRole BetaServiceAccountOrganizationRole`

    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.

    - `const BetaServiceAccountOrganizationRoleAdmin BetaServiceAccountOrganizationRole = "admin"`

    - `const BetaServiceAccountOrganizationRoleDeveloper BetaServiceAccountOrganizationRole = "developer"`

  - `UpdatedAt Time`

    When this service account was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.

#### 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"),
	)
	betaServiceAccount, err := client.Beta.Organization.ServiceAccounts.Update(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationServiceAccountUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccount.ID)
}
```

##### Response (200)

```json
{
  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "name": "ci-deploy-bot",
  "organization_role": "admin",
  "type": "service_account",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

### Archive Service Account

`client.Beta.Organization.ServiceAccounts.Archive(ctx, serviceAccountID, body) (*BetaServiceAccount, error)`

**POST** `/v1/organizations/service_accounts/{service_account_id}/archive`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Archive a service account.

Idempotent; re-archiving returns the service account with its original
`archived_at`. Rejected with 400 if any live (non-archived) federation
rule still targets this service account, same as issuer archival; archive
those rules first or change their target to another service account.

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account to archive.

- `body BetaOrganizationServiceAccountArchiveParams`

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

#### Returns

- `type BetaServiceAccount`

  Named non-human identity within the caller's organization.

  A service account is a pure identity: name + org. Authorization lives on
  whatever references it (federation rules).

  - `Type ServiceAccount`

    default: service_account

  - `ID string`

    Tagged ID of the service account.

  - `ArchivedAt Time`

    If set, this service account is archived.

    format: date-time

  - `ArchivedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that archived this service account.

  - `CreatedAt Time`

    When this service account was created.

    format: date-time

  - `CreatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that created this service account.

  - `Description string`

    Optional free-text description.

  - `Name string`

    Admin-chosen slug identifier.

  - `OrganizationRole BetaServiceAccountOrganizationRole`

    Org-level role. A federation rule may only be created or retargeted to grant `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target is later demoted to `developer` is rejected at token exchange. Rules granting `org:admin` are managed in the Console.

    - `const BetaServiceAccountOrganizationRoleAdmin BetaServiceAccountOrganizationRole = "admin"`

    - `const BetaServiceAccountOrganizationRoleDeveloper BetaServiceAccountOrganizationRole = "developer"`

  - `UpdatedAt Time`

    When this service account was last updated.

    format: date-time

  - `UpdatedByActorID string`

    Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.

#### 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"),
	)
	betaServiceAccount, err := client.Beta.Organization.ServiceAccounts.Archive(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationServiceAccountArchiveParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccount.ID)
}
```

##### Response (200)

```json
{
  "id": "svac_01SDCCSbTxrXDpWc1phhtcfK",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "archived_by_actor_id": "archived_by_actor_id",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "created_by_actor_id": "created_by_actor_id",
  "description": "description",
  "name": "ci-deploy-bot",
  "organization_role": "admin",
  "type": "service_account",
  "updated_at": "2024-10-30T23:58:27.427722Z",
  "updated_by_actor_id": "updated_by_actor_id"
}
```

## Beta › Organization › Service Accounts › Workspaces

### Add Workspace To Service Account

`client.Beta.Organization.ServiceAccounts.Workspaces.Add(ctx, serviceAccountID, params) (*BetaServiceAccountWorkspaceMember, error)`

**POST** `/v1/organizations/service_accounts/{service_account_id}/workspaces`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Add a service account to a workspace with the given `workspace_role`.

Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed
from the service-account side; both create the same membership. If the
service account is already an explicit member of the workspace, its
`workspace_role` is replaced with the value supplied here. Archived
workspaces return 400. Archived service accounts cannot be added and are
rejected.

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account.

- `params BetaOrganizationServiceAccountWorkspaceAddParams`

  - `WorkspaceID string`

    Tagged workspace ID to add the service account to.

  - `WorkspaceRole BetaNoBillingWorkspaceRole`

    Role to assign to the service account in this workspace.

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

#### Returns

- `type BetaServiceAccountWorkspaceMember`

  - `Type ServiceAccountWorkspaceMember`

    default: service_account_workspace_member

  - `CreatedByActorID string`

    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.

  - `Implicit bool`

    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`).

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`).

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaServiceAccountWorkspaceMember, err := client.Beta.Organization.ServiceAccounts.Workspaces.Add(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationServiceAccountWorkspaceAddParams{
			WorkspaceID:   "workspace_id",
			WorkspaceRole: anthropic.BetaNoBillingWorkspaceRoleWorkspaceAdmin,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccountWorkspaceMember.CreatedByActorID)
}
```

##### Response (200)

```json
{
  "created_by_actor_id": "created_by_actor_id",
  "implicit": true,
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member",
  "workspace_id": "workspace_id",
  "workspace_role": "workspace_admin"
}
```

### List Workspaces For Service Account

`client.Beta.Organization.ServiceAccounts.Workspaces.List(ctx, serviceAccountID, params) (*PageCursor[BetaServiceAccountWorkspaceMember], error)`

**GET** `/v1/organizations/service_accounts/{service_account_id}/workspaces`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

List the workspaces a service account is a member of.

Each entry includes the service account's `workspace_role` in that
workspace. Use `limit` and the `next_page` cursor to paginate. When the
service account has no explicit default-workspace membership, the
implicit (`implicit: true`) membership is returned as the first entry on
the first page; with `limit=1` the first page may return up to 2 entries
(the implicit entry plus one explicit membership) so a pagination cursor
can be derived. Memberships are returned only while
the service account is active. Without a `page` cursor, an archived
service account returns an empty list. A `page` cursor that does not
match an active membership returns a 400 invalid-request error. A cursor
stops matching when the membership is removed, the workspace is deleted,
or the service account is archived. Restart pagination from the first
page to recover.

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account.

- `params BetaOrganizationServiceAccountWorkspaceListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

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

#### Returns

- `type BetaServiceAccountWorkspaceMember`

  - `Type ServiceAccountWorkspaceMember`

    default: service_account_workspace_member

  - `CreatedByActorID string`

    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.

  - `Implicit bool`

    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`).

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`).

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	page, err := client.Beta.Organization.ServiceAccounts.Workspaces.List(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationServiceAccountWorkspaceListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "created_by_actor_id": "created_by_actor_id",
      "implicit": true,
      "service_account_id": "service_account_id",
      "type": "service_account_workspace_member",
      "workspace_id": "workspace_id",
      "workspace_role": "workspace_admin"
    }
  ],
  "next_page": "next_page"
}
```

### Remove Workspace From Service Account

`client.Beta.Organization.ServiceAccounts.Workspaces.Remove(ctx, workspaceID, params) (*BetaOrganizationServiceAccountWorkspaceRemoveResponse, error)`

**DELETE** `/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Remove a service account from a workspace.

Mirror of `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`,
addressed from the service-account side. Removal is idempotent (returns
200 even if the membership was already removed). A DELETE against the
implicit default-workspace membership returns 200 but is a no-op and the
membership persists; deleting an explicit default-workspace row reverts
to the implicit `workspace_user` membership. Archived workspaces return
400.

#### Parameters

- `workspaceID string` (path parameter)

  ID of the workspace.

- `params BetaOrganizationServiceAccountWorkspaceRemoveParams`

  - `ServiceAccountID string` (path parameter)

    ID of the service account.

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

#### Returns

- `type BetaOrganizationServiceAccountWorkspaceRemoveResponse`

  - `Type ServiceAccountWorkspaceMemberDeleted`

    default: service_account_workspace_member_deleted

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`) named in the delete request. Removal is idempotent; see the endpoint description for the implicit-membership no-op.

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`) named in the delete request.

#### 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"),
	)
	workspace, err := client.Beta.Organization.ServiceAccounts.Workspaces.Remove(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationServiceAccountWorkspaceRemoveParams{
			ServiceAccountID: "service_account_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", workspace.ServiceAccountID)
}
```

##### Response (200)

```json
{
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member_deleted",
  "workspace_id": "workspace_id"
}
```

## Beta › Organization › Users

### List Users

`client.Beta.Organization.Users.List(ctx, query) (*Page[BetaOrganizationUser], error)`

**GET** `/v1/organizations/users`

List the organization's members.

#### Parameters

- `query BetaOrganizationUserListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `Email param.Opt[string] Optional` (query parameter)

    Filter by user email.

    format: email

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Roles []string Optional` (query parameter)

    Filter to items whose `role` equals one of the supplied values. Repeatable; values are OR'ed together.

    Accepted values depend on the organization type: Console and API organizations accept `user`, `developer`, `billing`, `admin`, and `claude_code_user`; Claude Enterprise organizations accept `user`, `owner`, `primary_owner`, `membership_admin`, and `managed`.

#### Returns

- `type BetaOrganizationUser`

  - `Type User`

    Object type.

    For Users, this is always `"user"`.

    default: user

  - `ID string`

    ID of the User.

  - `AddedAt Time`

    RFC 3339 datetime string indicating when the User joined the Organization.

    format: date-time

  - `Email string`

    Email of the User.

  - `Name string`

    Name of the User.

  - `Role BetaOrganizationRole`

    Organization role of the User.

    - `const BetaOrganizationRoleAdmin BetaOrganizationRole = "admin"`

    - `const BetaOrganizationRoleBilling BetaOrganizationRole = "billing"`

    - `const BetaOrganizationRoleClaudeCodeUser BetaOrganizationRole = "claude_code_user"`

    - `const BetaOrganizationRoleDeveloper BetaOrganizationRole = "developer"`

    - `const BetaOrganizationRoleManaged BetaOrganizationRole = "managed"`

    - `const BetaOrganizationRoleMembershipAdmin BetaOrganizationRole = "membership_admin"`

    - `const BetaOrganizationRoleOwner BetaOrganizationRole = "owner"`

    - `const BetaOrganizationRolePrimaryOwner BetaOrganizationRole = "primary_owner"`

    - `const BetaOrganizationRoleUser BetaOrganizationRole = "user"`

#### 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"),
	)
	page, err := client.Beta.Organization.Users.List(context.TODO(), anthropic.BetaOrganizationUserListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "added_at": "2024-10-30T23:58:27.427722Z",
      "email": "user@emaildomain.com",
      "name": "Jane Doe",
      "role": "admin",
      "type": "user"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Get User

`client.Beta.Organization.Users.Get(ctx, userID) (*BetaOrganizationUser, error)`

**GET** `/v1/organizations/users/{user_id}`

Retrieve a member of the organization by user ID.

#### Parameters

- `userID string` (path parameter)

  ID of the User.

#### Returns

- `type BetaOrganizationUser`

  - `Type User`

    Object type.

    For Users, this is always `"user"`.

    default: user

  - `ID string`

    ID of the User.

  - `AddedAt Time`

    RFC 3339 datetime string indicating when the User joined the Organization.

    format: date-time

  - `Email string`

    Email of the User.

  - `Name string`

    Name of the User.

  - `Role BetaOrganizationRole`

    Organization role of the User.

    - `const BetaOrganizationRoleAdmin BetaOrganizationRole = "admin"`

    - `const BetaOrganizationRoleBilling BetaOrganizationRole = "billing"`

    - `const BetaOrganizationRoleClaudeCodeUser BetaOrganizationRole = "claude_code_user"`

    - `const BetaOrganizationRoleDeveloper BetaOrganizationRole = "developer"`

    - `const BetaOrganizationRoleManaged BetaOrganizationRole = "managed"`

    - `const BetaOrganizationRoleMembershipAdmin BetaOrganizationRole = "membership_admin"`

    - `const BetaOrganizationRoleOwner BetaOrganizationRole = "owner"`

    - `const BetaOrganizationRolePrimaryOwner BetaOrganizationRole = "primary_owner"`

    - `const BetaOrganizationRoleUser BetaOrganizationRole = "user"`

#### 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"),
	)
	betaOrganizationUser, err := client.Beta.Organization.Users.Get(context.TODO(), "user_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaOrganizationUser.ID)
}
```

##### Response (200)

```json
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}
```

### Update User

`client.Beta.Organization.Users.Update(ctx, userID, body) (*BetaOrganizationUser, error)`

**POST** `/v1/organizations/users/{user_id}`

Update a member's organization role.

#### Parameters

- `userID string` (path parameter)

  ID of the User.

- `body BetaOrganizationUserUpdateParams`

  - `Role BetaOrganizationUserUpdateParamsRole`

    New role for the User.

    The accepted values depend on the organization type. Console and API organizations accept `user`, `developer`, `billing`, and `claude_code_user`; `admin` cannot be assigned through the API. Claude Enterprise organizations accept `user` and `managed`; changing a User's role to `managed` requires the `write:rbac_groups` scope in addition to `write:members`.

    - `const BetaOrganizationUserUpdateParamsRoleBilling BetaOrganizationUserUpdateParamsRole = "billing"`

    - `const BetaOrganizationUserUpdateParamsRoleClaudeCodeUser BetaOrganizationUserUpdateParamsRole = "claude_code_user"`

    - `const BetaOrganizationUserUpdateParamsRoleDeveloper BetaOrganizationUserUpdateParamsRole = "developer"`

    - `const BetaOrganizationUserUpdateParamsRoleManaged BetaOrganizationUserUpdateParamsRole = "managed"`

    - `const BetaOrganizationUserUpdateParamsRoleUser BetaOrganizationUserUpdateParamsRole = "user"`

#### Returns

- `type BetaOrganizationUser`

  - `Type User`

    Object type.

    For Users, this is always `"user"`.

    default: user

  - `ID string`

    ID of the User.

  - `AddedAt Time`

    RFC 3339 datetime string indicating when the User joined the Organization.

    format: date-time

  - `Email string`

    Email of the User.

  - `Name string`

    Name of the User.

  - `Role BetaOrganizationRole`

    Organization role of the User.

    - `const BetaOrganizationRoleAdmin BetaOrganizationRole = "admin"`

    - `const BetaOrganizationRoleBilling BetaOrganizationRole = "billing"`

    - `const BetaOrganizationRoleClaudeCodeUser BetaOrganizationRole = "claude_code_user"`

    - `const BetaOrganizationRoleDeveloper BetaOrganizationRole = "developer"`

    - `const BetaOrganizationRoleManaged BetaOrganizationRole = "managed"`

    - `const BetaOrganizationRoleMembershipAdmin BetaOrganizationRole = "membership_admin"`

    - `const BetaOrganizationRoleOwner BetaOrganizationRole = "owner"`

    - `const BetaOrganizationRolePrimaryOwner BetaOrganizationRole = "primary_owner"`

    - `const BetaOrganizationRoleUser BetaOrganizationRole = "user"`

#### 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"),
	)
	betaOrganizationUser, err := client.Beta.Organization.Users.Update(
		context.TODO(),
		"user_id",
		anthropic.BetaOrganizationUserUpdateParams{
			Role: anthropic.BetaOrganizationUserUpdateParamsRoleUser,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaOrganizationUser.ID)
}
```

##### Response (200)

```json
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}
```

### Remove User

`client.Beta.Organization.Users.Remove(ctx, userID) (*BetaOrganizationUserRemoveResponse, error)`

**DELETE** `/v1/organizations/users/{user_id}`

Remove a member from the organization.

#### Parameters

- `userID string` (path parameter)

  ID of the User.

#### Returns

- `type BetaOrganizationUserRemoveResponse`

  - `Type UserDeleted`

    Deleted object type.

    For Users, this is always `"user_deleted"`.

    default: user_deleted

  - `ID string`

    ID of the User.

#### 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"),
	)
	user, err := client.Beta.Organization.Users.Remove(context.TODO(), "user_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", user.ID)
}
```

##### Response (200)

```json
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "type": "user_deleted"
}
```

## Beta › Organization › Workspaces

### List Workspaces

`client.Beta.Organization.Workspaces.List(ctx, query) (*Page[BetaWorkspace], error)`

**GET** `/v1/organizations/workspaces`

List Workspaces

#### Parameters

- `query BetaOrganizationWorkspaceListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `IncludeArchived param.Opt[bool] Optional` (query parameter)

    Whether to include Workspaces that have been archived in the response

  - `IncludeDefault param.Opt[bool] Optional` (query parameter)

    Whether to include the organization's default Workspace in the response

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

#### Returns

- `type BetaWorkspace`

  - `Type Workspace`

    Object type.

    For Workspaces, this is always `"workspace"`.

    default: workspace

  - `ID string`

    ID of the Workspace.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the Workspace was archived, or `null` if the Workspace is not archived.

    format: date-time

  - `CompartmentID string`

    Identifier for this Workspace's encryption compartment. When you configure a
    customer-managed encryption key (CMEK) on AWS, reference this value in your
    KMS key-policy condition so the key is scoped to this compartment. On GCP and
    Azure, Anthropic enforces the compartment binding automatically; you do not
    need to reference this value in your key configuration. See the CMEK
    integration guide for the required key configuration; unless your organization
    is on Claude Platform on AWS, it includes a separate value used during key
    validation. On Claude Platform on AWS there is no separate validation value:
    the key is validated against this Workspace's own value when it is attached, so
    if your key policy uses the compartment condition, add this value to it before
    attaching the key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the Workspace was created.

    format: date-time

  - `DataResidency BetaDataResidency`

    Data residency configuration.

    - `AllowedInferenceGeos BetaDataResidencyAllowedInferenceGeosUnion`

      Permitted inference geo values. 'unrestricted' means all geos are allowed.

      - `[]BetaAllowedInferenceGeo`

        - `const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"`

        - `const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"`

      - `Unrestricted`

    - `DefaultInferenceGeo BetaDataResidencyDefaultInferenceGeo`

      Default inference geo applied when requests omit the parameter.

      - `const BetaDataResidencyDefaultInferenceGeoGlobal BetaDataResidencyDefaultInferenceGeo = "global"`

      - `const BetaDataResidencyDefaultInferenceGeoUs BetaDataResidencyDefaultInferenceGeo = "us"`

    - `WorkspaceGeo BetaDataResidencyWorkspaceGeo`

      Geographic region for workspace data storage. Immutable after creation.

  - `DisplayColor string`

    Hex color code representing the Workspace in the Anthropic Console.

  - `ExternalKeyID string`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Name string`

    Name of the Workspace.

  - `Tags map[string, string]`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

#### 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"),
	)
	page, err := client.Beta.Organization.Workspaces.List(context.TODO(), anthropic.BetaOrganizationWorkspaceListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      "archived_at": "2024-11-01T23:59:27.427722Z",
      "compartment_id": "f8a7b6c5-4d3e-4f1a-8b9c-0d1e2f3a4b5c",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "data_residency": {
        "allowed_inference_geos": "unrestricted",
        "default_inference_geo": "global",
        "workspace_geo": "us"
      },
      "display_color": "#6C5BB9",
      "external_key_id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
      "name": "Workspace Name",
      "tags": {
        "env": "prod",
        "team": "platform"
      },
      "type": "workspace"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Create Workspace

`client.Beta.Organization.Workspaces.New(ctx, params) (*BetaWorkspace, error)`

**POST** `/v1/organizations/workspaces`

Create Workspace

#### Parameters

- `params BetaOrganizationWorkspaceNewParams`

  - `Name string`

    Name of the Workspace.

    minLength: 1, maxLength: 255

  - `DataResidency BetaDataResidencyCreateConfigParam Optional`

    Data residency configuration for the workspace. If omitted, defaults to `workspace_geo: "us"`, `allowed_inference_geos: "unrestricted"`, and `default_inference_geo: "global"`.

  - `DisplayColor param.Opt[string] Optional`

    Hex color code representing the Workspace in the Anthropic Console.

    maxLength: 7, pattern: ^#[0-9A-Fa-f]{6}$

  - `ExternalKeyID param.Opt[string] Optional`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Tags map[string, string] Optional`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

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

#### Returns

- `type BetaWorkspace`

  - `Type Workspace`

    Object type.

    For Workspaces, this is always `"workspace"`.

    default: workspace

  - `ID string`

    ID of the Workspace.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the Workspace was archived, or `null` if the Workspace is not archived.

    format: date-time

  - `CompartmentID string`

    Identifier for this Workspace's encryption compartment. When you configure a
    customer-managed encryption key (CMEK) on AWS, reference this value in your
    KMS key-policy condition so the key is scoped to this compartment. On GCP and
    Azure, Anthropic enforces the compartment binding automatically; you do not
    need to reference this value in your key configuration. See the CMEK
    integration guide for the required key configuration; unless your organization
    is on Claude Platform on AWS, it includes a separate value used during key
    validation. On Claude Platform on AWS there is no separate validation value:
    the key is validated against this Workspace's own value when it is attached, so
    if your key policy uses the compartment condition, add this value to it before
    attaching the key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the Workspace was created.

    format: date-time

  - `DataResidency BetaDataResidency`

    Data residency configuration.

    - `AllowedInferenceGeos BetaDataResidencyAllowedInferenceGeosUnion`

      Permitted inference geo values. 'unrestricted' means all geos are allowed.

      - `[]BetaAllowedInferenceGeo`

        - `const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"`

        - `const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"`

      - `Unrestricted`

    - `DefaultInferenceGeo BetaDataResidencyDefaultInferenceGeo`

      Default inference geo applied when requests omit the parameter.

      - `const BetaDataResidencyDefaultInferenceGeoGlobal BetaDataResidencyDefaultInferenceGeo = "global"`

      - `const BetaDataResidencyDefaultInferenceGeoUs BetaDataResidencyDefaultInferenceGeo = "us"`

    - `WorkspaceGeo BetaDataResidencyWorkspaceGeo`

      Geographic region for workspace data storage. Immutable after creation.

  - `DisplayColor string`

    Hex color code representing the Workspace in the Anthropic Console.

  - `ExternalKeyID string`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Name string`

    Name of the Workspace.

  - `Tags map[string, string]`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

#### 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"),
	)
	betaWorkspace, err := client.Beta.Organization.Workspaces.New(context.TODO(), anthropic.BetaOrganizationWorkspaceNewParams{
		Name: "x",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspace.ID)
}
```

##### Response (200)

```json
{
  "id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "compartment_id": "f8a7b6c5-4d3e-4f1a-8b9c-0d1e2f3a4b5c",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "data_residency": {
    "allowed_inference_geos": "unrestricted",
    "default_inference_geo": "global",
    "workspace_geo": "us"
  },
  "display_color": "#6C5BB9",
  "external_key_id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "name": "Workspace Name",
  "tags": {
    "env": "prod",
    "team": "platform"
  },
  "type": "workspace"
}
```

### Get Workspace

`client.Beta.Organization.Workspaces.Get(ctx, workspaceID) (*BetaWorkspace, error)`

**GET** `/v1/organizations/workspaces/{workspace_id}`

Get Workspace

#### Parameters

- `workspaceID string` (path parameter)

  ID of the Workspace.

#### Returns

- `type BetaWorkspace`

  - `Type Workspace`

    Object type.

    For Workspaces, this is always `"workspace"`.

    default: workspace

  - `ID string`

    ID of the Workspace.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the Workspace was archived, or `null` if the Workspace is not archived.

    format: date-time

  - `CompartmentID string`

    Identifier for this Workspace's encryption compartment. When you configure a
    customer-managed encryption key (CMEK) on AWS, reference this value in your
    KMS key-policy condition so the key is scoped to this compartment. On GCP and
    Azure, Anthropic enforces the compartment binding automatically; you do not
    need to reference this value in your key configuration. See the CMEK
    integration guide for the required key configuration; unless your organization
    is on Claude Platform on AWS, it includes a separate value used during key
    validation. On Claude Platform on AWS there is no separate validation value:
    the key is validated against this Workspace's own value when it is attached, so
    if your key policy uses the compartment condition, add this value to it before
    attaching the key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the Workspace was created.

    format: date-time

  - `DataResidency BetaDataResidency`

    Data residency configuration.

    - `AllowedInferenceGeos BetaDataResidencyAllowedInferenceGeosUnion`

      Permitted inference geo values. 'unrestricted' means all geos are allowed.

      - `[]BetaAllowedInferenceGeo`

        - `const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"`

        - `const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"`

      - `Unrestricted`

    - `DefaultInferenceGeo BetaDataResidencyDefaultInferenceGeo`

      Default inference geo applied when requests omit the parameter.

      - `const BetaDataResidencyDefaultInferenceGeoGlobal BetaDataResidencyDefaultInferenceGeo = "global"`

      - `const BetaDataResidencyDefaultInferenceGeoUs BetaDataResidencyDefaultInferenceGeo = "us"`

    - `WorkspaceGeo BetaDataResidencyWorkspaceGeo`

      Geographic region for workspace data storage. Immutable after creation.

  - `DisplayColor string`

    Hex color code representing the Workspace in the Anthropic Console.

  - `ExternalKeyID string`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Name string`

    Name of the Workspace.

  - `Tags map[string, string]`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

#### 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"),
	)
	betaWorkspace, err := client.Beta.Organization.Workspaces.Get(context.TODO(), "workspace_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspace.ID)
}
```

##### Response (200)

```json
{
  "id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "compartment_id": "f8a7b6c5-4d3e-4f1a-8b9c-0d1e2f3a4b5c",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "data_residency": {
    "allowed_inference_geos": "unrestricted",
    "default_inference_geo": "global",
    "workspace_geo": "us"
  },
  "display_color": "#6C5BB9",
  "external_key_id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "name": "Workspace Name",
  "tags": {
    "env": "prod",
    "team": "platform"
  },
  "type": "workspace"
}
```

### Update Workspace

`client.Beta.Organization.Workspaces.Update(ctx, workspaceID, body) (*BetaWorkspace, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}`

Update Workspace

#### Parameters

- `workspaceID string` (path parameter)

- `body BetaOrganizationWorkspaceUpdateParams`

  - `DataResidency BetaDataResidencyUpdateConfigParam Optional`

    Data residency configuration for the workspace.

  - `DisplayColor param.Opt[string] Optional`

    Hex color code representing the Workspace in the Anthropic Console.

    maxLength: 7, pattern: ^#[0-9A-Fa-f]{6}$

  - `ExternalKeyID param.Opt[string] Optional`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Name param.Opt[string] Optional`

    Name of the Workspace.

    minLength: 1, maxLength: 255

  - `Tags map[string, string] Optional`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

#### Returns

- `type BetaWorkspace`

  - `Type Workspace`

    Object type.

    For Workspaces, this is always `"workspace"`.

    default: workspace

  - `ID string`

    ID of the Workspace.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the Workspace was archived, or `null` if the Workspace is not archived.

    format: date-time

  - `CompartmentID string`

    Identifier for this Workspace's encryption compartment. When you configure a
    customer-managed encryption key (CMEK) on AWS, reference this value in your
    KMS key-policy condition so the key is scoped to this compartment. On GCP and
    Azure, Anthropic enforces the compartment binding automatically; you do not
    need to reference this value in your key configuration. See the CMEK
    integration guide for the required key configuration; unless your organization
    is on Claude Platform on AWS, it includes a separate value used during key
    validation. On Claude Platform on AWS there is no separate validation value:
    the key is validated against this Workspace's own value when it is attached, so
    if your key policy uses the compartment condition, add this value to it before
    attaching the key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the Workspace was created.

    format: date-time

  - `DataResidency BetaDataResidency`

    Data residency configuration.

    - `AllowedInferenceGeos BetaDataResidencyAllowedInferenceGeosUnion`

      Permitted inference geo values. 'unrestricted' means all geos are allowed.

      - `[]BetaAllowedInferenceGeo`

        - `const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"`

        - `const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"`

      - `Unrestricted`

    - `DefaultInferenceGeo BetaDataResidencyDefaultInferenceGeo`

      Default inference geo applied when requests omit the parameter.

      - `const BetaDataResidencyDefaultInferenceGeoGlobal BetaDataResidencyDefaultInferenceGeo = "global"`

      - `const BetaDataResidencyDefaultInferenceGeoUs BetaDataResidencyDefaultInferenceGeo = "us"`

    - `WorkspaceGeo BetaDataResidencyWorkspaceGeo`

      Geographic region for workspace data storage. Immutable after creation.

  - `DisplayColor string`

    Hex color code representing the Workspace in the Anthropic Console.

  - `ExternalKeyID string`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Name string`

    Name of the Workspace.

  - `Tags map[string, string]`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

#### 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"),
	)
	betaWorkspace, err := client.Beta.Organization.Workspaces.Update(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspace.ID)
}
```

##### Response (200)

```json
{
  "id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "compartment_id": "f8a7b6c5-4d3e-4f1a-8b9c-0d1e2f3a4b5c",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "data_residency": {
    "allowed_inference_geos": "unrestricted",
    "default_inference_geo": "global",
    "workspace_geo": "us"
  },
  "display_color": "#6C5BB9",
  "external_key_id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "name": "Workspace Name",
  "tags": {
    "env": "prod",
    "team": "platform"
  },
  "type": "workspace"
}
```

### Archive Workspace

`client.Beta.Organization.Workspaces.Archive(ctx, workspaceID) (*BetaWorkspace, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}/archive`

Archive Workspace

#### Parameters

- `workspaceID string` (path parameter)

#### Returns

- `type BetaWorkspace`

  - `Type Workspace`

    Object type.

    For Workspaces, this is always `"workspace"`.

    default: workspace

  - `ID string`

    ID of the Workspace.

  - `ArchivedAt Time`

    RFC 3339 datetime string indicating when the Workspace was archived, or `null` if the Workspace is not archived.

    format: date-time

  - `CompartmentID string`

    Identifier for this Workspace's encryption compartment. When you configure a
    customer-managed encryption key (CMEK) on AWS, reference this value in your
    KMS key-policy condition so the key is scoped to this compartment. On GCP and
    Azure, Anthropic enforces the compartment binding automatically; you do not
    need to reference this value in your key configuration. See the CMEK
    integration guide for the required key configuration; unless your organization
    is on Claude Platform on AWS, it includes a separate value used during key
    validation. On Claude Platform on AWS there is no separate validation value:
    the key is validated against this Workspace's own value when it is attached, so
    if your key policy uses the compartment condition, add this value to it before
    attaching the key.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the Workspace was created.

    format: date-time

  - `DataResidency BetaDataResidency`

    Data residency configuration.

    - `AllowedInferenceGeos BetaDataResidencyAllowedInferenceGeosUnion`

      Permitted inference geo values. 'unrestricted' means all geos are allowed.

      - `[]BetaAllowedInferenceGeo`

        - `const BetaAllowedInferenceGeoGlobal BetaAllowedInferenceGeo = "global"`

        - `const BetaAllowedInferenceGeoUs BetaAllowedInferenceGeo = "us"`

      - `Unrestricted`

    - `DefaultInferenceGeo BetaDataResidencyDefaultInferenceGeo`

      Default inference geo applied when requests omit the parameter.

      - `const BetaDataResidencyDefaultInferenceGeoGlobal BetaDataResidencyDefaultInferenceGeo = "global"`

      - `const BetaDataResidencyDefaultInferenceGeoUs BetaDataResidencyDefaultInferenceGeo = "us"`

    - `WorkspaceGeo BetaDataResidencyWorkspaceGeo`

      Geographic region for workspace data storage. Immutable after creation.

  - `DisplayColor string`

    Hex color code representing the Workspace in the Anthropic Console.

  - `ExternalKeyID string`

    ID of the customer-managed encryption key (CMEK) configuration to use for this
    Workspace. Setting this field requires CMEK to be enabled for your
    organization. When set, data stored for this Workspace is encrypted with the
    referenced key. Create key configurations with the External Keys API. On
    Claude Platform on AWS the value is the AWS KMS key ARN, and the key must be a
    single-Region key in the same AWS account and Region as the Workspace. On that
    platform the key is validated against this Workspace when it is attached, so a
    key-policy problem is reported as an error on this request. This field is write-once:
    once a key is attached to a Workspace it cannot be detached or replaced. To
    rotate key material, rotate the underlying key on your cloud KMS; the
    `external_key_id` stays the same.

  - `Name string`

    Name of the Workspace.

  - `Tags map[string, string]`

    User-defined tags as string key-value pairs. Keys may not begin with `anthropic`.

#### 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"),
	)
	betaWorkspace, err := client.Beta.Organization.Workspaces.Archive(context.TODO(), "workspace_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspace.ID)
}
```

##### Response (200)

```json
{
  "id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "compartment_id": "f8a7b6c5-4d3e-4f1a-8b9c-0d1e2f3a4b5c",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "data_residency": {
    "allowed_inference_geos": "unrestricted",
    "default_inference_geo": "global",
    "workspace_geo": "us"
  },
  "display_color": "#6C5BB9",
  "external_key_id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "name": "Workspace Name",
  "tags": {
    "env": "prod",
    "team": "platform"
  },
  "type": "workspace"
}
```

## Beta › Organization › Workspaces › Rate Limits

### List Workspace Rate Limits

`client.Beta.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[BetaWorkspaceRateLimit], error)`

**GET** `/v1/organizations/workspaces/{workspace_id}/rate_limits`

List a workspace's rate limits.

By default, returns only the groups and limiter types that have a
workspace-level override. With `include_inherited=true`, returns every
group with organization-level limits the workspace can see, listing for
each the values it inherits from the organization as well as its own
overrides. Each value's `source` says which it is.

When `limit` is omitted, every matching entry is returned in a single
page; when `limit` truncates the result, follow `next_page` to fetch
the remaining entries.

#### Parameters

- `workspaceID string` (path parameter)

  The ID of the workspace.

- `query BetaOrganizationWorkspaceRateLimitListParams`

  - `GroupType BetaOrganizationWorkspaceRateLimitListParamsGroupType Optional` (query parameter)

    Filter by group type.

    - `const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeBatch BetaOrganizationWorkspaceRateLimitListParamsGroupType = "batch"`

    - `const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeFiles BetaOrganizationWorkspaceRateLimitListParamsGroupType = "files"`

    - `const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeModelGroup BetaOrganizationWorkspaceRateLimitListParamsGroupType = "model_group"`

    - `const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeSkills BetaOrganizationWorkspaceRateLimitListParamsGroupType = "skills"`

    - `const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeTokenCount BetaOrganizationWorkspaceRateLimitListParamsGroupType = "token_count"`

    - `const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeWebSearch BetaOrganizationWorkspaceRateLimitListParamsGroupType = "web_search"`

  - `IncludeInherited param.Opt[bool] Optional` (query parameter)

    Also list the limiter values the workspace inherits from the organization, including groups with no workspace-level override.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of items to return per page. Ranges from `1` to `1000`.

    When omitted, every remaining entry is returned in a single page and `next_page` is `null`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

#### Returns

- `type BetaWorkspaceRateLimit`

  - `Type WorkspaceRateLimit`

    Object type. Always `workspace_rate_limit` for workspace rate-limit entries.

    default: workspace_rate_limit

  - `Group BetaWorkspaceRateLimitGroupUnion`

    The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.

    - `type BetaOrganizationRateLimitModelGroup`

      - `Type ModelGroup`

        Always `model_group`: a family of models.

        default: model_group

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

      - `DisplayName string`

        Human-readable name of the model group (for example, `Claude Sonnet 4.x`). For display only; it may change.

    - `type BetaOrganizationRateLimitBatchGroup`

      - `Type Batch`

        Always `batch`: the Message Batches API.

        default: batch

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitTokenCountGroup`

      - `Type TokenCount`

        Always `token_count`: the Token Count API.

        default: token_count

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitFilesGroup`

      - `Type Files`

        Always `files`: the Files API.

        default: files

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitSkillsGroup`

      - `Type Skills`

        Always `skills`: the Skills API.

        default: skills

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitWebSearchGroup`

      - `Type WebSearch`

        Always `web_search`: the Messages API web search tool.

        default: web_search

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

  - `Limits []BetaWorkspaceRateLimitValue`

    The workspace's limiter values for this group. By default only the limiter types with a workspace-level override are listed. With `include_inherited` set to `true`, the limiter types the workspace inherits from the organization are listed too, each marked by `source`.

    - `Type string`

      The limiter type (for example, `requests_per_minute` or `input_tokens_per_minute`).

    - `OrgLimit int64`

      The organization-level value for the same limiter type, for reference. `null` when the organization has no limit configured for this limiter type.

    - `Source BetaWorkspaceRateLimitValueSourceUnion`

      Where `value` comes from. `organization` values are listed only when `include_inherited` is `true`, and then `value` equals `org_limit`.

      - `type BetaWorkspaceRateLimitWorkspaceSource`

        - `Type Workspace`

          Always `workspace`: a workspace-level override is stored.

          default: workspace

      - `type BetaWorkspaceRateLimitOrganizationSource`

        - `Type Organization`

          Always `organization`: no workspace-level override is stored, so the organization's value applies.

          default: organization

    - `Value int64`

      The workspace's value for this limiter type: the workspace-level override when `source.type` is `workspace`, otherwise the organization's value.

  - `Models []string`

    Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.

  - `RateLimitID string`

    The `id` of the organization's RateLimit entry this entry applies to.

  - `WorkspaceID string`

    ID of the Workspace this entry applies to.

  - `GroupType BetaWorkspaceRateLimitGroupType`

    **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.

    Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.

    - `const BetaWorkspaceRateLimitGroupTypeBatch BetaWorkspaceRateLimitGroupType = "batch"`

    - `const BetaWorkspaceRateLimitGroupTypeFiles BetaWorkspaceRateLimitGroupType = "files"`

    - `const BetaWorkspaceRateLimitGroupTypeModelGroup BetaWorkspaceRateLimitGroupType = "model_group"`

    - `const BetaWorkspaceRateLimitGroupTypeSkills BetaWorkspaceRateLimitGroupType = "skills"`

    - `const BetaWorkspaceRateLimitGroupTypeTokenCount BetaWorkspaceRateLimitGroupType = "token_count"`

    - `const BetaWorkspaceRateLimitGroupTypeWebSearch BetaWorkspaceRateLimitGroupType = "web_search"`

#### 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"),
	)
	page, err := client.Beta.Organization.Workspaces.RateLimits.List(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceRateLimitListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "group": {
        "id": "id",
        "display_name": "display_name",
        "type": "model_group"
      },
      "group_type": "batch",
      "limits": [
        {
          "org_limit": 0,
          "source": {
            "type": "workspace"
          },
          "type": "type",
          "value": 0
        }
      ],
      "models": [
        "string"
      ],
      "rate_limit_id": "rate_limit_id",
      "type": "workspace_rate_limit",
      "workspace_id": "workspace_id"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Workspaces › Members

### List Workspace Members

`client.Beta.Organization.Workspaces.Members.List(ctx, workspaceID, query) (*Page[BetaWorkspaceMember], error)`

**GET** `/v1/organizations/workspaces/{workspace_id}/members`

List Workspace Members

#### Parameters

- `workspaceID string` (path parameter)

  ID of the Workspace.

- `query BetaOrganizationWorkspaceMemberListParams`

  - `AfterID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `BeforeID param.Opt[string] Optional` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

#### Returns

- `type BetaWorkspaceMember`

  - `Type WorkspaceMember`

    Object type.

    For Workspace Members, this is always `"workspace_member"`.

    default: workspace_member

  - `UserID string`

    ID of the User.

  - `WorkspaceID string`

    ID of the Workspace.

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the Workspace Member.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	page, err := client.Beta.Organization.Workspaces.Members.List(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceMemberListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "type": "workspace_member",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      "workspace_role": "workspace_admin"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

### Create Workspace Member

`client.Beta.Organization.Workspaces.Members.Add(ctx, workspaceID, body) (*BetaWorkspaceMember, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}/members`

Create Workspace Member

#### Parameters

- `workspaceID string` (path parameter)

  ID of the Workspace.

- `body BetaOrganizationWorkspaceMemberAddParams`

  - `UserID string`

    ID of the User.

  - `WorkspaceRole BetaNoBillingWorkspaceRole`

    Role of the new Workspace Member. Cannot be `workspace_billing`.

#### Returns

- `type BetaWorkspaceMember`

  - `Type WorkspaceMember`

    Object type.

    For Workspace Members, this is always `"workspace_member"`.

    default: workspace_member

  - `UserID string`

    ID of the User.

  - `WorkspaceID string`

    ID of the Workspace.

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the Workspace Member.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaWorkspaceMember, err := client.Beta.Organization.Workspaces.Members.Add(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceMemberAddParams{
			UserID:        "user_01WCz1FkmYMm4gnmykNKUu3Q",
			WorkspaceRole: anthropic.BetaNoBillingWorkspaceRoleWorkspaceAdmin,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspaceMember.UserID)
}
```

##### Response (200)

```json
{
  "type": "workspace_member",
  "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "workspace_role": "workspace_admin"
}
```

### Get Workspace Member

`client.Beta.Organization.Workspaces.Members.Get(ctx, userID, query) (*BetaWorkspaceMember, error)`

**GET** `/v1/organizations/workspaces/{workspace_id}/members/{user_id}`

Get Workspace Member

#### Parameters

- `userID string` (path parameter)

  ID of the User.

- `query BetaOrganizationWorkspaceMemberGetParams`

  - `WorkspaceID string` (path parameter)

    ID of the Workspace.

#### Returns

- `type BetaWorkspaceMember`

  - `Type WorkspaceMember`

    Object type.

    For Workspace Members, this is always `"workspace_member"`.

    default: workspace_member

  - `UserID string`

    ID of the User.

  - `WorkspaceID string`

    ID of the Workspace.

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the Workspace Member.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaWorkspaceMember, err := client.Beta.Organization.Workspaces.Members.Get(
		context.TODO(),
		"user_id",
		anthropic.BetaOrganizationWorkspaceMemberGetParams{
			WorkspaceID: "workspace_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspaceMember.UserID)
}
```

##### Response (200)

```json
{
  "type": "workspace_member",
  "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "workspace_role": "workspace_admin"
}
```

### Update Workspace Member

`client.Beta.Organization.Workspaces.Members.Update(ctx, userID, params) (*BetaWorkspaceMember, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}/members/{user_id}`

Update Workspace Member

#### Parameters

- `userID string` (path parameter)

  ID of the User.

- `params BetaOrganizationWorkspaceMemberUpdateParams`

  - `WorkspaceID string` (path parameter)

    ID of the Workspace.

  - `WorkspaceRole BetaWorkspaceRole`

    New workspace role for the User.

#### Returns

- `type BetaWorkspaceMember`

  - `Type WorkspaceMember`

    Object type.

    For Workspace Members, this is always `"workspace_member"`.

    default: workspace_member

  - `UserID string`

    ID of the User.

  - `WorkspaceID string`

    ID of the Workspace.

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the Workspace Member.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaWorkspaceMember, err := client.Beta.Organization.Workspaces.Members.Update(
		context.TODO(),
		"user_id",
		anthropic.BetaOrganizationWorkspaceMemberUpdateParams{
			WorkspaceID:   "workspace_id",
			WorkspaceRole: anthropic.BetaWorkspaceRoleWorkspaceAdmin,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspaceMember.UserID)
}
```

##### Response (200)

```json
{
  "type": "workspace_member",
  "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "workspace_role": "workspace_admin"
}
```

### Delete Workspace Member

`client.Beta.Organization.Workspaces.Members.Remove(ctx, userID, body) (*BetaOrganizationWorkspaceMemberRemoveResponse, error)`

**DELETE** `/v1/organizations/workspaces/{workspace_id}/members/{user_id}`

Delete Workspace Member

#### Parameters

- `userID string` (path parameter)

  ID of the User.

- `body BetaOrganizationWorkspaceMemberRemoveParams`

  - `WorkspaceID string` (path parameter)

    ID of the Workspace.

#### Returns

- `type BetaOrganizationWorkspaceMemberRemoveResponse`

  - `Type WorkspaceMemberDeleted`

    Deleted object type.

    For Workspace Members, this is always `"workspace_member_deleted"`.

    default: workspace_member_deleted

  - `UserID string`

    ID of the User.

  - `WorkspaceID string`

    ID of the Workspace.

#### 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"),
	)
	member, err := client.Beta.Organization.Workspaces.Members.Remove(
		context.TODO(),
		"user_id",
		anthropic.BetaOrganizationWorkspaceMemberRemoveParams{
			WorkspaceID: "workspace_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", member.UserID)
}
```

##### Response (200)

```json
{
  "type": "workspace_member_deleted",
  "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
}
```

## Beta › Organization › Workspaces › Service Accounts

### List Service Account Workspace Members

`client.Beta.Organization.Workspaces.ServiceAccounts.List(ctx, workspaceID, params) (*PageCursor[BetaServiceAccountWorkspaceMember], error)`

**GET** `/v1/organizations/workspaces/{workspace_id}/service_accounts`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

List the service accounts that are members of a workspace.

Each entry includes the service account's `workspace_role`. Use `limit`
and the `next_page` cursor to paginate. Archived workspaces return 400;
use `GET /service_accounts/{id}/workspaces` to audit memberships of an
archived workspace. The implicit default-workspace membership is not
included in this list. Memberships of archived service accounts are
omitted from the results.

#### Parameters

- `workspaceID string` (path parameter)

  ID of the workspace.

- `params BetaOrganizationWorkspaceServiceAccountListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page.

    minimum: 1, maximum: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

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

#### Returns

- `type BetaServiceAccountWorkspaceMember`

  - `Type ServiceAccountWorkspaceMember`

    default: service_account_workspace_member

  - `CreatedByActorID string`

    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.

  - `Implicit bool`

    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`).

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`).

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	page, err := client.Beta.Organization.Workspaces.ServiceAccounts.List(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceServiceAccountListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "created_by_actor_id": "created_by_actor_id",
      "implicit": true,
      "service_account_id": "service_account_id",
      "type": "service_account_workspace_member",
      "workspace_id": "workspace_id",
      "workspace_role": "workspace_admin"
    }
  ],
  "next_page": "next_page"
}
```

### Create Service Account Workspace Member

`client.Beta.Organization.Workspaces.ServiceAccounts.Add(ctx, workspaceID, params) (*BetaServiceAccountWorkspaceMember, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}/service_accounts`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Add a service account to a workspace with the given `workspace_role`.

The role determines what the service account can do in the workspace and
which workspace-scoped permissions it can be granted when authenticating
through federation. Every service account is already an implicit
`workspace_user` member of the default workspace; adding it explicitly
assigns a chosen role. If the service account is already an explicit
member of the workspace, its `workspace_role` is replaced with the
value supplied here. Archived workspaces return 400. Archived service
accounts cannot be added and are rejected.

#### Parameters

- `workspaceID string` (path parameter)

  ID of the workspace.

- `params BetaOrganizationWorkspaceServiceAccountAddParams`

  - `ServiceAccountID string`

    Tagged service account ID to add.

  - `WorkspaceRole BetaNoBillingWorkspaceRole`

    Role to assign to the service account in this workspace.

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

#### Returns

- `type BetaServiceAccountWorkspaceMember`

  - `Type ServiceAccountWorkspaceMember`

    default: service_account_workspace_member

  - `CreatedByActorID string`

    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.

  - `Implicit bool`

    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`).

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`).

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaServiceAccountWorkspaceMember, err := client.Beta.Organization.Workspaces.ServiceAccounts.Add(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceServiceAccountAddParams{
			ServiceAccountID: "service_account_id",
			WorkspaceRole:    anthropic.BetaNoBillingWorkspaceRoleWorkspaceAdmin,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccountWorkspaceMember.CreatedByActorID)
}
```

##### Response (200)

```json
{
  "created_by_actor_id": "created_by_actor_id",
  "implicit": true,
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member",
  "workspace_id": "workspace_id",
  "workspace_role": "workspace_admin"
}
```

### Get Service Account Workspace Member

`client.Beta.Organization.Workspaces.ServiceAccounts.Get(ctx, serviceAccountID, params) (*BetaServiceAccountWorkspaceMember, error)`

**GET** `/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Retrieve a service account's membership in a workspace.

Returns the membership record, including the service account's
`workspace_role` in this workspace. Archived workspaces return 400. For
the default workspace, returns the implicit (`implicit: true`)
membership when no explicit membership exists; an explicitly added
membership is returned with its assigned role. An archived service
account returns 404.

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account.

- `params BetaOrganizationWorkspaceServiceAccountGetParams`

  - `WorkspaceID string` (path parameter)

    ID of the workspace.

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

#### Returns

- `type BetaServiceAccountWorkspaceMember`

  - `Type ServiceAccountWorkspaceMember`

    default: service_account_workspace_member

  - `CreatedByActorID string`

    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.

  - `Implicit bool`

    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`).

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`).

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaServiceAccountWorkspaceMember, err := client.Beta.Organization.Workspaces.ServiceAccounts.Get(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationWorkspaceServiceAccountGetParams{
			WorkspaceID: "workspace_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccountWorkspaceMember.CreatedByActorID)
}
```

##### Response (200)

```json
{
  "created_by_actor_id": "created_by_actor_id",
  "implicit": true,
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member",
  "workspace_id": "workspace_id",
  "workspace_role": "workspace_admin"
}
```

### Update Service Account Workspace Member

`client.Beta.Organization.Workspaces.ServiceAccounts.Update(ctx, serviceAccountID, params) (*BetaServiceAccountWorkspaceMember, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Change a service account's role in a workspace.

The new `workspace_role` replaces the current one. Only explicit
memberships can be updated; to set a role on the implicit
default-workspace membership, add the service account explicitly with
`POST /workspaces/{workspace_id}/service_accounts`. Archived workspaces
return 400. Archived service accounts cannot be updated and are
rejected.

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account.

- `params BetaOrganizationWorkspaceServiceAccountUpdateParams`

  - `WorkspaceID string` (path parameter)

    ID of the workspace.

  - `WorkspaceRole BetaNoBillingWorkspaceRole`

    New role for the service account in this workspace.

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

#### Returns

- `type BetaServiceAccountWorkspaceMember`

  - `Type ServiceAccountWorkspaceMember`

    default: service_account_workspace_member

  - `CreatedByActorID string`

    Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.

  - `Implicit bool`

    True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role `workspace_user` and cannot be removed.

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`).

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`).

  - `WorkspaceRole BetaWorkspaceRole`

    Role of the service account in this workspace. Service accounts cannot hold the `workspace_billing` role.

    - `const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"`

    - `const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"`

    - `const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"`

    - `const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"`

    - `const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"`

#### 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"),
	)
	betaServiceAccountWorkspaceMember, err := client.Beta.Organization.Workspaces.ServiceAccounts.Update(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationWorkspaceServiceAccountUpdateParams{
			WorkspaceID:   "workspace_id",
			WorkspaceRole: anthropic.BetaNoBillingWorkspaceRoleWorkspaceAdmin,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaServiceAccountWorkspaceMember.CreatedByActorID)
}
```

##### Response (200)

```json
{
  "created_by_actor_id": "created_by_actor_id",
  "implicit": true,
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member",
  "workspace_id": "workspace_id",
  "workspace_role": "workspace_admin"
}
```

### Delete Service Account Workspace Member

`client.Beta.Organization.Workspaces.ServiceAccounts.Remove(ctx, serviceAccountID, params) (*BetaOrganizationWorkspaceServiceAccountRemoveResponse, error)`

**DELETE** `/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}`

**Requires an OAuth access token with the `org:admin` scope**, from `ant auth login --scope org:admin` or a workload identity federation rule; Admin API keys are not accepted. See [Manage WIF with the Admin API](https://platform.claude.com/docs/en/manage-claude/wif-admin-api?sdk_languages=go).

Remove a service account from a workspace.

Removal is idempotent (returns 200 even if the membership was already
removed). A DELETE against the implicit default-workspace membership
returns 200 but is a no-op and the membership persists; deleting an
explicit default-workspace row reverts to the implicit `workspace_user`
membership. Archived workspaces return 400.

#### Parameters

- `serviceAccountID string` (path parameter)

  ID of the service account.

- `params BetaOrganizationWorkspaceServiceAccountRemoveParams`

  - `WorkspaceID string` (path parameter)

    ID of the workspace.

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

#### Returns

- `type BetaOrganizationWorkspaceServiceAccountRemoveResponse`

  - `Type ServiceAccountWorkspaceMemberDeleted`

    default: service_account_workspace_member_deleted

  - `ServiceAccountID string`

    Tagged service account ID (`svac_...`) named in the delete request. Removal is idempotent; see the endpoint description for the implicit-membership no-op.

  - `WorkspaceID string`

    Tagged workspace ID (`wrkspc_...`) named in the delete request.

#### 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"),
	)
	serviceAccount, err := client.Beta.Organization.Workspaces.ServiceAccounts.Remove(
		context.TODO(),
		"service_account_id",
		anthropic.BetaOrganizationWorkspaceServiceAccountRemoveParams{
			WorkspaceID: "workspace_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", serviceAccount.ServiceAccountID)
}
```

##### Response (200)

```json
{
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member_deleted",
  "workspace_id": "workspace_id"
}
```

## Beta › Organization › Rate Limits

### List Organization Rate Limits

`client.Beta.Organization.RateLimits.List(ctx, query) (*PageCursor[BetaOrganizationRateLimit], error)`

**GET** `/v1/organizations/rate_limits`

List Messages API rate limits for your organization.

Each entry corresponds to one rate-limit group (either a model family
or an API-surface category such as the Message Batches API or the web
search tool) and contains the set of limiter values that apply to it.

When `limit` is omitted, every matching entry is returned in a single
page; when `limit` truncates the result, follow `next_page` to fetch
the remaining entries.

#### Parameters

- `query BetaOrganizationRateLimitListParams`

  - `GroupType BetaOrganizationRateLimitListParamsGroupType Optional` (query parameter)

    Filter by group type.

    - `const BetaOrganizationRateLimitListParamsGroupTypeBatch BetaOrganizationRateLimitListParamsGroupType = "batch"`

    - `const BetaOrganizationRateLimitListParamsGroupTypeFiles BetaOrganizationRateLimitListParamsGroupType = "files"`

    - `const BetaOrganizationRateLimitListParamsGroupTypeModelGroup BetaOrganizationRateLimitListParamsGroupType = "model_group"`

    - `const BetaOrganizationRateLimitListParamsGroupTypeSkills BetaOrganizationRateLimitListParamsGroupType = "skills"`

    - `const BetaOrganizationRateLimitListParamsGroupTypeTokenCount BetaOrganizationRateLimitListParamsGroupType = "token_count"`

    - `const BetaOrganizationRateLimitListParamsGroupTypeWebSearch BetaOrganizationRateLimitListParamsGroupType = "web_search"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of items to return per page. Ranges from `1` to `1000`.

    When omitted, every remaining entry is returned in a single page and `next_page` is `null`.

    minimum: 1, maximum: 1000

  - `Model param.Opt[string] Optional` (query parameter)

    Filter to the single entry containing this model. Accepts full model names and aliases. Returns 404 if the model is not found or has no rate limits for this organization.

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

#### Returns

- `type BetaOrganizationRateLimit`

  - `Type RateLimit`

    Object type. Always `rate_limit` for organization rate-limit entries.

    default: rate_limit

  - `ID string`

    Identifier of this rate-limit entry. It is stable within the organization and differs between organizations; the group's own identifier is `group.id`.

  - `Group BetaOrganizationRateLimitGroupUnion`

    The rate-limit group this entry's limits apply to. Its `type` equals `group_type`.

    - `type BetaOrganizationRateLimitModelGroup`

      - `Type ModelGroup`

        Always `model_group`: a family of models.

        default: model_group

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

      - `DisplayName string`

        Human-readable name of the model group (for example, `Claude Sonnet 4.x`). For display only; it may change.

    - `type BetaOrganizationRateLimitBatchGroup`

      - `Type Batch`

        Always `batch`: the Message Batches API.

        default: batch

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitTokenCountGroup`

      - `Type TokenCount`

        Always `token_count`: the Token Count API.

        default: token_count

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitFilesGroup`

      - `Type Files`

        Always `files`: the Files API.

        default: files

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitSkillsGroup`

      - `Type Skills`

        Always `skills`: the Skills API.

        default: skills

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitWebSearchGroup`

      - `Type WebSearch`

        Always `web_search`: the Messages API web search tool.

        default: web_search

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

  - `Limits []BetaOrganizationRateLimitValue`

    The limiter values that apply to this group.

    - `Type string`

      The limiter type (for example, `requests_per_minute` or `input_tokens_per_minute`).

    - `Value int64`

      The configured limit value for this limiter type.

  - `Models []string`

    Model names this entry's limits apply to, including aliases. `null` when `group_type` is not `"model_group"`.

  - `GroupType BetaOrganizationRateLimitGroupType`

    **Deprecated**: Use `group.type` instead. `group_type` is still returned and always equals `group.type`.

    Deprecated: use `group.type` instead. The kind of rate-limit group this entry represents. `model_group` entries apply to a family of models (listed in `models`); other values apply to an API-surface category and have `models` set to `null`. Always equal to `group.type`.

    - `const BetaOrganizationRateLimitGroupTypeBatch BetaOrganizationRateLimitGroupType = "batch"`

    - `const BetaOrganizationRateLimitGroupTypeFiles BetaOrganizationRateLimitGroupType = "files"`

    - `const BetaOrganizationRateLimitGroupTypeModelGroup BetaOrganizationRateLimitGroupType = "model_group"`

    - `const BetaOrganizationRateLimitGroupTypeSkills BetaOrganizationRateLimitGroupType = "skills"`

    - `const BetaOrganizationRateLimitGroupTypeTokenCount BetaOrganizationRateLimitGroupType = "token_count"`

    - `const BetaOrganizationRateLimitGroupTypeWebSearch BetaOrganizationRateLimitGroupType = "web_search"`

#### 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"),
	)
	page, err := client.Beta.Organization.RateLimits.List(context.TODO(), anthropic.BetaOrganizationRateLimitListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "group": {
        "id": "id",
        "display_name": "display_name",
        "type": "model_group"
      },
      "group_type": "batch",
      "limits": [
        {
          "type": "type",
          "value": 0
        }
      ],
      "models": [
        "string"
      ],
      "type": "rate_limit"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Compliance Settings

### Get Compliance Settings

`client.Beta.Organization.ComplianceSettings.Get(ctx) (*BetaComplianceSettings, error)`

**GET** `/v1/organizations/compliance_settings`

Retrieve your organization's Compliance Settings.

Compliance Settings is a singleton resource: there is exactly one per
organization, addressed without an identifier. The `state` field reflects
whether the Compliance API is enabled. An organization with a parent
organization reads the state inherited from the parent's configuration.

#### Returns

- `type BetaComplianceSettings`

  - `Type ComplianceSettings`

    default: compliance_settings

  - `State BetaComplianceSettingsStateUnion`

    Whether the Compliance API is enabled for this organization.

    - `type BetaComplianceSettingsStateEnabled`

      - `Type Enabled`

        default: enabled

    - `type BetaComplianceSettingsStateDisabled`

      - `Type Disabled`

        default: disabled

#### 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"),
	)
	betaComplianceSettings, err := client.Beta.Organization.ComplianceSettings.Get(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaComplianceSettings.State)
}
```

##### Response (200)

```json
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}
```

### Update Compliance Settings

`client.Beta.Organization.ComplianceSettings.Update(ctx, body) (*BetaComplianceSettings, error)`

**POST** `/v1/organizations/compliance_settings`

Update your organization's Compliance Settings.

Setting `state` to `enabled` turns on the Compliance API and begins
capturing organization activity events. Setting it to `disabled` turns
both off. `state` reflects whether the Compliance API is enabled.

A request that sets `state` to its current value succeeds and leaves the
resource unchanged. A `disabled` request stays in effect until a later
`enabled` request or the organization's next provisioning action that
enables Access Transparency: enabling Access Transparency also enables
the Compliance API, which serves its activity events, so such
provisioning (including re-runs) re-enables the Compliance API even
after a `disabled` request. Automated provisioning never disables
compliance settings.

#### Parameters

- `body BetaOrganizationComplianceSettingUpdateParams`

  - `State BetaComplianceSettingsStateParamUnion`

    Desired state. Accepts the string shorthand "enabled" or "disabled" in place of the object form; the response always returns the canonical object form.

#### Returns

- `type BetaComplianceSettings`

  - `Type ComplianceSettings`

    default: compliance_settings

  - `State BetaComplianceSettingsStateUnion`

    Whether the Compliance API is enabled for this organization.

    - `type BetaComplianceSettingsStateEnabled`

      - `Type Enabled`

        default: enabled

    - `type BetaComplianceSettingsStateDisabled`

      - `Type Disabled`

        default: disabled

#### 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"),
	)
	betaComplianceSettings, err := client.Beta.Organization.ComplianceSettings.Update(context.TODO(), anthropic.BetaOrganizationComplianceSettingUpdateParams{
		State: anthropic.BetaComplianceSettingsStateParamUnion{
			OfEnabled: &anthropic.BetaComplianceSettingsStateEnabledParam{},
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaComplianceSettings.State)
}
```

##### Response (200)

```json
{
  "state": {
    "type": "enabled"
  },
  "type": "compliance_settings"
}
```

## Beta › Organization › Analytics › Summaries

### Get Activity Summaries

`client.Beta.Organization.Analytics.Summaries.List(ctx, query) (*PageCursor[BetaAnalyticsSingleDayActivitySummary], error)`

**GET** `/v1/organizations/analytics/summaries`

Get organization-wide activity summaries for a date range.

Returns one entry per day from `starting_date` (inclusive) to `ending_date`
(exclusive) in `data`, the same `data` / `next_page` envelope as the other
analytics list endpoints; the series is currently returned in full, so
`next_page` is always null.
Data is typically available with a 1-day lag and may be revised by a few
percent over the following days: when `ending_date` is omitted it
defaults to the most recent available day + 1, so the last entry covers
the most recent available day. The series can be scoped to an RBAC group
via `filter[]=rbac_group_id:{id}`. Available to organizations on a Claude
Enterprise plan. Requires an API key with the `read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsSummaryListParams`

  - `StartingDate Time` (query parameter)

    UTC date in YYYY-MM-DD format. Start of the date range (inclusive). Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `EndingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. End of the date range (exclusive). Data is typically available with a 1-day lag, so this can be at most today — which is also the default when omitted, making the last entry cover the most recent available day. Data may be revised by a few percent over the following days. The range may span at most 366 days.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`. Only `rbac_group_id` is supported (e.g. `filter[]=rbac_group_id:{id}`); repeat the param to OR across groups. Scopes the whole day series to members of the matching group(s), re-aggregated from member-level activity — org-wide seat/invite fields and the adoption rates derived from them are null on scoped rows. `rbac_group_id` accepts the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each UTC day (time-of-usage attribution). At most 100 entries.

    maxItems: 100

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page (1-1000, default 100). The day series (at most 366 entries) is currently returned in full in a single page, so `limit` does not yet shorten it.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field. `next_page` is currently always null, so there is never a cursor to send.

#### Returns

- `type BetaAnalyticsSingleDayActivitySummary`

  Per-day entry in the /summaries response.

  - `AssignedSeatCount int64`

    Number of seats currently assigned to members. Null when the response is scoped to an RBAC group — seat assignment is org-wide and has no per-group analogue.

  - `CoworkDailyActiveUserCount int64`

    Number of users with Cowork activity on the requested day

  - `CoworkMonthlyActiveUserCount int64`

    Number of users with Cowork activity in the 30-day rolling window

  - `CoworkWeeklyActiveUserCount int64`

    Number of users with Cowork activity in the 7-day rolling window

  - `DailyActiveUserCount int64`

    Number of users with token consumption on the requested day

  - `DailyAdoptionRate float64`

    Percentage of assigned seats with activity on the requested day (`DAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

  - `EndingAt Time`

    End of the aggregation period (exclusive), UTC midnight in RFC 3339 format (e.g. `2026-01-16T00:00:00Z`).

    format: date-time

  - `MonthlyActiveUserCount int64`

    Number of users with token consumption in the 30-day rolling window

  - `MonthlyAdoptionRate float64`

    Percentage of assigned seats with activity in the 30-day rolling window (`MAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

  - `PendingInviteCount int64`

    Number of pending invitations to join the organization. Null when the response is scoped to an RBAC group.

  - `StartingAt Time`

    Start of the aggregation period (inclusive), UTC midnight in RFC 3339 format (e.g. `2026-01-15T00:00:00Z`).

    format: date-time

  - `WeeklyActiveUserCount int64`

    Number of users with token consumption in the 7-day rolling window

  - `WeeklyAdoptionRate float64`

    Percentage of assigned seats with activity in the 7-day rolling window (`WAU / assigned_seat_count * 100`). Null when the response is scoped to an RBAC group.

  - `ChatCoworkUnifiedDailyActiveUserCount int64 Optional`

    Number of users with activity in Chat and Cowork unified on the requested day. Omitted from the response on deployments that do not offer Chat and Cowork unified.

  - `ChatCoworkUnifiedMonthlyActiveUserCount int64 Optional`

    Number of users with activity in Chat and Cowork unified in the 28-day rolling window (30 days when the request filters by `rbac_group_id`). Omitted from the response on deployments that do not offer Chat and Cowork unified.

  - `ChatCoworkUnifiedWeeklyActiveUserCount int64 Optional`

    Number of users with activity in Chat and Cowork unified in the 7-day rolling window. Omitted from the response on deployments that do not offer Chat and Cowork unified.

  - `ChatDailyActiveUserCount int64 Optional`

    Number of users with claude.ai (chat) activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ChatMonthlyActiveUserCount int64 Optional`

    Number of users with claude.ai (chat) activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ChatWeeklyActiveUserCount int64 Optional`

    Number of users with claude.ai (chat) activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ClaudeCodeDailyActiveUserCount int64 Optional`

    Number of users with Claude Code activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ClaudeCodeMonthlyActiveUserCount int64 Optional`

    Number of users with Claude Code activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ClaudeCodeWeeklyActiveUserCount int64 Optional`

    Number of users with Claude Code activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ClaudeDesignDailyActiveUserCount int64 Optional`

    Number of users with Claude Design activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ClaudeDesignMonthlyActiveUserCount int64 Optional`

    Number of users with Claude Design activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ClaudeDesignWeeklyActiveUserCount int64 Optional`

    Number of users with Claude Design activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `OfficeAgentDailyActiveUserCount int64 Optional`

    Number of users with Claude in Office activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `OfficeAgentMonthlyActiveUserCount int64 Optional`

    Number of users with Claude in Office activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `OfficeAgentWeeklyActiveUserCount int64 Optional`

    Number of users with Claude in Office activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ScienceDailyActiveUserCount int64 Optional`

    Number of users with Claude Science activity on the requested day. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ScienceEntitledUserCount int64 Optional`

    Number of users with a Claude Science seat entitlement (per-seat RBAC) at the time of the daily snapshot. The funnel top; independent of the org-level Claude Science toggle. Null when the response is scoped to an RBAC group — entitlement is org-wide and has no per-group analogue. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ScienceMonthlyActiveUserCount int64 Optional`

    Number of users with Claude Science activity in the 30-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

  - `ScienceWeeklyActiveUserCount int64 Optional`

    Number of users with Claude Science activity in the 7-day rolling window. Omitted from the response while the per-product breakdown is not enabled for this organization.

#### Example

```go
package main

import (
	"context"
	"fmt"
	"time"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.Analytics.Summaries.List(context.TODO(), anthropic.BetaOrganizationAnalyticsSummaryListParams{
		StartingDate: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "assigned_seat_count": 0,
      "cowork_daily_active_user_count": 0,
      "cowork_monthly_active_user_count": 0,
      "cowork_weekly_active_user_count": 0,
      "daily_active_user_count": 0,
      "daily_adoption_rate": 0,
      "ending_at": "2019-12-27T18:11:19.117Z",
      "monthly_active_user_count": 0,
      "monthly_adoption_rate": 0,
      "pending_invite_count": 0,
      "starting_at": "2019-12-27T18:11:19.117Z",
      "weekly_active_user_count": 0,
      "weekly_adoption_rate": 0,
      "chat_cowork_unified_daily_active_user_count": 0,
      "chat_cowork_unified_monthly_active_user_count": 0,
      "chat_cowork_unified_weekly_active_user_count": 0,
      "chat_daily_active_user_count": 0,
      "chat_monthly_active_user_count": 0,
      "chat_weekly_active_user_count": 0,
      "claude_code_daily_active_user_count": 0,
      "claude_code_monthly_active_user_count": 0,
      "claude_code_weekly_active_user_count": 0,
      "claude_design_daily_active_user_count": 0,
      "claude_design_monthly_active_user_count": 0,
      "claude_design_weekly_active_user_count": 0,
      "office_agent_daily_active_user_count": 0,
      "office_agent_monthly_active_user_count": 0,
      "office_agent_weekly_active_user_count": 0,
      "science_daily_active_user_count": 0,
      "science_entitled_user_count": 0,
      "science_monthly_active_user_count": 0,
      "science_weekly_active_user_count": 0
    }
  ],
  "next_page": "next_page",
  "summaries": [
    {
      "assigned_seat_count": 0,
      "cowork_daily_active_user_count": 0,
      "cowork_monthly_active_user_count": 0,
      "cowork_weekly_active_user_count": 0,
      "daily_active_user_count": 0,
      "daily_adoption_rate": 0,
      "ending_at": "2019-12-27T18:11:19.117Z",
      "monthly_active_user_count": 0,
      "monthly_adoption_rate": 0,
      "pending_invite_count": 0,
      "starting_at": "2019-12-27T18:11:19.117Z",
      "weekly_active_user_count": 0,
      "weekly_adoption_rate": 0,
      "chat_cowork_unified_daily_active_user_count": 0,
      "chat_cowork_unified_monthly_active_user_count": 0,
      "chat_cowork_unified_weekly_active_user_count": 0,
      "chat_daily_active_user_count": 0,
      "chat_monthly_active_user_count": 0,
      "chat_weekly_active_user_count": 0,
      "claude_code_daily_active_user_count": 0,
      "claude_code_monthly_active_user_count": 0,
      "claude_code_weekly_active_user_count": 0,
      "claude_design_daily_active_user_count": 0,
      "claude_design_monthly_active_user_count": 0,
      "claude_design_weekly_active_user_count": 0,
      "office_agent_daily_active_user_count": 0,
      "office_agent_monthly_active_user_count": 0,
      "office_agent_weekly_active_user_count": 0,
      "science_daily_active_user_count": 0,
      "science_entitled_user_count": 0,
      "science_monthly_active_user_count": 0,
      "science_weekly_active_user_count": 0
    }
  ]
}
```

## Beta › Organization › Analytics › Users

### List User Activity

`client.Beta.Organization.Analytics.Users.List(ctx, query) (*PageCursor[BetaAnalyticsUserActivity], error)`

**GET** `/v1/organizations/analytics/users`

Get per-user activity for a given day, with cursor-based pagination.

Returns activity metrics for each user in the organization, sorted by email
address. Use `group_by[]` for per-RBAC-group aggregates, or `filter[]` to
scope results to specific members, groups, or a chat project. Available
to organizations on a Claude Enterprise plan. Requires an API key with
the `read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsUserListParams`

  - `Date param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. The day to get user activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `EndingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `project_id`, `rbac_group_id`, `user_id`. Value forms: `project_id` takes a tagged project id (`claude_proj_...`); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries. A `project_id` filter limits each member's row to their claude.ai chat activity in that project and cannot be combined with `group_by[]` or an `rbac_group_id` filter. On these rows, every count in `chat_cowork_unified_metrics.sessions` is 0, because sessions are not measured per project. On any day a member sent a chat message in Chat and Cowork unified, all of that member's project activity for the day is counted in `chat_cowork_unified_metrics.chat` instead of `chat_metrics`.

    maxItems: 100

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break results out by (e.g. `group_by[]=rbac_group_id`). Supported on this endpoint: `rbac_group_id`. Rows are already per-member, so the one supported grouping aggregates them per RBAC group instead. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUserListParamsGroupByRBACGroupID BetaOrganizationAnalyticsUserListParamsGroupBy = "rbac_group_id"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page (1-1000, default 100).

    minimum: 1, maximum: 1000

  - `Order BetaOrganizationAnalyticsUserListParamsOrder Optional` (query parameter)

    Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

    - `const BetaOrganizationAnalyticsUserListParamsOrderAsc BetaOrganizationAnalyticsUserListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsUserListParamsOrderDesc BetaOrganizationAnalyticsUserListParamsOrder = "desc"`

  - `OrderBy param.Opt[string] Optional` (query parameter)

    Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `StartingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

#### Returns

- `type BetaAnalyticsUserActivity`

  Per-user activity data for a given day.

  - `ChatMetrics BetaAnalyticsChatMetrics`

    Claude.ai activity metrics for a single user on a given day.

    - `ConnectorsUsedCount int64`

      Number of MCP connector invocations.

    - `DistinctArtifactsCreatedCount int64`

      Number of distinct artifacts created. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

    - `DistinctConnectorsUsedCount int64`

      Distinct claude.ai connectors this user used. Excludes calls whose connector could not be identified and all calls from organizations with zero data retention. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctConversationCount int64`

      Number of distinct conversations the user participated in. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctFilesUploadedCount int64`

      Number of distinct files uploaded. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctProjectsCreatedCount int64`

      Number of distinct projects created. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

    - `DistinctProjectsUsedCount int64`

      Number of distinct projects used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctSharedArtifactsViewedCount int64`

      Number of distinct shared artifacts the user viewed. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctSkillsUsedCount int64`

      Number of distinct skills used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `MessageCount int64`

      Number of messages sent

    - `SharedConversationsViewedCount int64`

      Number of times the user opened a shared conversation in a project

    - `ThinkingMessageCount int64`

      Number of messages that used extended thinking

  - `ClaudeCodeMetrics BetaAnalyticsClaudeCodeMetrics`

    Claude Code activity metrics for a single user on a given day.

    - `CoreMetrics BetaAnalyticsCoreCodeMetrics`

      Core Claude Code activity metrics for a single user on a given day.

      - `ArtifactsCreatedCount int64`

        Number of artifacts created in Claude Code sessions: an artifact counts once, on the day a session first saves it. Counted from 2026-08-17; 0 on earlier days. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

      - `CommitCount int64`

        Number of commits made via Claude Code

      - `DistinctSessionCount int64`

        Number of distinct Claude Code sessions. On aggregated rows and in date-range mode: summed per-day distinct counts. A session essentially never spans a UTC day, so the sum is in practice the true distinct count.

      - `LinesOfCode BetaAnalyticsLinesOfCode`

        Lines of code added and removed via Claude Code.

        - `AddedCount int64`

          Lines of code added

        - `RemovedCount int64`

          Lines of code removed

      - `PullRequestCount int64`

        Number of pull requests created via Claude Code

    - `ToolActions BetaAnalyticsToolActions`

      Per-tool accepted/rejected counts for Claude Code file modification tools.

      - `EditTool BetaAnalyticsToolActionCounts`

        Accepted/rejected counts for a single Claude Code tool type.

        - `AcceptedCount int64`

          Number of tool proposals accepted

        - `RejectedCount int64`

          Number of tool proposals rejected

      - `MultiEditTool BetaAnalyticsToolActionCounts`

        Accepted/rejected counts for a single Claude Code tool type.

      - `NotebookEditTool BetaAnalyticsToolActionCounts`

        Accepted/rejected counts for a single Claude Code tool type.

      - `WriteTool BetaAnalyticsToolActionCounts`

        Accepted/rejected counts for a single Claude Code tool type.

  - `CoworkMetrics BetaAnalyticsCoworkMetrics`

    Cowork activity metrics for a single user on a given day.

    - `ActionCount int64`

      Number of tool actions completed in Cowork sessions

    - `ArtifactsCreatedCount int64`

      Number of artifacts created in Cowork sessions: an artifact counts once, on the day a session first saves it. Counted from 2026-08-17; 0 on earlier days. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

    - `ConnectorsUsedCount int64`

      Total number of connector invocations in Cowork sessions

    - `DispatchTurnCount int64`

      Number of Dispatch (background agent) turns completed

    - `DistinctConnectorsUsedCount int64`

      Number of distinct connectors used in Cowork sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctSessionCount int64`

      Number of distinct Cowork sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctSkillsUsedCount int64`

      Number of distinct skills used in Cowork sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `MessageCount int64`

      Number of messages sent in Cowork sessions

    - `SkillsUsedCount int64`

      Total number of skill invocations in Cowork sessions

    - `DistinctPluginsUsedCount int64 Optional`

      Number of distinct plugins used in Cowork sessions. Null while Cowork plugin-use metrics are not enabled for this organization. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `EditToolCount int64 Optional`

      Number of successful Edit tool calls in Cowork sessions. Null while the file-edit metrics are not enabled for this organization.

    - `FileEditCount int64 Optional`

      Number of successful file-edit tool calls (Edit, MultiEdit, Write, NotebookEdit) in Cowork sessions. Null, never 0, while the file-edit metrics are not enabled for this organization.

    - `MultiEditToolCount int64 Optional`

      Number of successful MultiEdit tool calls in Cowork sessions. Null while the file-edit metrics are not enabled for this organization.

    - `NotebookEditToolCount int64 Optional`

      Number of successful NotebookEdit tool calls in Cowork sessions. Null while the file-edit metrics are not enabled for this organization.

    - `PluginsUsedCount int64 Optional`

      Total number of plugin invocations in Cowork sessions. Null while Cowork plugin-use metrics are not enabled for this organization.

    - `SessionsWithFileEditsCount int64 Optional`

      Number of distinct Cowork sessions with at least one successful file-edit tool call. Null while the file-edit metrics are not enabled for this organization. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `WriteToolCount int64 Optional`

      Number of successful Write tool calls in Cowork sessions. Null while the file-edit metrics are not enabled for this organization.

  - `DesignMetrics BetaAnalyticsDesignMetrics`

    Claude Design activity metrics for a single user on a given day.

    - `DistinctProjectsCreatedCount int64`

      Number of distinct Claude Design projects created. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

    - `DistinctProjectsUsedCount int64`

      Number of distinct Claude Design projects the user worked in. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `DistinctSessionCount int64`

      Number of distinct Claude Design sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `MessageCount int64`

      Number of messages sent in Claude Design sessions

  - `OfficeMetrics BetaAnalyticsOfficeMetrics`

    Office Agent activity metrics for a single user on a given day, broken out by Office product.

    - `Excel BetaAnalyticsOfficeProductMetrics`

      Office Agent activity metrics for a single user on a given day within one Office product.

      - `ConnectorsUsedCount int64`

        Number of MCP connector invocations

      - `DistinctConnectorsUsedCount int64`

        Number of distinct MCP connectors used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctSessionCount int64`

        Number of distinct Office Agent sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctSkillsUsedCount int64`

        Number of distinct skills used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `MessageCount int64`

        Number of messages sent

      - `SkillsUsedCount int64`

        Number of skill invocations

    - `Outlook BetaAnalyticsOfficeProductMetrics`

      Office Agent activity metrics for a single user on a given day within one Office product.

    - `Powerpoint BetaAnalyticsOfficeProductMetrics`

      Office Agent activity metrics for a single user on a given day within one Office product.

    - `Word BetaAnalyticsOfficeProductMetrics`

      Office Agent activity metrics for a single user on a given day within one Office product.

  - `ScienceMetrics BetaAnalyticsScienceMetrics`

    Claude Science activity metrics for a single user on a given day.

    - `DelegationCount int64`

      Number of delegations (handoffs to a specialized agent) in Claude Science sessions

    - `DistinctSessionCount int64`

      Number of distinct Claude Science sessions. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `MessageCount int64`

      Number of messages sent in Claude Science sessions

    - `RemoteComputeJobCount int64`

      Number of remote compute jobs launched from Claude Science sessions

    - `SkillsUsedCount int64`

      Total number of skill invocations in Claude Science sessions

  - `WebSearchCount int64`

    Number of web searches performed

  - `ChatCoworkUnifiedMetrics BetaAnalyticsUserActivityChatCoworkUnifiedMetrics Optional`

    Activity recorded while the member had Chat and Cowork unified (Cowork's features inside claude.ai chat) turned on, split into `chat` (chat activity) and `sessions` (Cowork activity). Omitted from the response on deployments that do not offer Chat and Cowork unified.

    - `Chat BetaAnalyticsChatCoworkUnifiedChatMetrics`

      Chat activity recorded while members had Chat and Cowork unified turned
      on.

      - `ConnectorsUsedCount int64`

        Same measure as `chat_metrics.connectors_used_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `DistinctArtifactsCreatedCount int64`

        Same measure as `chat_metrics.distinct_artifacts_created_count`, for activity recorded while members had Chat and Cowork unified turned on. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

      - `DistinctConnectorsUsedCount int64`

        Same measure as `chat_metrics.distinct_connectors_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctConversationCount int64`

        Same measure as `chat_metrics.distinct_conversation_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctFilesUploadedCount int64`

        Same measure as `chat_metrics.distinct_files_uploaded_count`, for activity recorded while members had Chat and Cowork unified turned on. It counts uploaded files as well as files Claude created and images returned by Claude's tools, such as screenshots. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctProjectsCreatedCount int64`

        Same measure as `chat_metrics.distinct_projects_created_count`, for activity recorded while members had Chat and Cowork unified turned on. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

      - `DistinctProjectsUsedCount int64`

        Same measure as `chat_metrics.distinct_projects_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctSharedArtifactsViewedCount int64`

        Always null: shared-artifact views are not currently measured.

      - `DistinctSkillsUsedCount int64`

        Same measure as `chat_metrics.distinct_skills_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `MessageCount int64`

        Same measure as `chat_metrics.message_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `SharedConversationsViewedCount int64`

        Same measure as `chat_metrics.shared_conversations_viewed_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `ThinkingMessageCount int64`

        Same measure as `chat_metrics.thinking_message_count`, for activity recorded while members had Chat and Cowork unified turned on.

    - `Sessions BetaAnalyticsChatCoworkUnifiedSessionsMetrics`

      Cowork session activity recorded while members had Chat and Cowork
      unified turned on.

      - `ActionCount int64`

        Same measure as `cowork_metrics.action_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `ArtifactsCreatedCount int64`

        Same measure as `cowork_metrics.artifacts_created_count`, for activity recorded while members had Chat and Cowork unified turned on. Exact in date-range mode: a creation belongs to exactly one day, so the per-day counts never overlap and their sum over the window is the exact count of distinct creations in it.

      - `ConnectorsUsedCount int64`

        Same measure as `cowork_metrics.connectors_used_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `DispatchTurnCount int64`

        Same measure as `cowork_metrics.dispatch_turn_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `DistinctConnectorsUsedCount int64`

        Same measure as `cowork_metrics.distinct_connectors_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctPluginsUsedCount int64`

        Same measure as `cowork_metrics.distinct_plugins_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctSessionCount int64`

        Same measure as `cowork_metrics.distinct_session_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `DistinctSkillsUsedCount int64`

        Same measure as `cowork_metrics.distinct_skills_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `EditToolCount int64`

        Same measure as `cowork_metrics.edit_tool_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `FileEditCount int64`

        Same measure as `cowork_metrics.file_edit_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `MessageCount int64`

        Same measure as `cowork_metrics.message_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `MultiEditToolCount int64`

        Same measure as `cowork_metrics.multi_edit_tool_count`, for activity recorded while members had Chat and Cowork unified turned on. Claude no longer has a multi-edit tool, so expect 0 when not null; each edit is now a separate Edit tool call, counted in `edit_tool_count` and `file_edit_count`.

      - `NotebookEditToolCount int64`

        Same measure as `cowork_metrics.notebook_edit_tool_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `PluginsUsedCount int64`

        Same measure as `cowork_metrics.plugins_used_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `SessionsWithFileEditsCount int64`

        Same measure as `cowork_metrics.sessions_with_file_edits_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

      - `SkillsUsedCount int64`

        Same measure as `cowork_metrics.skills_used_count`, for activity recorded while members had Chat and Cowork unified turned on.

      - `WriteToolCount int64`

        Same measure as `cowork_metrics.write_tool_count`, for activity recorded while members had Chat and Cowork unified turned on.

  - `DistinctUserCount int64 Optional`

    Number of distinct active users represented by this row. Only set for grouped rollups (`group_by[]`); null for per-user rows. In date-range mode, recomputed as an exact distinct count of the group's active members over the requested window, never a sum of per-day values.

  - `LastActivityDate Time Optional`

    Most recent UTC day (YYYY-MM-DD) on which the user had any counted activity, within the requested window: equal to the requested `date` in single-day mode, and to the latest active day from `starting_date` (inclusive) to `ending_date` (exclusive) in date-range rollup mode — never a day earlier than the window start. On filtered requests (`filter[]`) only days matching the filter count: with `filter[]=rbac_group_id:{id}` it is the last day the user was active while a member of that group, consistent with the row's other metrics. On grouped (`group_by[]`) rows it is the latest day any member of the group was active (the requested `date` in single-day mode). Omitted from the response while last-activity reporting is not enabled for this organization.

    format: date

  - `RBACGroupID string Optional`

    Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

  - `RBACGroupName string Optional`

    Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

  - `User BetaAnalyticsUser Optional`

    The user this row describes. Null on rows aggregated across users.

    - `Type User`

      Object type. Always `user`.

      default: user

    - `ID string`

      Tagged user identifier (e.g. `user_...`)

    - `EmailAddress string`

      Email address of the user

#### 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"),
	)
	page, err := client.Beta.Organization.Analytics.Users.List(context.TODO(), anthropic.BetaOrganizationAnalyticsUserListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "chat_metrics": {
        "connectors_used_count": 0,
        "distinct_artifacts_created_count": 0,
        "distinct_connectors_used_count": 0,
        "distinct_conversation_count": 0,
        "distinct_files_uploaded_count": 0,
        "distinct_projects_created_count": 0,
        "distinct_projects_used_count": 0,
        "distinct_shared_artifacts_viewed_count": 0,
        "distinct_skills_used_count": 0,
        "message_count": 0,
        "shared_conversations_viewed_count": 0,
        "thinking_message_count": 0
      },
      "claude_code_metrics": {
        "core_metrics": {
          "artifacts_created_count": 0,
          "commit_count": 0,
          "distinct_session_count": 0,
          "lines_of_code": {
            "added_count": 0,
            "removed_count": 0
          },
          "pull_request_count": 0
        },
        "tool_actions": {
          "edit_tool": {
            "accepted_count": 0,
            "rejected_count": 0
          },
          "multi_edit_tool": {
            "accepted_count": 0,
            "rejected_count": 0
          },
          "notebook_edit_tool": {
            "accepted_count": 0,
            "rejected_count": 0
          },
          "write_tool": {
            "accepted_count": 0,
            "rejected_count": 0
          }
        }
      },
      "cowork_metrics": {
        "action_count": 0,
        "artifacts_created_count": 0,
        "connectors_used_count": 0,
        "dispatch_turn_count": 0,
        "distinct_connectors_used_count": 0,
        "distinct_session_count": 0,
        "distinct_skills_used_count": 0,
        "message_count": 0,
        "skills_used_count": 0,
        "distinct_plugins_used_count": 0,
        "edit_tool_count": 0,
        "file_edit_count": 0,
        "multi_edit_tool_count": 0,
        "notebook_edit_tool_count": 0,
        "plugins_used_count": 0,
        "sessions_with_file_edits_count": 0,
        "write_tool_count": 0
      },
      "design_metrics": {
        "distinct_projects_created_count": 0,
        "distinct_projects_used_count": 0,
        "distinct_session_count": 0,
        "message_count": 0
      },
      "office_metrics": {
        "excel": {
          "connectors_used_count": 0,
          "distinct_connectors_used_count": 0,
          "distinct_session_count": 0,
          "distinct_skills_used_count": 0,
          "message_count": 0,
          "skills_used_count": 0
        },
        "outlook": {
          "connectors_used_count": 0,
          "distinct_connectors_used_count": 0,
          "distinct_session_count": 0,
          "distinct_skills_used_count": 0,
          "message_count": 0,
          "skills_used_count": 0
        },
        "powerpoint": {
          "connectors_used_count": 0,
          "distinct_connectors_used_count": 0,
          "distinct_session_count": 0,
          "distinct_skills_used_count": 0,
          "message_count": 0,
          "skills_used_count": 0
        },
        "word": {
          "connectors_used_count": 0,
          "distinct_connectors_used_count": 0,
          "distinct_session_count": 0,
          "distinct_skills_used_count": 0,
          "message_count": 0,
          "skills_used_count": 0
        }
      },
      "science_metrics": {
        "delegation_count": 0,
        "distinct_session_count": 0,
        "message_count": 0,
        "remote_compute_job_count": 0,
        "skills_used_count": 0
      },
      "web_search_count": 0,
      "chat_cowork_unified_metrics": {
        "chat": {
          "connectors_used_count": 0,
          "distinct_artifacts_created_count": 0,
          "distinct_connectors_used_count": 0,
          "distinct_conversation_count": 0,
          "distinct_files_uploaded_count": 0,
          "distinct_projects_created_count": 0,
          "distinct_projects_used_count": 0,
          "distinct_shared_artifacts_viewed_count": 0,
          "distinct_skills_used_count": 0,
          "message_count": 0,
          "shared_conversations_viewed_count": 0,
          "thinking_message_count": 0
        },
        "sessions": {
          "action_count": 0,
          "artifacts_created_count": 0,
          "connectors_used_count": 0,
          "dispatch_turn_count": 0,
          "distinct_connectors_used_count": 0,
          "distinct_plugins_used_count": 0,
          "distinct_session_count": 0,
          "distinct_skills_used_count": 0,
          "edit_tool_count": 0,
          "file_edit_count": 0,
          "message_count": 0,
          "multi_edit_tool_count": 0,
          "notebook_edit_tool_count": 0,
          "plugins_used_count": 0,
          "sessions_with_file_edits_count": 0,
          "skills_used_count": 0,
          "write_tool_count": 0
        }
      },
      "distinct_user_count": 0,
      "last_activity_date": "2019-12-27",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user": {
        "id": "id",
        "email_address": "email_address",
        "type": "user"
      }
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Analytics › Apps › Chat › Projects

### Get Chat Project Usage

`client.Beta.Organization.Analytics.Apps.Chat.Projects.List(ctx, query) (*PageCursor[BetaAnalyticsProjectActivity], error)`

**GET** `/v1/organizations/analytics/apps/chat/projects`

Get per-project activity for a given day, with cursor-based pagination.

Returns activity metrics for each project in the organization, sorted by
project ID. Use `group_by[]` to break projects out per member or per RBAC
group, and `filter[]` to scope results; the parameter descriptions list the
supported dimensions. Available to organizations on a Claude Enterprise
plan. Requires an API key with the `read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsAppChatProjectListParams`

  - `Date param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. The day to get project activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `EndingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `project_id`, `rbac_group_id`, `user_id`. Value forms: `project_id` takes a tagged project id (`claude_proj_...`); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries.

    maxItems: 100

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

    maxItems: 100

    - `const BetaOrganizationAnalyticsAppChatProjectListParamsGroupByRBACGroupID BetaOrganizationAnalyticsAppChatProjectListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsAppChatProjectListParamsGroupByUserID BetaOrganizationAnalyticsAppChatProjectListParamsGroupBy = "user_id"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page (1-1000, default 100).

    minimum: 1, maximum: 1000

  - `Order BetaOrganizationAnalyticsAppChatProjectListParamsOrder Optional` (query parameter)

    Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

    - `const BetaOrganizationAnalyticsAppChatProjectListParamsOrderAsc BetaOrganizationAnalyticsAppChatProjectListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsAppChatProjectListParamsOrderDesc BetaOrganizationAnalyticsAppChatProjectListParamsOrder = "desc"`

  - `OrderBy param.Opt[string] Optional` (query parameter)

    Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `StartingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

#### Returns

- `type BetaAnalyticsProjectActivity`

  Per-project activity data for a given day.

  - `DistinctUserCount int64`

    Number of distinct users who used the project on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

  - `MessageCount int64`

    Number of messages sent in the project on the requested day

  - `ProjectID string`

    Tagged project identifier (e.g. `claude_proj_...`)

  - `ProjectName string`

    Name of the project

  - `CreatedAt Time Optional`

    Project creation timestamp in RFC 3339 format. Null if the project was deleted before attribution was recorded.

    format: date-time

  - `CreatedBy BetaAnalyticsUser Optional`

    User who created the project. Null if the project was deleted before attribution was recorded, or if the creator's account no longer exists.

    - `Type User`

      Object type. Always `user`.

      default: user

    - `ID string`

      Tagged user identifier (e.g. `user_...`)

    - `EmailAddress string`

      Email address of the user

  - `DistinctConversationCount int64 Optional`

    Number of distinct conversations in the project. Null on aggregated rows where a distinct count cannot be computed.

  - `Product string Optional`

    Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). These are the canonical Cost & Usage product names; an `office_agent` row's per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and `chat_cowork_unified` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

  - `RBACGroupID string Optional`

    Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

  - `RBACGroupName string Optional`

    Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

  - `UserID string Optional`

    Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

#### 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"),
	)
	page, err := client.Beta.Organization.Analytics.Apps.Chat.Projects.List(context.TODO(), anthropic.BetaOrganizationAnalyticsAppChatProjectListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "distinct_user_count": 0,
      "message_count": 0,
      "project_id": "project_id",
      "project_name": "project_name",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "email_address": "email_address",
        "type": "user"
      },
      "distinct_conversation_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Analytics › Connectors

### Get Connector Usage

`client.Beta.Organization.Analytics.Connectors.List(ctx, query) (*PageCursor[BetaAnalyticsConnectorActivity], error)`

**GET** `/v1/organizations/analytics/connectors`

Get per-connector usage for a given day, with cursor-based pagination.

Returns connector usage metrics for the organization, sorted by connector
name. Connector names are normalized from their various sources — for
example, "Atlassian MCP server" and "mcp-atlassian" both appear as
"atlassian". Use `group_by[]` to break usage out per member, per RBAC
group, or per product surface, and `filter[]` to scope results; the
parameter descriptions list the supported dimensions. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsConnectorListParams`

  - `Date param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. The day to get connector usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `EndingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `connector_name`, `product`, `rbac_group_id`, `user_id`. Value forms: `connector_name` matches case-insensitively, a display name such as 'GitHub MCP' also matches its normalized stored form ('github'), and for rows whose `connector_name` is an opaque connector id the connector's display name (`connector_display_name`) also matches; `product` is one of `chat_cowork_unified`, `chat`, `claude_code`, `cowork`, or `office_agent`; `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries. `chat_cowork_unified` is accepted as a `product` value only on deployments that offer Chat and Cowork unified.

    maxItems: 100

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

    maxItems: 100

    - `const BetaOrganizationAnalyticsConnectorListParamsGroupByProduct BetaOrganizationAnalyticsConnectorListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsConnectorListParamsGroupByRBACGroupID BetaOrganizationAnalyticsConnectorListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsConnectorListParamsGroupByUserID BetaOrganizationAnalyticsConnectorListParamsGroupBy = "user_id"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page (1-1000, default 100).

    minimum: 1, maximum: 1000

  - `Order BetaOrganizationAnalyticsConnectorListParamsOrder Optional` (query parameter)

    Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

    - `const BetaOrganizationAnalyticsConnectorListParamsOrderAsc BetaOrganizationAnalyticsConnectorListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsConnectorListParamsOrderDesc BetaOrganizationAnalyticsConnectorListParamsOrder = "desc"`

  - `OrderBy param.Opt[string] Optional` (query parameter)

    Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `StartingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

#### Returns

- `type BetaAnalyticsConnectorActivity`

  Per-connector activity data for a given day.

  - `ChatMetrics BetaAnalyticsConnectorChatMetrics`

    Claude.ai activity metrics for a single connector on a given day.

    - `DistinctConversationConnectorUsedCount int64`

      Number of distinct conversations in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `ClaudeCodeMetrics BetaAnalyticsConnectorClaudeCodeMetrics`

    Claude Code activity metrics for a single connector on a given day.

    - `DistinctSessionConnectorUsedCount int64`

      Number of distinct Claude Code sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `ConnectorName string`

    Name of the connector. Some rows carry an opaque connector id here instead of a readable name; `connector_display_name` holds the resolved name for those rows.

  - `CoworkMetrics BetaAnalyticsConnectorCoworkMetrics`

    Cowork activity metrics for a single connector on a given day.

    - `DistinctSessionConnectorUsedCount int64`

      Number of distinct Cowork sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `DistinctUserCount int64`

    Number of distinct users who used the connector on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

  - `OfficeMetrics BetaAnalyticsConnectorOfficeMetrics`

    Office Agent activity metrics for a single connector on a given day, broken out by Office product.

    - `Excel BetaAnalyticsConnectorOfficeProductMetrics`

      Office Agent activity metrics for a single connector on a given day within one Office product.

      - `DistinctSessionConnectorUsedCount int64`

        Number of distinct Office Agent sessions in which the connector was used. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `Outlook BetaAnalyticsConnectorOfficeProductMetrics`

      Office Agent activity metrics for a single connector on a given day within one Office product.

    - `Powerpoint BetaAnalyticsConnectorOfficeProductMetrics`

      Office Agent activity metrics for a single connector on a given day within one Office product.

    - `Word BetaAnalyticsConnectorOfficeProductMetrics`

      Office Agent activity metrics for a single connector on a given day within one Office product.

  - `ChatCoworkUnifiedMetrics BetaAnalyticsConnectorActivityChatCoworkUnifiedMetrics Optional`

    Connector use recorded while members had Chat and Cowork unified (Cowork's features inside claude.ai chat) turned on, split into chat conversations and Cowork sessions. A count is null in date-range mode where it cannot be computed. Omitted from the response on deployments that do not offer Chat and Cowork unified.

    - `Chat BetaAnalyticsConnectorChatCoworkUnifiedChatMetrics`

      A connector's use in chat conversations recorded while members had
      Chat and Cowork unified turned on.

      - `DistinctConversationConnectorUsedCount int64`

        Same measure as `chat_metrics.distinct_conversation_connector_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `Sessions BetaAnalyticsConnectorChatCoworkUnifiedSessionsMetrics`

      A connector's use in Cowork sessions recorded while members had
      Chat and Cowork unified turned on.

      - `DistinctSessionConnectorUsedCount int64`

        Same measure as `cowork_metrics.distinct_session_connector_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `ConnectorDisplayName string Optional`

    Human-readable display name for rows whose `connector_name` is an opaque connector id rather than a readable name, resolved at request time from the organization's connectors (including connectors that have since been removed). `connector_name` remains the row's stable key for sorting and pagination, and `filter[]=connector_name:{value}` also matches these rows by display name. Display names are not unique, and the same connector's claude.ai usage can appear under a separate row with a readable `connector_name`. Null when `connector_name` is already a readable name, when the id cannot be resolved to one of the organization's connectors, or when display-name resolution is not enabled for this organization.

  - `IndividualAuthDistinctUserCount int64 Optional`

    Number of distinct users whose use of this connector on the requested day ran on their own individual credential, connected through their own consent flow. Companion bucket to `managed_auth_distinct_user_count`, which carries the measurement, attribution, and null rules. Users whose requests used no stored credential count in neither bucket.

  - `ManagedAuthDistinctUserCount int64 Optional`

    Number of distinct users whose use of this connector on the requested day ran on Enterprise Managed Auth (an organization-managed credential provisioned through the organization's identity provider), read from the token record each request used. Null, never 0, when managed-auth reporting is not enabled for the organization, the value cannot be attributed to the row, no credentialed requests and no managed-token mint events (a managed credential being provisioned for a user's use of the connector) were observed that day, or the day predates 2026-07-01, the first day the backing data exists (forward-only data, no backfill). When credentialed requests or mint events were observed and attributed, both managed-auth fields populate, reporting 0 for a bucket with no users; the two counts are independent, not a partition — a user whose requests that day used both kinds of credential counts in both. Mint events carry user but not surface attribution, so they count as observed auth activity on `user_id` and `rbac_group_id` cuts — attributed to the user the credential was provisioned for — but never on a cut that references `product` (group or filter). Date-range rollup mode (`starting_date`/`ending_date`) computes both fields exactly over the window — distinct users with at least one qualifying day — when the whole window starts on or after 2026-07-01, with the null-versus-0 and mint-event rules applying with the window in place of the day; a range starting earlier reports every managed-auth field as null, never a partial-window value.

  - `Product string Optional`

    Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). These are the canonical Cost & Usage product names; an `office_agent` row's per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and `chat_cowork_unified` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

  - `RBACGroupID string Optional`

    Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

  - `RBACGroupName string Optional`

    Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

  - `ReadCallCount int64 Optional`

    Number of connector tool calls on the requested day whose trusted read-only annotation marked them read-only. Call count, not distinct users. Every call recorded on a classified surface lands in exactly one of `read_call_count`, `write_call_count`, or `unclassified_call_count`, so the three sum to the day's classified calls. Classification is forward-only per surface: claude.ai from 2026-06-01, Claude Code from 2026-05-30, Claude in Office from 2026-05-29, Cowork from 2026-06-02 (Cowork clients predating annotation forwarding land in `unclassified_call_count`). Null, never 0, when the value cannot be stated: the read/write split is not enabled for this organization, or the day predates 2026-05-29. For a date-range total, sum the per-day values, but treat a window that extends before 2026-05-29 as null rather than summing only its covered days — date-range rollup mode (`starting_date`/`ending_date`) applies both rules server-side.

  - `UnclassifiedCallCount int64 Optional`

    Number of connector tool calls on the requested day with no trusted read-only annotation — the annotation is optional in the MCP spec and is discarded when connector access controls are active, so unclassified calls are common. This field shows how much of the day's classified activity the read/write split actually covers. Call count, not distinct users. One of the three call-classification buckets; see `read_call_count` for the per-surface data-start dates, null conditions, and date-range guidance.

  - `UserID string Optional`

    Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

  - `WriteCallCount int64 Optional`

    Number of connector tool calls on the requested day whose trusted read-only annotation marked them not read-only. Call count, not distinct users. One of the three call-classification buckets; see `read_call_count` for the per-surface data-start dates, null conditions, and date-range guidance.

#### 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"),
	)
	page, err := client.Beta.Organization.Analytics.Connectors.List(context.TODO(), anthropic.BetaOrganizationAnalyticsConnectorListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "chat_metrics": {
        "distinct_conversation_connector_used_count": 0
      },
      "claude_code_metrics": {
        "distinct_session_connector_used_count": 0
      },
      "connector_name": "connector_name",
      "cowork_metrics": {
        "distinct_session_connector_used_count": 0
      },
      "distinct_user_count": 0,
      "office_metrics": {
        "excel": {
          "distinct_session_connector_used_count": 0
        },
        "outlook": {
          "distinct_session_connector_used_count": 0
        },
        "powerpoint": {
          "distinct_session_connector_used_count": 0
        },
        "word": {
          "distinct_session_connector_used_count": 0
        }
      },
      "chat_cowork_unified_metrics": {
        "chat": {
          "distinct_conversation_connector_used_count": 0
        },
        "sessions": {
          "distinct_session_connector_used_count": 0
        }
      },
      "connector_display_name": "connector_display_name",
      "individual_auth_distinct_user_count": 0,
      "managed_auth_distinct_user_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "read_call_count": 0,
      "unclassified_call_count": 0,
      "user_id": "user_id",
      "write_call_count": 0
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Analytics › Plugins

### Get Plugin Usage

`client.Beta.Organization.Analytics.Plugins.List(ctx, query) (*PageCursor[BetaAnalyticsPluginActivity], error)`

**GET** `/v1/organizations/analytics/plugins`

Get per-plugin install + invocation usage for a given day, with pagination.

Returns plugin usage metrics for the organization across Cowork and Claude
Code, sorted by plugin name. The `plugin_name` value `third-party` is
an aggregate bucket, not a plugin: it collects plugin activity, from
either surface, for which the reporting client did not provide a plugin
name — so an organization's own plugins can contribute both to their own
named rows and to this bucket. Use `group_by[]` to break usage out per
member, per RBAC group, or per product surface (Cowork / Claude Code),
and `filter[]` to scope results; the parameter descriptions list the
supported dimensions. Requires an API key with the
`read:analytics` scope. `starting_date` / `ending_date` select
range-rollup mode like `/skills`.

#### Parameters

- `query BetaOrganizationAnalyticsPluginListParams`

  - `Date param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. The day to get plugin usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `EndingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `plugin_name`, `product`, `rbac_group_id`, `user_id`. Value forms: `plugin_name` matches case-insensitively; `product` is `chat_cowork_unified`, `claude_code`, or `cowork` (the only surfaces with plugin attribution); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries. `chat_cowork_unified` is accepted as a `product` value only on deployments that offer Chat and Cowork unified.

    maxItems: 100

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. On this endpoint `product` takes the values `chat_cowork_unified`, `claude_code`, or `cowork` only (the surfaces with plugin attribution). Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

    maxItems: 100

    - `const BetaOrganizationAnalyticsPluginListParamsGroupByProduct BetaOrganizationAnalyticsPluginListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsPluginListParamsGroupByRBACGroupID BetaOrganizationAnalyticsPluginListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsPluginListParamsGroupByUserID BetaOrganizationAnalyticsPluginListParamsGroupBy = "user_id"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page (1-1000, default 100).

    minimum: 1, maximum: 1000

  - `Order BetaOrganizationAnalyticsPluginListParamsOrder Optional` (query parameter)

    Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

    - `const BetaOrganizationAnalyticsPluginListParamsOrderAsc BetaOrganizationAnalyticsPluginListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsPluginListParamsOrderDesc BetaOrganizationAnalyticsPluginListParamsOrder = "desc"`

  - `OrderBy param.Opt[string] Optional` (query parameter)

    Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `StartingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

#### Returns

- `type BetaAnalyticsPluginActivity`

  Per-plugin install + invocation activity for a given day.

  With `group_by[]=user_id` / `rbac_group_id` / `product` (`cowork`,
  `claude_code` and `chat_cowork_unified` only on this endpoint) each row is
  one (plugin, user), (plugin, group), or (plugin, product) cut: the flat
  `user_id` / `rbac_group_id` / `product` keys carry the cut and the counts
  are scoped to it.

  - `ClaudeCodeMetrics BetaAnalyticsPluginClaudeCodeMetrics`

    Claude Code activity metrics for a single plugin on a given day.

    - `DistinctSessionPluginUsedCount int64`

      Number of distinct Claude Code sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

  - `CoworkMetrics BetaAnalyticsPluginCoworkMetrics`

    Cowork activity metrics for a single plugin on a given day.

    - `DistinctSessionPluginUsedCount int64`

      Number of distinct Cowork sessions in which the plugin was invoked. Null on aggregated rows where a distinct count cannot be computed.

  - `DistinctUserCount int64`

    Number of distinct users with recorded install or invocation activity for the plugin on the requested day (install-only users count), or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

  - `InstallCount int64`

    Number of distinct users who installed the plugin on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values.

  - `InvocationCount int64`

    Number of plugin invocations on the requested day

  - `PluginName string`

    Name of the plugin

  - `ChatCoworkUnifiedMetrics BetaAnalyticsPluginActivityChatCoworkUnifiedMetrics Optional`

    Plugin use recorded while members had Chat and Cowork unified (Cowork's features inside claude.ai chat) turned on. A count is null in date-range mode where it cannot be computed. Omitted from the response on deployments that do not offer Chat and Cowork unified.

    - `DistinctSessionPluginUsedCount int64`

      Same measure as `cowork_metrics.distinct_session_plugin_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Null on aggregated rows where a distinct count cannot be computed.

  - `PluginID string Optional`

    Stable plugin identifier when available (e.g. `serena@claude-plugins-official`). Null for third-party Claude Code plugins (redacted at the source) and Cowork slash commands that carry only a hashed id.

  - `Product string Optional`

    Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). These are the canonical Cost & Usage product names; an `office_agent` row's per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and `chat_cowork_unified` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

  - `RBACGroupID string Optional`

    Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

  - `RBACGroupName string Optional`

    Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

  - `UserID string Optional`

    Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

#### 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"),
	)
	page, err := client.Beta.Organization.Analytics.Plugins.List(context.TODO(), anthropic.BetaOrganizationAnalyticsPluginListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "claude_code_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "cowork_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "distinct_user_count": 0,
      "install_count": 0,
      "invocation_count": 0,
      "plugin_name": "plugin_name",
      "chat_cowork_unified_metrics": {
        "distinct_session_plugin_used_count": 0
      },
      "plugin_id": "plugin_id",
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Analytics › Skills

### Get Skill Usage

`client.Beta.Organization.Analytics.Skills.List(ctx, query) (*PageCursor[BetaAnalyticsSkillActivity], error)`

**GET** `/v1/organizations/analytics/skills`

Get per-skill usage for a given day, with cursor-based pagination.

Returns skill usage metrics for the organization, sorted by skill name.
Use `group_by[]` to break usage out per member, per RBAC group, or per
product surface, and `filter[]` to scope results; the parameter
descriptions list the supported dimensions. Available to organizations
on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsSkillListParams`

  - `Date param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. The day to get skill usage for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `EndingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. End of the date range (exclusive); only valid with `starting_date`. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day), so this can be at most today — which is also the default when omitted, resolved once when the first page is served and reused for the rest of the pagination sequence. At most 366 days after `starting_date`.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `product`, `rbac_group_id`, `share_status`, `skill_name`, `user_id`. Value forms: `product` is one of `chat_cowork_unified`, `chat`, `claude_code`, `cowork`, or `office_agent`; `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `share_status` is one of `organization`, `private`, or `public`; `skill_name` matches case-insensitively; `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries. `chat_cowork_unified` is accepted as a `product` value only on deployments that offer Chat and Cowork unified.

    maxItems: 100

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break results out by (e.g. `group_by[]=user_id`). Supported on this endpoint: `product`, `rbac_group_id`, `user_id`. Grouped rows carry the requested dimension values as additional fields and paginate like ungrouped responses via `next_page`; an unsupported dimension returns 400. `rbac_group_id` attributes a user to every group they held at any point during each covered UTC day, so grouped rows are not an exclusive partition and can sum above org-level totals. At most 100 entries.

    maxItems: 100

    - `const BetaOrganizationAnalyticsSkillListParamsGroupByProduct BetaOrganizationAnalyticsSkillListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsSkillListParamsGroupByRBACGroupID BetaOrganizationAnalyticsSkillListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsSkillListParamsGroupByUserID BetaOrganizationAnalyticsSkillListParamsGroupBy = "user_id"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of results per page (1-1000, default 100).

    minimum: 1, maximum: 1000

  - `Order BetaOrganizationAnalyticsSkillListParamsOrder Optional` (query parameter)

    Sort direction: `asc` or `desc`. Defaults to `asc` for the endpoint's sort column and to `desc` when `order_by` names a metric (a top-N ranking). Applies to `order_by`, or to the endpoint's default sort field when `order_by` is omitted.

    - `const BetaOrganizationAnalyticsSkillListParamsOrderAsc BetaOrganizationAnalyticsSkillListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsSkillListParamsOrderDesc BetaOrganizationAnalyticsSkillListParamsOrder = "desc"`

  - `OrderBy param.Opt[string] Optional` (query parameter)

    Sort field. Restricted to the endpoint's sort column plus its rankable metrics (metrics default to descending; a few metrics rank in date-range mode only, per the endpoint's documented orderable set).

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `StartingDate param.Opt[Time] Optional` (query parameter)

    UTC date in YYYY-MM-DD format. Start of a date range (inclusive). Enables rollup mode: one row per entity aggregated over the whole range — addable counters are summed across days, and a distinct count is never summed where summing could double-count (a field's range value is recomputed exactly over the window, approximate via HLL with typical error under 2%, null, or — for the creation-event counts, whose per-day values cannot overlap — a per-day sum that is itself exact; each field's own description says which). Use either `date` or `starting_date`, not both. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

#### Returns

- `type BetaAnalyticsSkillActivity`

  Per-skill activity data for a given day.

  - `ChatMetrics BetaAnalyticsSkillChatMetrics`

    Claude.ai activity metrics for a single skill on a given day.

    - `DistinctConversationSkillUsedCount int64`

      Number of distinct conversations in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `ClaudeCodeMetrics BetaAnalyticsSkillClaudeCodeMetrics`

    Claude Code activity metrics for a single skill on a given day.

    - `DistinctSessionSkillUsedCount int64`

      Number of distinct Claude Code sessions in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `CoworkMetrics BetaAnalyticsSkillCoworkMetrics`

    Cowork activity metrics for a single skill on a given day.

    - `DistinctSessionSkillUsedCount int64`

      Number of distinct Cowork sessions in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `DistinctUserCount int64`

    Number of distinct users who used the skill on the requested day, or, in date-range mode, over the requested window — recomputed as an exact distinct count over the window's per-member daily rows, never a sum of per-day values. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted.

  - `OfficeMetrics BetaAnalyticsSkillOfficeMetrics`

    Office Agent activity metrics for a single skill on a given day, broken out by Office product.

    - `Excel BetaAnalyticsSkillOfficeProductMetrics`

      Office Agent activity metrics for a single skill on a given day within one Office product.

      - `DistinctSessionSkillUsedCount int64`

        Number of distinct Office Agent sessions in which the skill was used. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `Outlook BetaAnalyticsSkillOfficeProductMetrics`

      Office Agent activity metrics for a single skill on a given day within one Office product.

    - `Powerpoint BetaAnalyticsSkillOfficeProductMetrics`

      Office Agent activity metrics for a single skill on a given day within one Office product.

    - `Word BetaAnalyticsSkillOfficeProductMetrics`

      Office Agent activity metrics for a single skill on a given day within one Office product.

  - `SkillName string`

    Name of the skill

  - `AttributedListPrice string Optional`

    List-price (rate-card) value of the member requests attributed to this skill, as a decimal string in the minor unit of `currency` (cents for USD), from Claude Code, Cowork, and Office Agent request-level attribution — the value of requests that involved the skill, not the skill's incremental cost. Unlike `estimated_overage_spend` this reflects usage value regardless of how it was funded — seat-covered usage counts — but it is undiscounted and does not tie to billed spend or the organization's spend reporting. claude.ai chat usage carries no request-level attribution and contributes nothing: the field is null on `chat` product rows and on `office_agent` product cuts dated before 2026-06-18 (the Office Agent attribution data-start), and on ungrouped rows it covers the Claude Code + Cowork + Office Agent share only (null when no attributable usage exists). Also null under the same conditions as `estimated_overage_spend` (spend reporting not enabled for this organization, `office_agent` product cuts before the 2026-06-18 data-start). "0" means attributable usage existed but none was attributed to this skill. Addable across days: date-range rollup mode returns the window's sum. On `group_by[]` and `filter[]` shapes both amounts can total below the ungrouped value for the same skill over the same date or range: spend attributed to a member–skill pair with no counted usage on that day is excluded from those cuts.

  - `ChatCoworkUnifiedMetrics BetaAnalyticsSkillActivityChatCoworkUnifiedMetrics Optional`

    Skill use recorded while members had Chat and Cowork unified (Cowork's features inside claude.ai chat) turned on, split into chat conversations and Cowork sessions. A count is null in date-range mode where it cannot be computed. Omitted from the response on deployments that do not offer Chat and Cowork unified.

    - `Chat BetaAnalyticsSkillChatCoworkUnifiedChatMetrics`

      A skill's use in chat conversations recorded while members had
      Chat and Cowork unified turned on.

      - `DistinctConversationSkillUsedCount int64`

        Same measure as `chat_metrics.distinct_conversation_skill_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

    - `Sessions BetaAnalyticsSkillChatCoworkUnifiedSessionsMetrics`

      A skill's use in Cowork sessions recorded while members had Chat
      and Cowork unified turned on.

      - `DistinctSessionSkillUsedCount int64`

        Same measure as `cowork_metrics.distinct_session_skill_used_count`, for activity recorded while members had Chat and Cowork unified turned on. Approximate (HLL, typical error <2%) in date-range mode. Null on aggregated rows where a distinct count cannot be computed.

  - `Currency string Optional`

    Currency for this row's monetary fields (`estimated_overage_spend` and `attributed_list_price`), as an uppercase ISO-4217 code. Always "USD" when either amount is populated; null whenever both amounts are null.

  - `EnableCount int64 Optional`

    Distinct accounts that enabled this skill on the requested day (claude.ai only — the skill analog of plugin `install_count`). The count is org-wide: null when enable reporting is not enabled for this organization, or when the request scopes to `user_id` / `rbac_group_id` / `product` via `group_by[]` or `filter[]` (an org-wide count would be misleading on per-cut rows). A distinct count, not an event count: summing across days double-counts members who enable the skill on more than one day, so it is also null in date-range rollup mode (`starting_date`/`ending_date`).

  - `EstimatedOverageSpend string Optional`

    Estimated overage spend attributed to this skill, as a decimal string in the minor unit of `currency` (cents for USD; "1250" is $12.50, fractional cents possible) — an allocation of each member's daily post-discount, pre-credit metered overage spend (the same cost basis as the organization's spend reporting and the Cost & Usage API, so per-skill figures are directly comparable; spend with no skill attribution — including any member-day without skill invocations — is not represented, so skill rows sum to at most those totals) across the skills the member used. Overage only: usage covered by included seat allowances bills nothing and allocates $0 here — see `attributed_list_price` for the funding-independent usage-value companion. Claude Code, Cowork, and Office Agent spend use request-level skill attribution; claude.ai chat spend is approximated proportionally to skill-invoking messages. An estimate, not a billing number — and the cost of the requests/messages that involved the skill, not the skill's incremental cost (the same request would still have cost something without the skill active). "0" means no overage spend was attributed; null when spend reporting is not enabled for this organization, on `office_agent` product cuts dated before 2026-06-18 (the Office Agent attribution data-start). Addable across days: date-range rollup mode (`starting_date`/`ending_date`) returns the window's sum. With `group_by[]=user_id` each row carries the user's own attributed spend. On `group_by[]` and `filter[]` shapes both amounts can total below the ungrouped value for the same skill over the same date or range: spend attributed to a member–skill pair with no counted usage on that day is excluded from those cuts.

  - `InvocationCount int64 Optional`

    Total number of times this skill was invoked on the requested day (the skill analog of plugin `invocation_count`). Unlike `distinct_user_count` — which answers '\# of users' — this is the true '# of uses'. A skill counts as used only when it is explicitly activated — the model (or the user, via the skill's slash command) invokes it, reading its instructions into context as part of that activation. Skills that are merely installed or listed as available, or whose content reaches the context without an activation (preloaded, hook-injected, or read as a plain file), are not counted. Null when invocation reporting is not enabled for this organization. Sum across a date range for total uses in the window — date-range rollup mode (`starting_date`/`ending_date`) returns this sum directly.

  - `Product string Optional`

    Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). These are the canonical Cost & Usage product names; an `office_agent` row's per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and `chat_cowork_unified` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

  - `RBACGroupID string Optional`

    Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

  - `RBACGroupName string Optional`

    Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

  - `ShareStatus BetaAnalyticsSkillActivityShareStatus Optional`

    Skill share status (claude.ai only): one of `private`, `organization`, or `public`. Null for skills used only in Claude Code or Office (no per-skill share-status concept) and when share-status reporting is not yet available for the organization. Filterable via `filter[]=share_status:{value}`.

    - `const BetaAnalyticsSkillActivityShareStatusOrganization BetaAnalyticsSkillActivityShareStatus = "organization"`

    - `const BetaAnalyticsSkillActivityShareStatusPrivate BetaAnalyticsSkillActivityShareStatus = "private"`

    - `const BetaAnalyticsSkillActivityShareStatusPublic BetaAnalyticsSkillActivityShareStatus = "public"`

  - `SkillDisplayName string Optional`

    Human-readable display name for rows whose `skill_name` is an opaque skill id (user/organization skill types and plugin-delivered skills, whose user-defined names usage reports generally withhold). Organization-shared skills and skills delivered by the organization's own plugins (its plugin marketplaces and its library) resolve; plugin skill names are shown without their 'plugin:' prefix. The literal 'unknown' bucket row gets a fixed 'Unknown skill' label. For a member's own skill (private or personal-plugin) it is null, except when the skill's owner used it from Claude Code or Cowork in the requested period: then it shows the name that client reported at the time. Apart from that, the names of members' own skills are not disclosed to analytics-key holders. Also null for Anthropic-provided plugin skills (not resolved), for an organization skill or plugin whose name can no longer be found (for example, one since deleted), when `skill_name` is already a display name, or when display-name resolution is not enabled for this organization.

  - `UserID string Optional`

    Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

#### 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"),
	)
	page, err := client.Beta.Organization.Analytics.Skills.List(context.TODO(), anthropic.BetaOrganizationAnalyticsSkillListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "chat_metrics": {
        "distinct_conversation_skill_used_count": 0
      },
      "claude_code_metrics": {
        "distinct_session_skill_used_count": 0
      },
      "cowork_metrics": {
        "distinct_session_skill_used_count": 0
      },
      "distinct_user_count": 0,
      "office_metrics": {
        "excel": {
          "distinct_session_skill_used_count": 0
        },
        "outlook": {
          "distinct_session_skill_used_count": 0
        },
        "powerpoint": {
          "distinct_session_skill_used_count": 0
        },
        "word": {
          "distinct_session_skill_used_count": 0
        }
      },
      "skill_name": "skill_name",
      "attributed_list_price": "attributed_list_price",
      "chat_cowork_unified_metrics": {
        "chat": {
          "distinct_conversation_skill_used_count": 0
        },
        "sessions": {
          "distinct_session_skill_used_count": 0
        }
      },
      "currency": "currency",
      "enable_count": 0,
      "estimated_overage_spend": "estimated_overage_spend",
      "invocation_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "share_status": "organization",
      "skill_display_name": "skill_display_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Analytics › Artifacts

### Get Artifact Activity

`client.Beta.Organization.Analytics.Artifacts.List(ctx, query) (*PageCursor[BetaAnalyticsArtifactActivity], error)`

**GET** `/v1/organizations/analytics/artifacts`

Get artifact-creation activity for a given day, broken out by MIME type.

Returns the full (`artifact_type`, `is_shared`) cube for the organization;
`next_page` is null except for grouped queries, which paginate. The cube
can be broken out per product, per member, or per RBAC group via
`group_by[]`, and scoped via `filter[]`. Requires an API key with the
`read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsArtifactListParams`

  - `Date Time` (query parameter)

    UTC date in YYYY-MM-DD format. The day to get artifact activity for. Data is typically available with a 1-day lag (varies by query; the error for a too-recent date names the latest available day) and may be revised by a few percent over the following days. No earlier than 2026-01-01.

    format: date

  - `Filter []string Optional` (query parameter)

    Filters as `dimension:value`, e.g. `filter[]=rbac_group_id:{id}`. Repeat the param for OR within a dimension and across dimensions for AND. Supported dimensions on this endpoint: `artifact_type`, `is_shared`, `product`, `rbac_group_id`, `user_id`. Value forms: `artifact_type` is a canonical artifact MIME type (e.g. `text/markdown`) or `other`; `is_shared` is `true` or `false`; `product` is `chat_cowork_unified`, `chat`, `claude_code`, or `cowork` (the surfaces that create artifacts); `rbac_group_id` takes the tagged id (`rbac_group_...`, as emitted in responses and by the spend-limits API) or a bare group UUID, and matches users who held the group at any point during each covered UTC day (time-of-usage attribution); `user_id` takes a tagged user id (`user_...`), as emitted in responses. An unsupported dimension returns 400. At most 100 entries. `chat_cowork_unified` is accepted as a `product` value only on deployments that offer Chat and Cowork unified.

    maxItems: 100

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break results out by: `product`, `user_id` and/or `rbac_group_id`. The ungrouped artifact-type cube is finite and returned in full; grouped queries multiply the cube and paginate via `next_page`. `product` takes the values `chat_cowork_unified`, `chat`, `claude_code`, or `cowork` (the surfaces that create artifacts). `rbac_group_id` attributes a user to every group they held at any point during the requested UTC day, so grouped rows are not an exclusive partition. At most 100 entries.

    maxItems: 100

    - `const BetaOrganizationAnalyticsArtifactListParamsGroupByProduct BetaOrganizationAnalyticsArtifactListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsArtifactListParamsGroupByRBACGroupID BetaOrganizationAnalyticsArtifactListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsArtifactListParamsGroupByUserID BetaOrganizationAnalyticsArtifactListParamsGroupBy = "user_id"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum rows to return (1-1000, default 100). The ungrouped artifact-type cube is finite and returned in full; `limit` is the page size only when `group_by[]` multiplies the cube.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field. Only valid with `group_by[]` — the ungrouped cube is never paginated.

#### Returns

- `type BetaAnalyticsArtifactActivity`

  Artifact-creation activity for one (`artifact_type`, `is_shared`) bucket
  on a given day.

  Artifacts form a small finite cube — the canonical MIME type (8 values incl.
  `other`) crossed with shared-vs-private — so the response is the full set of
  non-empty buckets, not a ranked/paginated list. Claude Code and Cowork
  artifacts report under `text/html` and are counted from 2026-08-17
  onward; earlier days contain claude.ai chat artifacts only. With
  `group_by[]=product` / `user_id` / `rbac_group_id` each row is further
  split by the flat group keys and counts are scoped to that cut.

  - `ArtifactType string`

    Canonical artifact MIME type (e.g. `text/markdown`, `application/vnd.ant.react`, `image/svg+xml`), or `other`. Claude Code and Cowork artifacts report as `text/html`.

  - `ArtifactsCreatedCount int64`

    Number of artifacts created in this bucket on the requested day

  - `DistinctUserCount int64`

    Number of distinct users who created artifacts in this bucket on the requested day

  - `IsShared bool`

    Whether the artifacts in this bucket have ever been shared (a Claude Code / Cowork artifact is shared once anyone beyond its creator may open it: named members, the whole organization, or anyone with the link).

  - `PublishedArtifactsCreatedCount int64`

    Number of those artifacts that have been published (for Claude Code / Cowork artifacts: open to anyone with the link); never exceeds `artifacts_created_count`

  - `Product string Optional`

    Product that produced this row's activity: one of `chat`, `claude_code`, `cowork`, `office_agent`, or `chat_cowork_unified` (Chat and Cowork unified). These are the canonical Cost & Usage product names; an `office_agent` row's per-surface breakdown is in its `office_metrics`. On `/plugins` only `cowork`, `claude_code` and `chat_cowork_unified` occur (the only surfaces with plugin attribution); on `/artifacts` only `chat`, `claude_code`, `cowork` and `chat_cowork_unified` occur (the surfaces that create artifacts); `/apps/chat/projects` does not support the product dimension (a `product` entry in `group_by[]` or `filter[]` there is rejected). Present only when the request grouped by `product`.

  - `RBACGroupID string Optional`

    Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API spelling. Present only when the request grouped by `rbac_group_id`.

  - `RBACGroupName string Optional`

    Resolved RBAC group display name, alongside `rbac_group_id` when name resolution is available. Null if the group has been deleted or its name could not be resolved; `rbac_group_id` remains the stable key.

  - `UserID string Optional`

    Tagged user identifier (e.g. `user_...`). Present only when the request grouped by `user_id`.

#### Example

```go
package main

import (
	"context"
	"fmt"
	"time"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.Analytics.Artifacts.List(context.TODO(), anthropic.BetaOrganizationAnalyticsArtifactListParams{
		Date: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "artifact_type": "artifact_type",
      "artifacts_created_count": 0,
      "distinct_user_count": 0,
      "is_shared": true,
      "published_artifacts_created_count": 0,
      "product": "product",
      "rbac_group_id": "rbac_group_id",
      "rbac_group_name": "rbac_group_name",
      "user_id": "user_id"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Analytics › Usage Report

### Get Token Usage Over Time

`client.Beta.Organization.Analytics.UsageReport.List(ctx, query) (*PageCursor[BetaAnalyticsUsageReportTimeBucket], error)`

**GET** `/v1/organizations/analytics/usage_report`

Get token usage over time across a date range.

Returns token usage bucketed by minute, hour, or day, optionally broken
down by product, model, context window, inference region, or speed.
Available to organizations on a Claude Enterprise plan. Requires an API
key with the `read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsUsageReportListParams`

  - `StartingAt Time` (query parameter)

    Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

    format: date-time

  - `BucketWidth BetaOrganizationAnalyticsUsageReportListParamsBucketWidth Optional` (query parameter)

    Time bucket granularity.

    - `const BetaOrganizationAnalyticsUsageReportListParamsBucketWidthDay BetaOrganizationAnalyticsUsageReportListParamsBucketWidth = "1d"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsBucketWidthHour BetaOrganizationAnalyticsUsageReportListParamsBucketWidth = "1h"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsBucketWidthMinute BetaOrganizationAnalyticsUsageReportListParamsBucketWidth = "1m"`

  - `ClaudeTagCategories []BetaAnalyticsClaudeTagCategory Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

    maxItems: 100

    - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

    - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

    - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

    - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

    - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

  - `ClaudeTagUserIDs []string Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

    maxItems: 100

  - `ContextWindows []BetaAnalyticsContextWindow Optional` (query parameter)

    Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

    maxItems: 100

    - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

    - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

  - `EndingAt param.Opt[Time] Optional` (query parameter)

    End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

    format: date-time

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break each time bucket out by. Defaults to no grouping (one total per bucket). Each bucket reports at most its top 100 groups; a group beyond that cap has no row in that bucket (there is no remainder row), so grouped buckets are not exhaustive when a dimension has more than 100 distinct values.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByClaudeTagCategory BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "claude_tag_category"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByClaudeTagUserID BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "claude_tag_user_id"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByContextWindow BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "context_window"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByInferenceGeo BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "inference_geo"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByModel BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "model"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByProduct BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupByRBACGroupID BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupBySlackChannelID BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "slack_channel_id"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsGroupBySpeed BetaOrganizationAnalyticsUsageReportListParamsGroupBy = "speed"`

  - `InferenceGeos []BetaAnalyticsInferenceGeoFilter Optional` (query parameter)

    Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

    maxItems: 100

    - `const BetaAnalyticsInferenceGeoFilterGlobal BetaAnalyticsInferenceGeoFilter = "global"`

    - `const BetaAnalyticsInferenceGeoFilterNotAvailable BetaAnalyticsInferenceGeoFilter = "not_available"`

    - `const BetaAnalyticsInferenceGeoFilterUs BetaAnalyticsInferenceGeoFilter = "us"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of time buckets per page. Defaults and caps vary by `bucket_width` (`1d`: default 7, max 31; `1h`: default 24, max 168; `1m`: default 60, max 256).

    minimum: 1

  - `Models []string Optional` (query parameter)

    Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

    maxItems: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `Products []BetaAnalyticsProductFilter Optional` (query parameter)

    Product surfaces to include. Defaults to all products. Use `group_by[]=product` to break out per-product values.

    maxItems: 100

    - `const BetaAnalyticsProductFilterChat BetaAnalyticsProductFilter = "chat"`

    - `const BetaAnalyticsProductFilterChatCoworkUnified BetaAnalyticsProductFilter = "chat_cowork_unified"`

    - `const BetaAnalyticsProductFilterClaudeTag BetaAnalyticsProductFilter = "claude-tag"`

    - `const BetaAnalyticsProductFilterClaudeCode BetaAnalyticsProductFilter = "claude_code"`

    - `const BetaAnalyticsProductFilterClaudeDesign BetaAnalyticsProductFilter = "claude_design"`

    - `const BetaAnalyticsProductFilterClaudeInChrome BetaAnalyticsProductFilter = "claude_in_chrome"`

    - `const BetaAnalyticsProductFilterCowork BetaAnalyticsProductFilter = "cowork"`

    - `const BetaAnalyticsProductFilterOfficeAgent BetaAnalyticsProductFilter = "office_agent"`

  - `RBACGroupIDs []string Optional` (query parameter)

    Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

    maxItems: 100

  - `SlackChannelIDs []string Optional` (query parameter)

    Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

    maxItems: 100

  - `Speeds []string Optional` (query parameter)

    Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUsageReportListParamsSpeedFast BetaOrganizationAnalyticsUsageReportListParamsSpeed = "fast"`

    - `const BetaOrganizationAnalyticsUsageReportListParamsSpeedStandard BetaOrganizationAnalyticsUsageReportListParamsSpeed = "standard"`

  - `UserIDs []string Optional` (query parameter)

    Filter to specific users by tagged user ID.

    maxItems: 100

#### Returns

- `type BetaAnalyticsUsageReportTimeBucket`

  - `EndingAt Time`

    End of the time bucket (exclusive) in RFC 3339 format.

    format: date-time

  - `Results []BetaAnalyticsUsageBucketedResult`

    Rows for this time bucket. Empty when the bucket has no data; otherwise a single combined row when `group_by[]` is omitted, or one row per group (subject to the per-bucket group cap described on the `group_by[]` parameter).

    - `CacheCreation BetaCacheCreation`

      The number of input tokens for cache creation.

      - `Ephemeral1hInputTokens int64`

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

        default: 0, minimum: 0

      - `Ephemeral5mInputTokens int64`

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

        default: 0, minimum: 0

    - `CacheReadInputTokens int64`

      The number of input tokens read from the cache.

    - `ClaudeTagCategory BetaAnalyticsClaudeTagCategory`

      Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

      - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

      - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

      - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

      - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

      - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

    - `ClaudeTagUserID string`

      Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

    - `ContextWindow BetaAnalyticsContextWindow`

      Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

      - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

      - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

    - `InferenceGeo BetaAnalyticsUsageBucketedResultInferenceGeo`

      Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

      - `const BetaAnalyticsUsageBucketedResultInferenceGeoGlobal BetaAnalyticsUsageBucketedResultInferenceGeo = "global"`

      - `const BetaAnalyticsUsageBucketedResultInferenceGeoUs BetaAnalyticsUsageBucketedResultInferenceGeo = "us"`

    - `Model string`

      Model that produced the usage or cost, as a model name in the form the `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` is in `group_by[]`; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

    - `OutputTokens int64`

      The number of output tokens generated.

    - `Product string`

      Product surface that produced the usage or cost. Null unless product is in `group_by[]`; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values include `chat`, `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's features inside claude.ai chat: chat and Cowork usage by a member who has it turned on is reported under this value instead of `chat` or `cowork`. It is accepted as a filter only on deployments that offer Chat and Cowork unified. Some unattributed usage is reported as "other".

    - `RBACGroupID string`

      RBAC group (team) the usage is attributed to, in the public tagged `rbac_group_...` spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as an `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in `group_by[]`. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query without `group_by[]`.

    - `Requests int64`

      Number of API requests in this row's scope. For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with `product: null`).

    - `ServerToolUse BetaAnalyticsServerToolUse`

      Server-side tool usage metrics.

      - `WebSearchRequests int64`

        The number of web search requests made.

    - `SlackChannelID string`

      Slack channel the usage originated from. Populated only when `slack_channel_id` is in `group_by[]`; null for usage outside Slack (and for rows recorded before channel attribution was enabled).

    - `Speed BetaAnalyticsUsageBucketedResultSpeed`

      Inference speed mode of the usage or cost: `fast` or `standard`. Null unless `speed` is in `group_by[]`.

      - `const BetaAnalyticsUsageBucketedResultSpeedFast BetaAnalyticsUsageBucketedResultSpeed = "fast"`

      - `const BetaAnalyticsUsageBucketedResultSpeedStandard BetaAnalyticsUsageBucketedResultSpeed = "standard"`

    - `UncachedInputTokens int64`

      The number of uncached input tokens processed.

  - `StartingAt Time`

    Start of the time bucket (inclusive) in RFC 3339 format.

    format: date-time

#### Example

```go
package main

import (
	"context"
	"fmt"
	"time"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.Analytics.UsageReport.List(context.TODO(), anthropic.BetaOrganizationAnalyticsUsageReportListParams{
		StartingAt: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "ending_at": "2019-12-27T18:11:19.117Z",
      "results": [
        {
          "cache_creation": {
            "ephemeral_1h_input_tokens": 0,
            "ephemeral_5m_input_tokens": 0
          },
          "cache_read_input_tokens": 0,
          "claude_tag_category": "dm",
          "claude_tag_user_id": "U0123ABCDEF",
          "context_window": "0-200k",
          "inference_geo": "global",
          "model": "claude-opus-5-5",
          "output_tokens": 0,
          "product": "chat",
          "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
          "requests": 0,
          "server_tool_use": {
            "web_search_requests": 10
          },
          "slack_channel_id": "C0123ABCDEF",
          "speed": "fast",
          "uncached_input_tokens": 0
        }
      ],
      "starting_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "data_refreshed_at": "2019-12-27T18:11:19.117Z",
  "has_more": true,
  "next_page": "next_page",
  "organization_id": "org_013FP9SaFPBg7Kw7fetjn6cF"
}
```

## Beta › Organization › Analytics › User Usage Report

### Get Per-User Token Usage

`client.Beta.Organization.Analytics.UserUsageReport.List(ctx, query) (*PageCursor[BetaAnalyticsUsageUsersItem], error)`

**GET** `/v1/organizations/analytics/user_usage_report`

Get per-user token usage across a date range.

Returns one row per user, ranked by the chosen token metric. Use this to
see which users consume the most tokens. Only usage attributable to a
seat user is included; for organization-wide totals including direct
API-key and automation traffic, use the bucketed
`/v1/organizations/analytics/usage_report` endpoint. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsUserUsageReportListParams`

  - `StartingAt Time` (query parameter)

    Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

    format: date-time

  - `BucketWidth BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidth Optional` (query parameter)

    Time-bucket granularity. When set, each row's `starting_at` and `ending_at` are populated and one actor may span several rows (one per time bucket with usage). The time bucket counts toward `limit`, so one page can return multiple rows for the same actor. `ending_at` is required when `bucket_width` is set, and with `bucket_width="1m"` the range may span at most 24 hours. When omitted, each row aggregates the full `[starting_at, ending_at)` range.

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidthDay BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidth = "1d"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidthHour BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidth = "1h"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidthMinute BetaOrganizationAnalyticsUserUsageReportListParamsBucketWidth = "1m"`

  - `ClaudeTagCategories []BetaAnalyticsClaudeTagCategory Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

    maxItems: 100

    - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

    - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

    - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

    - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

    - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

  - `ClaudeTagUserIDs []string Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

    maxItems: 100

  - `ContextWindows []BetaAnalyticsContextWindow Optional` (query parameter)

    Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

    maxItems: 100

    - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

    - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

  - `EndingAt param.Opt[Time] Optional` (query parameter)

    End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

    format: date-time

  - `ExcludeDeletedUsers param.Opt[bool] Optional` (query parameter)

    If true, omit rows for users who are deleted (`deleted: true`). A page may contain fewer than `limit` rows; use `has_more` and `next_page` to paginate as usual.

  - `GroupBy []string Optional` (query parameter)

    Break each actor's row out by the given dimensions. Accepts the same values as the bucketed `/usage_report` endpoint. `limit` bounds (actor × time bucket × dimension) rows — with dimensions or `bucket_width` present, one actor may span several rows.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByClaudeTagCategory BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "claude_tag_category"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByClaudeTagUserID BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "claude_tag_user_id"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByContextWindow BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "context_window"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByInferenceGeo BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "inference_geo"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByModel BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "model"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByProduct BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupByRBACGroupID BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupBySlackChannelID BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "slack_channel_id"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsGroupBySpeed BetaOrganizationAnalyticsUserUsageReportListParamsGroupBy = "speed"`

  - `InferenceGeos []BetaAnalyticsInferenceGeoFilter Optional` (query parameter)

    Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

    maxItems: 100

    - `const BetaAnalyticsInferenceGeoFilterGlobal BetaAnalyticsInferenceGeoFilter = "global"`

    - `const BetaAnalyticsInferenceGeoFilterNotAvailable BetaAnalyticsInferenceGeoFilter = "not_available"`

    - `const BetaAnalyticsInferenceGeoFilterUs BetaAnalyticsInferenceGeoFilter = "us"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of rows per page (1-1000, default 20). One row per actor unless `group_by[]` or `bucket_width` splits an actor across rows; `cost_type`/`token_type` fan-out rows (cost endpoint only) are the exception — they do not count toward this limit, so `data` can exceed it.

    minimum: 1, maximum: 1000

  - `Models []string Optional` (query parameter)

    Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

    maxItems: 100

  - `Order BetaOrganizationAnalyticsUserUsageReportListParamsOrder Optional` (query parameter)

    Sort direction. Defaults to `desc`.

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsOrderAsc BetaOrganizationAnalyticsUserUsageReportListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsOrderDesc BetaOrganizationAnalyticsUserUsageReportListParamsOrder = "desc"`

  - `OrderBy BetaOrganizationAnalyticsUserUsageReportListParamsOrderBy Optional` (query parameter)

    Metric to rank actors by. Defaults to `total_tokens`.

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsOrderByOutputTokens BetaOrganizationAnalyticsUserUsageReportListParamsOrderBy = "output_tokens"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsOrderByRequests BetaOrganizationAnalyticsUserUsageReportListParamsOrderBy = "requests"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsOrderByTotalTokens BetaOrganizationAnalyticsUserUsageReportListParamsOrderBy = "total_tokens"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsOrderByUncachedInputTokens BetaOrganizationAnalyticsUserUsageReportListParamsOrderBy = "uncached_input_tokens"`

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `Products []BetaAnalyticsProductFilter Optional` (query parameter)

    Product surfaces to include. Defaults to all products.

    maxItems: 100

    - `const BetaAnalyticsProductFilterChat BetaAnalyticsProductFilter = "chat"`

    - `const BetaAnalyticsProductFilterChatCoworkUnified BetaAnalyticsProductFilter = "chat_cowork_unified"`

    - `const BetaAnalyticsProductFilterClaudeTag BetaAnalyticsProductFilter = "claude-tag"`

    - `const BetaAnalyticsProductFilterClaudeCode BetaAnalyticsProductFilter = "claude_code"`

    - `const BetaAnalyticsProductFilterClaudeDesign BetaAnalyticsProductFilter = "claude_design"`

    - `const BetaAnalyticsProductFilterClaudeInChrome BetaAnalyticsProductFilter = "claude_in_chrome"`

    - `const BetaAnalyticsProductFilterCowork BetaAnalyticsProductFilter = "cowork"`

    - `const BetaAnalyticsProductFilterOfficeAgent BetaAnalyticsProductFilter = "office_agent"`

  - `RBACGroupIDs []string Optional` (query parameter)

    Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

    maxItems: 100

  - `SlackChannelIDs []string Optional` (query parameter)

    Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

    maxItems: 100

  - `Speeds []string Optional` (query parameter)

    Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsSpeedFast BetaOrganizationAnalyticsUserUsageReportListParamsSpeed = "fast"`

    - `const BetaOrganizationAnalyticsUserUsageReportListParamsSpeedStandard BetaOrganizationAnalyticsUserUsageReportListParamsSpeed = "standard"`

  - `UserIDs []string Optional` (query parameter)

    Filter to specific users by tagged user ID.

    maxItems: 100

#### Returns

- `type BetaAnalyticsUsageUsersItem`

  - `Actor BetaAnalyticsUserActor`

    The user this row's usage or cost is attributed to. Always a `user_actor`.

    - `Type UserActor`

      Actor type. Always `"user_actor"`.

    - `Deleted bool`

      True when the account has been deleted, or when the user is no longer a member of the organization or its associated organizations (for example, their membership was removed or they were deprovisioned via your identity provider). `email_address` stays populated for removed users and is null when the account has been deleted. `name` follows the rules described on that field. The `user_id` is still populated for reconciliation.

    - `EmailAddress string`

      The user's email address, including for users who are no longer members of the organization or its associated organizations. Null when the account has been deleted (check `deleted`) and for system-minted service accounts, which have no person's mailbox behind them (check `name`).

    - `Name string`

      The user's full name. Null when the user has not set a name. Returns `"Deleted User"` when the account itself has been deleted, or when the user is no longer a member of the organization or its associated organizations and the organization has chosen to hide the names of removed users. Otherwise, the name stays populated for removed users. Rows for system-minted service accounts render the service name (for example, `"Claude Security"` for usage by Anthropic's security-patching service) or null.

    - `UserID string`

      Tagged user ID.

  - `CacheCreation BetaCacheCreation`

    The number of input tokens for cache creation.

    - `Ephemeral1hInputTokens int64`

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

      default: 0, minimum: 0

    - `Ephemeral5mInputTokens int64`

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

      default: 0, minimum: 0

  - `CacheReadInputTokens int64`

    The number of input tokens read from the cache.

  - `ClaudeTagCategory BetaAnalyticsClaudeTagCategory`

    Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

    - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

    - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

    - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

    - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

    - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

  - `ClaudeTagUserID string`

    Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

  - `ContextWindow BetaAnalyticsContextWindow`

    Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

    - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

    - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

  - `EndingAt Time`

    End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set.

    format: date-time

  - `InferenceGeo BetaAnalyticsUsageUsersItemInferenceGeo`

    Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

    - `const BetaAnalyticsUsageUsersItemInferenceGeoGlobal BetaAnalyticsUsageUsersItemInferenceGeo = "global"`

    - `const BetaAnalyticsUsageUsersItemInferenceGeoUs BetaAnalyticsUsageUsersItemInferenceGeo = "us"`

  - `Model string`

    Model that produced the usage or cost, as a model name in the form the `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` is in `group_by[]`; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

  - `OutputTokens int64`

    The number of output tokens generated.

  - `Product string`

    Product surface that produced the usage or cost. Null unless product is in `group_by[]`; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values include `chat`, `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's features inside claude.ai chat: chat and Cowork usage by a member who has it turned on is reported under this value instead of `chat` or `cowork`. It is accepted as a filter only on deployments that offer Chat and Cowork unified. Some unattributed usage is reported as "other".

  - `RBACGroupID string`

    RBAC group (team) the usage is attributed to, in the public tagged `rbac_group_...` spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as an `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in `group_by[]`. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query without `group_by[]`.

  - `Requests int64`

    Number of API requests in this row's scope. For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with `product: null`).

  - `ServerToolUse BetaAnalyticsServerToolUse`

    Server-side tool usage metrics.

    - `WebSearchRequests int64`

      The number of web search requests made.

  - `SlackChannelID string`

    Slack channel the usage originated from. Populated only when `slack_channel_id` is in `group_by[]`; null for usage outside Slack (and for rows recorded before channel attribution was enabled).

  - `Speed BetaAnalyticsUsageUsersItemSpeed`

    Inference speed mode of the usage or cost: `fast` or `standard`. Null unless `speed` is in `group_by[]`.

    - `const BetaAnalyticsUsageUsersItemSpeedFast BetaAnalyticsUsageUsersItemSpeed = "fast"`

    - `const BetaAnalyticsUsageUsersItemSpeedStandard BetaAnalyticsUsageUsersItemSpeed = "standard"`

  - `StartingAt Time`

    Start of the row's UTC time bucket (inclusive), as an RFC 3339 timestamp. Null unless `bucket_width` is set; without `bucket_width`, each row aggregates the full requested range.

    format: date-time

  - `TotalTokens int64`

    Total token count across all token types. This is the value the default `order_by` (`total_tokens`) sorts on.

  - `UncachedInputTokens int64`

    The number of uncached input tokens processed.

#### Example

```go
package main

import (
	"context"
	"fmt"
	"time"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.Analytics.UserUsageReport.List(context.TODO(), anthropic.BetaOrganizationAnalyticsUserUsageReportListParams{
		StartingAt: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "actor": {
        "deleted": true,
        "email": "jane@example.com",
        "email_address": "jane@example.com",
        "name": "Jane Smith",
        "type": "user_actor",
        "user_id": "user_01AbCdEfGhIjKlMnOpQrSt"
      },
      "cache_creation": {
        "ephemeral_1h_input_tokens": 0,
        "ephemeral_5m_input_tokens": 0
      },
      "cache_read_input_tokens": 3200000,
      "claude_tag_category": "dm",
      "claude_tag_user_id": "U0123ABCDEF",
      "context_window": "0-200k",
      "ending_at": "2019-12-27T18:11:19.117Z",
      "inference_geo": "global",
      "model": "claude-opus-5-5",
      "output_tokens": 891000,
      "product": "chat",
      "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "requests": 128,
      "server_tool_use": {
        "web_search_requests": 10
      },
      "slack_channel_id": "C0123ABCDEF",
      "speed": "fast",
      "starting_at": "2019-12-27T18:11:19.117Z",
      "total_tokens": 5377000,
      "uncached_input_tokens": 1284500
    }
  ],
  "data_refreshed_at": "2019-12-27T18:11:19.117Z",
  "has_more": true,
  "next_page": "next_page",
  "organization_id": "org_013FP9SaFPBg7Kw7fetjn6cF"
}
```

## Beta › Organization › Analytics › Cost Report

### Get Cost Over Time

`client.Beta.Organization.Analytics.CostReport.List(ctx, query) (*PageCursor[BetaAnalyticsCostReportTimeBucket], error)`

**GET** `/v1/organizations/analytics/cost_report`

Get cost in USD over time across a date range.

Returns cost bucketed by minute, hour, or day, optionally broken down by
product, model, context window, inference region, speed, cost type, or
token type. Available to organizations on a Claude Enterprise plan.
Requires an API key with the `read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsCostReportListParams`

  - `StartingAt Time` (query parameter)

    Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

    format: date-time

  - `BucketWidth BetaOrganizationAnalyticsCostReportListParamsBucketWidth Optional` (query parameter)

    Time bucket granularity.

    - `const BetaOrganizationAnalyticsCostReportListParamsBucketWidthDay BetaOrganizationAnalyticsCostReportListParamsBucketWidth = "1d"`

    - `const BetaOrganizationAnalyticsCostReportListParamsBucketWidthHour BetaOrganizationAnalyticsCostReportListParamsBucketWidth = "1h"`

    - `const BetaOrganizationAnalyticsCostReportListParamsBucketWidthMinute BetaOrganizationAnalyticsCostReportListParamsBucketWidth = "1m"`

  - `ClaudeTagCategories []BetaAnalyticsClaudeTagCategory Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

    maxItems: 100

    - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

    - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

    - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

    - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

    - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

  - `ClaudeTagUserIDs []string Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

    maxItems: 100

  - `ContextWindows []BetaAnalyticsContextWindow Optional` (query parameter)

    Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

    maxItems: 100

    - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

    - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

  - `EndingAt param.Opt[Time] Optional` (query parameter)

    End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

    format: date-time

  - `GroupBy []string Optional` (query parameter)

    Dimensions to break each time bucket out by. Defaults to no grouping (one total per bucket). Each bucket reports at most its top 100 groups; a group beyond that cap has no row in that bucket (there is no remainder row), so grouped buckets are not exhaustive when a dimension has more than 100 distinct values.

    maxItems: 100

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByClaudeTagCategory BetaOrganizationAnalyticsCostReportListParamsGroupBy = "claude_tag_category"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByClaudeTagUserID BetaOrganizationAnalyticsCostReportListParamsGroupBy = "claude_tag_user_id"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByContextWindow BetaOrganizationAnalyticsCostReportListParamsGroupBy = "context_window"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByCostType BetaOrganizationAnalyticsCostReportListParamsGroupBy = "cost_type"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByInferenceGeo BetaOrganizationAnalyticsCostReportListParamsGroupBy = "inference_geo"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByModel BetaOrganizationAnalyticsCostReportListParamsGroupBy = "model"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByProduct BetaOrganizationAnalyticsCostReportListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByRBACGroupID BetaOrganizationAnalyticsCostReportListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupBySlackChannelID BetaOrganizationAnalyticsCostReportListParamsGroupBy = "slack_channel_id"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupBySpeed BetaOrganizationAnalyticsCostReportListParamsGroupBy = "speed"`

    - `const BetaOrganizationAnalyticsCostReportListParamsGroupByTokenType BetaOrganizationAnalyticsCostReportListParamsGroupBy = "token_type"`

  - `InferenceGeos []BetaAnalyticsInferenceGeoFilter Optional` (query parameter)

    Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

    maxItems: 100

    - `const BetaAnalyticsInferenceGeoFilterGlobal BetaAnalyticsInferenceGeoFilter = "global"`

    - `const BetaAnalyticsInferenceGeoFilterNotAvailable BetaAnalyticsInferenceGeoFilter = "not_available"`

    - `const BetaAnalyticsInferenceGeoFilterUs BetaAnalyticsInferenceGeoFilter = "us"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of time buckets per page. Defaults and caps vary by `bucket_width` (`1d`: default 7, max 31; `1h`: default 24, max 168; `1m`: default 60, max 256).

    minimum: 1

  - `Models []string Optional` (query parameter)

    Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

    maxItems: 100

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `Products []BetaAnalyticsProductFilter Optional` (query parameter)

    Product surfaces to include. Defaults to all products. Use `group_by[]=product` to break out per-product values.

    maxItems: 100

    - `const BetaAnalyticsProductFilterChat BetaAnalyticsProductFilter = "chat"`

    - `const BetaAnalyticsProductFilterChatCoworkUnified BetaAnalyticsProductFilter = "chat_cowork_unified"`

    - `const BetaAnalyticsProductFilterClaudeTag BetaAnalyticsProductFilter = "claude-tag"`

    - `const BetaAnalyticsProductFilterClaudeCode BetaAnalyticsProductFilter = "claude_code"`

    - `const BetaAnalyticsProductFilterClaudeDesign BetaAnalyticsProductFilter = "claude_design"`

    - `const BetaAnalyticsProductFilterClaudeInChrome BetaAnalyticsProductFilter = "claude_in_chrome"`

    - `const BetaAnalyticsProductFilterCowork BetaAnalyticsProductFilter = "cowork"`

    - `const BetaAnalyticsProductFilterOfficeAgent BetaAnalyticsProductFilter = "office_agent"`

  - `RBACGroupIDs []string Optional` (query parameter)

    Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

    maxItems: 100

  - `SlackChannelIDs []string Optional` (query parameter)

    Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

    maxItems: 100

  - `Speeds []string Optional` (query parameter)

    Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

    maxItems: 100

    - `const BetaOrganizationAnalyticsCostReportListParamsSpeedFast BetaOrganizationAnalyticsCostReportListParamsSpeed = "fast"`

    - `const BetaOrganizationAnalyticsCostReportListParamsSpeedStandard BetaOrganizationAnalyticsCostReportListParamsSpeed = "standard"`

  - `UserIDs []string Optional` (query parameter)

    Filter to specific users by tagged user ID.

    maxItems: 100

#### Returns

- `type BetaAnalyticsCostReportTimeBucket`

  - `EndingAt Time`

    End of the time bucket (exclusive) in RFC 3339 format.

    format: date-time

  - `Results []BetaAnalyticsCostBucketedResult`

    Rows for this time bucket. Empty when the bucket has no data; otherwise a single combined row when `group_by[]` is omitted, or one row per group (subject to the per-bucket group cap described on the `group_by[]` parameter).

    - `Amount string`

      Amount (post-discount, pre-credit) in fractional cents.

    - `ClaudeTagCategory BetaAnalyticsClaudeTagCategory`

      Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

      - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

      - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

      - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

      - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

      - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

    - `ClaudeTagUserID string`

      Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

    - `ContextWindow BetaAnalyticsContextWindow`

      Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

      - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

      - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

    - `CostType BetaAnalyticsCostType`

      Cost component when `group_by[]=cost_type`; null otherwise (amount is the combined total).

      - `const BetaAnalyticsCostTypeCodeExecution BetaAnalyticsCostType = "code_execution"`

      - `const BetaAnalyticsCostTypeTokens BetaAnalyticsCostType = "tokens"`

      - `const BetaAnalyticsCostTypeWebSearch BetaAnalyticsCostType = "web_search"`

    - `Currency string`

      Currency code for the cost amount. Currently always `"USD"`.

      default: USD

    - `InferenceGeo BetaAnalyticsCostBucketedResultInferenceGeo`

      Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

      - `const BetaAnalyticsCostBucketedResultInferenceGeoGlobal BetaAnalyticsCostBucketedResultInferenceGeo = "global"`

      - `const BetaAnalyticsCostBucketedResultInferenceGeoUs BetaAnalyticsCostBucketedResultInferenceGeo = "us"`

    - `ListAmount string`

      List-price amount (pre-discount) in fractional cents.

    - `Model string`

      Model that produced the usage or cost, as a model name in the form the `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` is in `group_by[]`; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

    - `Product string`

      Product surface that produced the usage or cost. Null unless product is in `group_by[]`; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values include `chat`, `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's features inside claude.ai chat: chat and Cowork usage by a member who has it turned on is reported under this value instead of `chat` or `cowork`. It is accepted as a filter only on deployments that offer Chat and Cowork unified. Some unattributed usage is reported as "other".

    - `RBACGroupID string`

      RBAC group (team) the usage is attributed to, in the public tagged `rbac_group_...` spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as an `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in `group_by[]`. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query without `group_by[]`.

    - `Requests int64`

      Number of API requests in this row's scope. Null when `group_by` includes `cost_type` or `token_type` (the count has no per-component attribution; read it from the ungrouped response). For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with `product: null`).

    - `SlackChannelID string`

      Slack channel the usage originated from. Populated only when `slack_channel_id` is in `group_by[]`; null for usage outside Slack (and for rows recorded before channel attribution was enabled).

    - `Speed BetaAnalyticsCostBucketedResultSpeed`

      Inference speed mode of the usage or cost: `fast` or `standard`. Null unless `speed` is in `group_by[]`.

      - `const BetaAnalyticsCostBucketedResultSpeedFast BetaAnalyticsCostBucketedResultSpeed = "fast"`

      - `const BetaAnalyticsCostBucketedResultSpeedStandard BetaAnalyticsCostBucketedResultSpeed = "standard"`

    - `TokenType BetaAnalyticsTokenType`

      Token type when `group_by[]=token_type` and `cost_type=tokens`; null otherwise.

      - `const BetaAnalyticsTokenTypeCacheCreationEphemeral1hInputTokens BetaAnalyticsTokenType = "cache_creation.ephemeral_1h_input_tokens"`

      - `const BetaAnalyticsTokenTypeCacheCreationEphemeral5mInputTokens BetaAnalyticsTokenType = "cache_creation.ephemeral_5m_input_tokens"`

      - `const BetaAnalyticsTokenTypeCacheReadInputTokens BetaAnalyticsTokenType = "cache_read_input_tokens"`

      - `const BetaAnalyticsTokenTypeOutputTokens BetaAnalyticsTokenType = "output_tokens"`

      - `const BetaAnalyticsTokenTypeUncachedInputTokens BetaAnalyticsTokenType = "uncached_input_tokens"`

  - `StartingAt Time`

    Start of the time bucket (inclusive) in RFC 3339 format.

    format: date-time

#### Example

```go
package main

import (
	"context"
	"fmt"
	"time"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.Analytics.CostReport.List(context.TODO(), anthropic.BetaOrganizationAnalyticsCostReportListParams{
		StartingAt: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "ending_at": "2019-12-27T18:11:19.117Z",
      "results": [
        {
          "amount": "amount",
          "claude_tag_category": "dm",
          "claude_tag_user_id": "U0123ABCDEF",
          "context_window": "0-200k",
          "cost_type": "code_execution",
          "currency": "USD",
          "inference_geo": "global",
          "list_amount": "list_amount",
          "model": "claude-opus-5-5",
          "product": "chat",
          "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
          "requests": 0,
          "slack_channel_id": "C0123ABCDEF",
          "speed": "fast",
          "token_type": "cache_creation.ephemeral_1h_input_tokens"
        }
      ],
      "starting_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "data_refreshed_at": "2019-12-27T18:11:19.117Z",
  "has_more": true,
  "next_page": "next_page",
  "organization_id": "org_013FP9SaFPBg7Kw7fetjn6cF"
}
```

## Beta › Organization › Analytics › User Cost Report

### Get Per-User Cost

`client.Beta.Organization.Analytics.UserCostReport.List(ctx, query) (*PageCursor[BetaAnalyticsCostUsersItem], error)`

**GET** `/v1/organizations/analytics/user_cost_report`

Get per-user cost in USD across a date range.

Returns one row per user, ranked by spend. Use this to see which users
account for the most cost. Only cost attributable to a seat user is
included; for organization-wide totals including direct API-key and
automation traffic, use the bucketed
`/v1/organizations/analytics/cost_report` endpoint. Available to
organizations on a Claude Enterprise plan. Requires an API key with the
`read:analytics` scope.

#### Parameters

- `query BetaOrganizationAnalyticsUserCostReportListParams`

  - `StartingAt Time` (query parameter)

    Start of range, inclusive. RFC 3339 tz-aware. Must be within the last 365 days and no earlier than 2026-01-01T00:00:00Z.

    format: date-time

  - `BucketWidth BetaOrganizationAnalyticsUserCostReportListParamsBucketWidth Optional` (query parameter)

    Time-bucket granularity. When set, each row's `starting_at` and `ending_at` are populated and one actor may span several rows (one per time bucket with usage). The time bucket counts toward `limit`, so one page can return multiple rows for the same actor. `ending_at` is required when `bucket_width` is set, and with `bucket_width="1m"` the range may span at most 24 hours. When omitted, each row aggregates the full `[starting_at, ending_at)` range.

    - `const BetaOrganizationAnalyticsUserCostReportListParamsBucketWidthDay BetaOrganizationAnalyticsUserCostReportListParamsBucketWidth = "1d"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsBucketWidthHour BetaOrganizationAnalyticsUserCostReportListParamsBucketWidth = "1h"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsBucketWidthMinute BetaOrganizationAnalyticsUserCostReportListParamsBucketWidth = "1m"`

  - `ClaudeTagCategories []BetaAnalyticsClaudeTagCategory Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage in specific spend categories. Usage with no category never matches. `dm` usage is reported under the user's product rather than `claude-tag`, so combining this filter with `products[]=claude-tag` excludes it. Use `group_by[]=claude_tag_category` to break out per-category values.

    maxItems: 100

    - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

    - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

    - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

    - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

    - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

  - `ClaudeTagUserIDs []string Optional` (query parameter)

    Filter to Claude Tag (Claude in Slack) usage attributed to specific Slack users, by Slack user ID (for example `U0123ABCDEF`), not claude.ai user ID. Usage that is not Claude Tag, and Claude Tag usage not attributed to a single user, never matches. Use `group_by[]=claude_tag_user_id` to break out per-user values.

    maxItems: 100

  - `ContextWindows []BetaAnalyticsContextWindow Optional` (query parameter)

    Filter to specific context-window pricing tiers. Use `group_by[]=context_window` to break out per-tier values.

    maxItems: 100

    - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

    - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

  - `EndingAt param.Opt[Time] Optional` (query parameter)

    End of range, exclusive. When omitted, defaults to the earlier of now and `starting_at` + 31 days. The range may span at most 31 days.

    format: date-time

  - `ExcludeDeletedUsers param.Opt[bool] Optional` (query parameter)

    If true, omit rows for users who are deleted (`deleted: true`). A page may contain fewer than `limit` rows; use `has_more` and `next_page` to paginate as usual.

  - `GroupBy []string Optional` (query parameter)

    Break each actor's row out by the given dimensions. Accepts the same values as the bucketed `/cost_report` endpoint. The `product`, `model`, `context_window`, `inference_geo`, and `speed` dimensions — and the time bucket, when `bucket_width` is set — count toward `limit`. `cost_type` and `token_type` do not: `cost_type` returns one row per cost component (tokens, web search, code execution); `token_type` returns one row per token type, each with `cost_type: "tokens"`; combining both returns the per-token-type rows plus the web-search and code-execution rows. A page can therefore contain more rows than `limit` when `cost_type` or `token_type` is requested.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByClaudeTagCategory BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "claude_tag_category"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByClaudeTagUserID BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "claude_tag_user_id"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByContextWindow BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "context_window"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByCostType BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "cost_type"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByInferenceGeo BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "inference_geo"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByModel BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "model"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByProduct BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "product"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByRBACGroupID BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "rbac_group_id"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupBySlackChannelID BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "slack_channel_id"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupBySpeed BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "speed"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsGroupByTokenType BetaOrganizationAnalyticsUserCostReportListParamsGroupBy = "token_type"`

  - `InferenceGeos []BetaAnalyticsInferenceGeoFilter Optional` (query parameter)

    Filter to specific inference regions. `not_available` matches rows where the region is unset. Use `group_by[]=inference_geo` to break out per-region values.

    maxItems: 100

    - `const BetaAnalyticsInferenceGeoFilterGlobal BetaAnalyticsInferenceGeoFilter = "global"`

    - `const BetaAnalyticsInferenceGeoFilterNotAvailable BetaAnalyticsInferenceGeoFilter = "not_available"`

    - `const BetaAnalyticsInferenceGeoFilterUs BetaAnalyticsInferenceGeoFilter = "us"`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of rows per page (1-1000, default 20). One row per actor unless `group_by[]` or `bucket_width` splits an actor across rows; `cost_type`/`token_type` fan-out rows (cost endpoint only) are the exception — they do not count toward this limit, so `data` can exceed it.

    minimum: 1, maximum: 1000

  - `Models []string Optional` (query parameter)

    Models to include. Defaults to all models. Use `group_by[]=model` to break out per-model values.

    maxItems: 100

  - `Order BetaOrganizationAnalyticsUserCostReportListParamsOrder Optional` (query parameter)

    Sort direction. Defaults to `desc`.

    - `const BetaOrganizationAnalyticsUserCostReportListParamsOrderAsc BetaOrganizationAnalyticsUserCostReportListParamsOrder = "asc"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsOrderDesc BetaOrganizationAnalyticsUserCostReportListParamsOrder = "desc"`

  - `OrderBy BetaOrganizationAnalyticsUserCostReportListParamsOrderBy Optional` (query parameter)

    Metric to rank actors by. Defaults to `amount`.

    - `const BetaOrganizationAnalyticsUserCostReportListParamsOrderByAmount BetaOrganizationAnalyticsUserCostReportListParamsOrderBy = "amount"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsOrderByListAmount BetaOrganizationAnalyticsUserCostReportListParamsOrderBy = "list_amount"`

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `Products []BetaAnalyticsProductFilter Optional` (query parameter)

    Product surfaces to include. Defaults to all products.

    maxItems: 100

    - `const BetaAnalyticsProductFilterChat BetaAnalyticsProductFilter = "chat"`

    - `const BetaAnalyticsProductFilterChatCoworkUnified BetaAnalyticsProductFilter = "chat_cowork_unified"`

    - `const BetaAnalyticsProductFilterClaudeTag BetaAnalyticsProductFilter = "claude-tag"`

    - `const BetaAnalyticsProductFilterClaudeCode BetaAnalyticsProductFilter = "claude_code"`

    - `const BetaAnalyticsProductFilterClaudeDesign BetaAnalyticsProductFilter = "claude_design"`

    - `const BetaAnalyticsProductFilterClaudeInChrome BetaAnalyticsProductFilter = "claude_in_chrome"`

    - `const BetaAnalyticsProductFilterCowork BetaAnalyticsProductFilter = "cowork"`

    - `const BetaAnalyticsProductFilterOfficeAgent BetaAnalyticsProductFilter = "office_agent"`

  - `RBACGroupIDs []string Optional` (query parameter)

    Filter to usage attributed to specific RBAC groups. Accepts tagged RBAC group IDs (`rbac_group_...`) or bare group UUIDs. A row matches when the user belonged to any of the listed groups on the (UTC) day the usage occurred; usage with no group attribution never matches.

    maxItems: 100

  - `SlackChannelIDs []string Optional` (query parameter)

    Filter to usage originating from specific Slack channels. Use `group_by[]=slack_channel_id` to break out per-channel values.

    maxItems: 100

  - `Speeds []string Optional` (query parameter)

    Filter to fast or standard inference mode. Use `group_by[]=speed` to break out per-mode values.

    maxItems: 100

    - `const BetaOrganizationAnalyticsUserCostReportListParamsSpeedFast BetaOrganizationAnalyticsUserCostReportListParamsSpeed = "fast"`

    - `const BetaOrganizationAnalyticsUserCostReportListParamsSpeedStandard BetaOrganizationAnalyticsUserCostReportListParamsSpeed = "standard"`

  - `UserIDs []string Optional` (query parameter)

    Filter to specific users by tagged user ID.

    maxItems: 100

#### Returns

- `type BetaAnalyticsCostUsersItem`

  - `Actor BetaAnalyticsUserActor`

    The user this row's usage or cost is attributed to. Always a `user_actor`.

    - `Type UserActor`

      Actor type. Always `"user_actor"`.

    - `Deleted bool`

      True when the account has been deleted, or when the user is no longer a member of the organization or its associated organizations (for example, their membership was removed or they were deprovisioned via your identity provider). `email_address` stays populated for removed users and is null when the account has been deleted. `name` follows the rules described on that field. The `user_id` is still populated for reconciliation.

    - `EmailAddress string`

      The user's email address, including for users who are no longer members of the organization or its associated organizations. Null when the account has been deleted (check `deleted`) and for system-minted service accounts, which have no person's mailbox behind them (check `name`).

    - `Name string`

      The user's full name. Null when the user has not set a name. Returns `"Deleted User"` when the account itself has been deleted, or when the user is no longer a member of the organization or its associated organizations and the organization has chosen to hide the names of removed users. Otherwise, the name stays populated for removed users. Rows for system-minted service accounts render the service name (for example, `"Claude Security"` for usage by Anthropic's security-patching service) or null.

    - `UserID string`

      Tagged user ID.

  - `Amount string`

    Amount (post-discount, pre-credit) in fractional cents (minor units).

  - `ClaudeTagCategory BetaAnalyticsClaudeTagCategory`

    Claude Tag (Claude in Slack) spend category: `engaged` (a person addressed Claude in a channel or thread), `proactive` (Claude responded without being addressed), `scheduled` (a scheduled routine ran), `monitoring` (Claude watching a channel it was asked to monitor), or `dm` (direct messages with Claude). Populated only when `claude_tag_category` is in `group_by[]`; null for usage that is not Claude Tag. Direct-message usage is billed to the individual user and is reported under that user's product, not under `claude-tag`. New categories may be added over time.

    - `const BetaAnalyticsClaudeTagCategoryDm BetaAnalyticsClaudeTagCategory = "dm"`

    - `const BetaAnalyticsClaudeTagCategoryEngaged BetaAnalyticsClaudeTagCategory = "engaged"`

    - `const BetaAnalyticsClaudeTagCategoryMonitoring BetaAnalyticsClaudeTagCategory = "monitoring"`

    - `const BetaAnalyticsClaudeTagCategoryProactive BetaAnalyticsClaudeTagCategory = "proactive"`

    - `const BetaAnalyticsClaudeTagCategoryScheduled BetaAnalyticsClaudeTagCategory = "scheduled"`

  - `ClaudeTagUserID string`

    Slack user ID (for example `U0123ABCDEF`) of the member the Claude Tag (Claude in Slack) usage is attributed to, not a claude.ai user ID. Populated only when `claude_tag_user_id` is in `group_by[]`; null for usage that is not Claude Tag and for Claude Tag usage that is not attributed to a single user (for example `monitoring`, and `proactive` usage Claude initiated), so per-user rows can sum to less than the Claude Tag total. Cannot be combined with `group_by[]=rbac_group_id` or the `rbac_group_ids[]` filter.

  - `ContextWindow BetaAnalyticsContextWindow`

    Context-window pricing tier of the usage or cost. Null unless `context_window` is in `group_by[]`; it can also be null on grouped rows with no context-window tier, such as code execution.

    - `const BetaAnalyticsContextWindowFrom0To200k BetaAnalyticsContextWindow = "0-200k"`

    - `const BetaAnalyticsContextWindowFrom200kTo1M BetaAnalyticsContextWindow = "200k-1M"`

  - `CostType BetaAnalyticsCostType`

    Cost component breakdown; null when returning the combined total.

    - `const BetaAnalyticsCostTypeCodeExecution BetaAnalyticsCostType = "code_execution"`

    - `const BetaAnalyticsCostTypeTokens BetaAnalyticsCostType = "tokens"`

    - `const BetaAnalyticsCostTypeWebSearch BetaAnalyticsCostType = "web_search"`

  - `Currency string`

    Currency code for the cost amount. Currently always `"USD"`.

    default: USD

  - `EndingAt Time`

    End of the row's UTC time bucket (exclusive), as an RFC 3339 timestamp; equal to `starting_at` plus one `bucket_width`. Null unless `bucket_width` is set.

    format: date-time

  - `InferenceGeo BetaAnalyticsCostUsersItemInferenceGeo`

    Inference region of the usage or cost. Null unless `inference_geo` is in `group_by[]`; it can also be null on grouped rows where the region is not set (the rows that `inference_geos[]=not_available` matches).

    - `const BetaAnalyticsCostUsersItemInferenceGeoGlobal BetaAnalyticsCostUsersItemInferenceGeo = "global"`

    - `const BetaAnalyticsCostUsersItemInferenceGeoUs BetaAnalyticsCostUsersItemInferenceGeo = "us"`

  - `ListAmount string`

    List-price amount (pre-discount) in fractional cents.

  - `Model string`

    Model that produced the usage or cost, as a model name in the form the `models[]` filter accepts (for example, `claude-opus-5-5`). Null unless `model` is in `group_by[]`; it can also be null on grouped rows whose usage or cost is not attributed to a specific model, such as code execution.

  - `Product string`

    Product surface that produced the usage or cost. Null unless product is in `group_by[]`; it can also be null on grouped rows whose usage cannot be attributed to a known surface. Values include `chat`, `claude_code`, `cowork`, `office_agent`, `claude_in_chrome`, `claude_design`, `claude-tag`, and `chat_cowork_unified`. `claude-tag` is Claude Tag, the Claude product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's features inside claude.ai chat: chat and Cowork usage by a member who has it turned on is reported under this value instead of `chat` or `cowork`. It is accepted as a filter only on deployments that offer Chat and Cowork unified. Some unattributed usage is reported as "other".

  - `RBACGroupID string`

    RBAC group (team) the usage is attributed to, in the public tagged `rbac_group_...` spelling — the same spelling the activity resources use for this key, so the same team has one id across resources and it round-trips as an `rbac_group_ids[]` filter value. Populated only when `rbac_group_id` is in `group_by[]`. Any-membership semantics: a user in several groups contributes their full usage to each of those groups' rows, so the named-group rows overlap and their sum can exceed the org total. A null value is the single unassigned row: users in no group on that (UTC) day. For the true org total, run the same query without `group_by[]`.

  - `Requests int64`

    Number of API requests in this row's scope. Null when `group_by` includes `cost_type` or `token_type` (the count has no per-component attribution; read it from the ungrouped response). For sandbox / code-execution events, this counts execution spans rather than HTTP requests (these rows surface with `product: null`).

  - `SlackChannelID string`

    Slack channel the usage originated from. Populated only when `slack_channel_id` is in `group_by[]`; null for usage outside Slack (and for rows recorded before channel attribution was enabled).

  - `Speed BetaAnalyticsCostUsersItemSpeed`

    Inference speed mode of the usage or cost: `fast` or `standard`. Null unless `speed` is in `group_by[]`.

    - `const BetaAnalyticsCostUsersItemSpeedFast BetaAnalyticsCostUsersItemSpeed = "fast"`

    - `const BetaAnalyticsCostUsersItemSpeedStandard BetaAnalyticsCostUsersItemSpeed = "standard"`

  - `StartingAt Time`

    Start of the row's UTC time bucket (inclusive), as an RFC 3339 timestamp. Null unless `bucket_width` is set; without `bucket_width`, each row aggregates the full requested range.

    format: date-time

  - `TokenType BetaAnalyticsTokenType`

    Token type when `cost_type` is `tokens`; null otherwise.

    - `const BetaAnalyticsTokenTypeCacheCreationEphemeral1hInputTokens BetaAnalyticsTokenType = "cache_creation.ephemeral_1h_input_tokens"`

    - `const BetaAnalyticsTokenTypeCacheCreationEphemeral5mInputTokens BetaAnalyticsTokenType = "cache_creation.ephemeral_5m_input_tokens"`

    - `const BetaAnalyticsTokenTypeCacheReadInputTokens BetaAnalyticsTokenType = "cache_read_input_tokens"`

    - `const BetaAnalyticsTokenTypeOutputTokens BetaAnalyticsTokenType = "output_tokens"`

    - `const BetaAnalyticsTokenTypeUncachedInputTokens BetaAnalyticsTokenType = "uncached_input_tokens"`

#### Example

```go
package main

import (
	"context"
	"fmt"
	"time"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.Analytics.UserCostReport.List(context.TODO(), anthropic.BetaOrganizationAnalyticsUserCostReportListParams{
		StartingAt: time.Now(),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "actor": {
        "deleted": true,
        "email": "jane@example.com",
        "email_address": "jane@example.com",
        "name": "Jane Smith",
        "type": "user_actor",
        "user_id": "user_01AbCdEfGhIjKlMnOpQrSt"
      },
      "amount": "41280.000000",
      "claude_tag_category": "dm",
      "claude_tag_user_id": "U0123ABCDEF",
      "context_window": "0-200k",
      "cost_type": "code_execution",
      "currency": "USD",
      "ending_at": "2019-12-27T18:11:19.117Z",
      "inference_geo": "global",
      "list_amount": "51600.000000",
      "model": "claude-opus-5-5",
      "product": "chat",
      "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "requests": 128,
      "slack_channel_id": "C0123ABCDEF",
      "speed": "fast",
      "starting_at": "2019-12-27T18:11:19.117Z",
      "token_type": "cache_creation.ephemeral_1h_input_tokens"
    }
  ],
  "data_refreshed_at": "2019-12-27T18:11:19.117Z",
  "has_more": true,
  "next_page": "next_page",
  "organization_id": "org_013FP9SaFPBg7Kw7fetjn6cF"
}
```

## Beta › Organization › Spend Limits

### Set Spend Limit

`client.Beta.Organization.SpendLimits.Set(ctx, params) (*BetaSpendLimit, error)`

**POST** `/v1/organizations/spend_limits`

Set a spend limit.

Upsert keyed on (scope, period): setting a limit that already exists
overwrites it in place. A Claude Enterprise organization sets `user`
limits. Its seat-tier, group, and organization-level defaults are configured
in claude.ai. A Claude Console organization sets `organization` and
`workspace` limits, which are monthly and always carry an amount. Setting those
limits is in an early access preview. To request access, contact your
Anthropic account team.

#### Parameters

- `params BetaOrganizationSpendLimitSetParams`

  - `Amount param.Opt[string]`

    Limit amount as a non-negative integer decimal string in the minor unit of the organization's billing currency (cents for USD): "50000" is $500.00. `null` sets an explicit no-limit override for this scope and `period` only — each period resolves independently, so caps for other periods still apply.

  - `Scope BetaOrganizationSpendLimitSetParamsScopeUnion`

    What the limit applies to. Claude Enterprise organizations set `user` limits. Claude Console organizations set `organization` and `workspace` limits. Any other combination returns 400. Setting `organization` and `workspace` limits through the API is in an early access preview. To request access, contact your Anthropic account team.

    - `type BetaSpendLimitUserScope`

      Scope selecting a single member of the organization.

      - `Type User`

        Scope type. Always `user` for this scope.

        default: user

      - `UserID string`

        Tagged ID of the member the spend limit applies to.

    - `type BetaSpendLimitOrganizationScope`

      - `Type Organization`

        default: organization

    - `type BetaSpendLimitWorkspaceScope`

      Scope selecting one workspace of a Claude Console organization.

      - `Type Workspace`

        Scope type. Always `workspace` for this scope.

        default: workspace

      - `WorkspaceID string`

        Tagged ID of the workspace the spend limit applies to.

  - `Period BetaSpendLimitPeriod Optional`

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

#### Returns

- `type BetaSpendLimit`

  A configured spend limit: a cap on metered spend for one scope and period.

  - `Type SpendLimit`

    Object type. Always `spend_limit`.

    default: spend_limit

  - `ID string`

    Unique tagged ID of the spend limit (`spl_...`).

  - `Amount string`

    Limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD): "50000" is $500.00. `null` means no numeric cap is configured at this scope — see the effective report for whether a limit applies.

  - `CreatedAt Time`

    RFC 3339 datetime at which the spend limit was created.

    format: date-time

  - `Currency string`

    ISO 4217 code of the organization's billing currency; the unit for `amount`.

  - `IsEnabled bool`

    Read-only. `false` when extra usage is switched off for this organization (`organization` limit); `amount` is kept and applies again when it's switched back on. Always `true` for other limits.

  - `Period BetaSpendLimitPeriod`

    Length of the window the limit resets over. `amount` caps spend within each period.

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `Scope BetaSpendLimitScopeUnion`

    What the limit applies to. A tagged union on `type`; each variant carries the identifier for its scope.

    - `type BetaSpendLimitUserScope`

      Scope selecting a single member of the organization.

      - `Type User`

        Scope type. Always `user` for this scope.

        default: user

      - `UserID string`

        Tagged ID of the member the spend limit applies to.

    - `type BetaSpendLimitSeatTierScope`

      - `Type SeatTier`

        default: seat_tier

      - `SeatTier string`

    - `type BetaSpendLimitRBACGroupScope`

      - `Type RBACGroup`

        default: rbac_group

      - `RBACGroupID string`

    - `type BetaSpendLimitOrganizationServiceScope`

      - `Type OrganizationService`

        default: organization_service

      - `Service string`

    - `type BetaSpendLimitOrganizationScope`

      - `Type Organization`

        default: organization

    - `type BetaSpendLimitWorkspaceScope`

      Scope selecting one workspace of a Claude Console organization.

      - `Type Workspace`

        Scope type. Always `workspace` for this scope.

        default: workspace

      - `WorkspaceID string`

        Tagged ID of the workspace the spend limit applies to.

    - `type BetaSpendLimitUsageTierScope`

      Scope of the monthly spend cap Anthropic sets for a Claude Console
      organization from its usage tier, or a higher cap Anthropic granted the
      organization. Read-only; its `created_at` and `updated_at` are the
      organization's creation time, so `amount` can change while `updated_at` stays
      the same.

      - `Type UsageTier`

        Scope type. Always `usage_tier` for this scope.

        default: usage_tier

  - `UpdatedAt Time`

    RFC 3339 datetime at which the spend limit was last modified.

    format: date-time

#### 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"),
	)
	betaSpendLimit, err := client.Beta.Organization.SpendLimits.Set(context.TODO(), anthropic.BetaOrganizationSpendLimitSetParams{
		Amount: anthropic.String("50000"),
		Scope: anthropic.BetaOrganizationSpendLimitSetParamsScopeUnion{
			OfUser: &anthropic.BetaSpendLimitUserScopeParam{
				UserID: "user_01WCz1FkmYMm4gnmykNKUu3Q",
			},
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSpendLimit.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "amount": "50000",
  "created_at": "2019-12-27T18:11:19.117Z",
  "currency": "USD",
  "is_enabled": true,
  "period": "daily",
  "scope": {
    "type": "user",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "type": "spend_limit",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

### Get Spend Limit

`client.Beta.Organization.SpendLimits.Get(ctx, spendLimitID) (*BetaSpendLimit, error)`

**GET** `/v1/organizations/spend_limits/{spend_limit_id}`

Retrieve a spend limit by ID.

#### Parameters

- `spendLimitID string` (path parameter)

  ID of the Spend Limit.

#### Returns

- `type BetaSpendLimit`

  A configured spend limit: a cap on metered spend for one scope and period.

  - `Type SpendLimit`

    Object type. Always `spend_limit`.

    default: spend_limit

  - `ID string`

    Unique tagged ID of the spend limit (`spl_...`).

  - `Amount string`

    Limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD): "50000" is $500.00. `null` means no numeric cap is configured at this scope — see the effective report for whether a limit applies.

  - `CreatedAt Time`

    RFC 3339 datetime at which the spend limit was created.

    format: date-time

  - `Currency string`

    ISO 4217 code of the organization's billing currency; the unit for `amount`.

  - `IsEnabled bool`

    Read-only. `false` when extra usage is switched off for this organization (`organization` limit); `amount` is kept and applies again when it's switched back on. Always `true` for other limits.

  - `Period BetaSpendLimitPeriod`

    Length of the window the limit resets over. `amount` caps spend within each period.

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `Scope BetaSpendLimitScopeUnion`

    What the limit applies to. A tagged union on `type`; each variant carries the identifier for its scope.

    - `type BetaSpendLimitUserScope`

      Scope selecting a single member of the organization.

      - `Type User`

        Scope type. Always `user` for this scope.

        default: user

      - `UserID string`

        Tagged ID of the member the spend limit applies to.

    - `type BetaSpendLimitSeatTierScope`

      - `Type SeatTier`

        default: seat_tier

      - `SeatTier string`

    - `type BetaSpendLimitRBACGroupScope`

      - `Type RBACGroup`

        default: rbac_group

      - `RBACGroupID string`

    - `type BetaSpendLimitOrganizationServiceScope`

      - `Type OrganizationService`

        default: organization_service

      - `Service string`

    - `type BetaSpendLimitOrganizationScope`

      - `Type Organization`

        default: organization

    - `type BetaSpendLimitWorkspaceScope`

      Scope selecting one workspace of a Claude Console organization.

      - `Type Workspace`

        Scope type. Always `workspace` for this scope.

        default: workspace

      - `WorkspaceID string`

        Tagged ID of the workspace the spend limit applies to.

    - `type BetaSpendLimitUsageTierScope`

      Scope of the monthly spend cap Anthropic sets for a Claude Console
      organization from its usage tier, or a higher cap Anthropic granted the
      organization. Read-only; its `created_at` and `updated_at` are the
      organization's creation time, so `amount` can change while `updated_at` stays
      the same.

      - `Type UsageTier`

        Scope type. Always `usage_tier` for this scope.

        default: usage_tier

  - `UpdatedAt Time`

    RFC 3339 datetime at which the spend limit was last modified.

    format: date-time

#### 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"),
	)
	betaSpendLimit, err := client.Beta.Organization.SpendLimits.Get(context.TODO(), "spend_limit_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSpendLimit.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "amount": "50000",
  "created_at": "2019-12-27T18:11:19.117Z",
  "currency": "USD",
  "is_enabled": true,
  "period": "daily",
  "scope": {
    "type": "user",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "type": "spend_limit",
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```

### Delete Spend Limit

`client.Beta.Organization.SpendLimits.Delete(ctx, spendLimitID) (*BetaOrganizationSpendLimitDeleteResponse, error)`

**DELETE** `/v1/organizations/spend_limits/{spend_limit_id}`

Delete a spend limit.

For a Claude Enterprise organization, this deletes a per-user override, and
the member falls back to any inherited spend limit at that period. Its
seat-tier, group, and organization-level rows cannot be deleted via this
endpoint. A Claude Console organization deletes its organization and
workspace limits, but not its `usage_tier` limit. Deleting organization and
workspace limits through the API is in an early access preview.

#### Parameters

- `spendLimitID string` (path parameter)

  ID of the Spend Limit.

#### Returns

- `type BetaOrganizationSpendLimitDeleteResponse`

  - `Type SpendLimitDeleted`

    default: spend_limit_deleted

  - `ID string`

#### 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"),
	)
	spendLimit, err := client.Beta.Organization.SpendLimits.Delete(context.TODO(), "spend_limit_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", spendLimit.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "type": "spend_limit_deleted"
}
```

### List Spend Limits

`client.Beta.Organization.SpendLimits.List(ctx, params) (*PageCursor[BetaSpendLimit], error)`

**GET** `/v1/organizations/spend_limits`

List the organization's spend limits.

Limits are grouped by scope type, in the order `organization`, `seat_tier`,
`rbac_group`, `organization_service`, `user`; within a type they come in a
fixed order that is not creation order. Supported for Claude Enterprise
organizations only, not for Claude Console organizations.

#### Parameters

- `params BetaOrganizationSpendLimitListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of limits per page. Defaults to `20`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `ScopeType []string Optional` (query parameter)

    Return only limits with these scope types. Omit for all.

    maxItems: 100

    - `const BetaOrganizationSpendLimitListParamsScopeTypeOrganization BetaOrganizationSpendLimitListParamsScopeType = "organization"`

    - `const BetaOrganizationSpendLimitListParamsScopeTypeOrganizationService BetaOrganizationSpendLimitListParamsScopeType = "organization_service"`

    - `const BetaOrganizationSpendLimitListParamsScopeTypeRBACGroup BetaOrganizationSpendLimitListParamsScopeType = "rbac_group"`

    - `const BetaOrganizationSpendLimitListParamsScopeTypeSeatTier BetaOrganizationSpendLimitListParamsScopeType = "seat_tier"`

    - `const BetaOrganizationSpendLimitListParamsScopeTypeUser BetaOrganizationSpendLimitListParamsScopeType = "user"`

    - `const BetaOrganizationSpendLimitListParamsScopeTypeWorkspace BetaOrganizationSpendLimitListParamsScopeType = "workspace"`

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

    This endpoint is in beta: requests must send `spend-limit-reads-2026-09-26` in this header.

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

#### Returns

- `type BetaSpendLimit`

  A configured spend limit: a cap on metered spend for one scope and period.

  - `Type SpendLimit`

    Object type. Always `spend_limit`.

    default: spend_limit

  - `ID string`

    Unique tagged ID of the spend limit (`spl_...`).

  - `Amount string`

    Limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD): "50000" is $500.00. `null` means no numeric cap is configured at this scope — see the effective report for whether a limit applies.

  - `CreatedAt Time`

    RFC 3339 datetime at which the spend limit was created.

    format: date-time

  - `Currency string`

    ISO 4217 code of the organization's billing currency; the unit for `amount`.

  - `IsEnabled bool`

    Read-only. `false` when extra usage is switched off for this organization (`organization` limit); `amount` is kept and applies again when it's switched back on. Always `true` for other limits.

  - `Period BetaSpendLimitPeriod`

    Length of the window the limit resets over. `amount` caps spend within each period.

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `Scope BetaSpendLimitScopeUnion`

    What the limit applies to. A tagged union on `type`; each variant carries the identifier for its scope.

    - `type BetaSpendLimitUserScope`

      Scope selecting a single member of the organization.

      - `Type User`

        Scope type. Always `user` for this scope.

        default: user

      - `UserID string`

        Tagged ID of the member the spend limit applies to.

    - `type BetaSpendLimitSeatTierScope`

      - `Type SeatTier`

        default: seat_tier

      - `SeatTier string`

    - `type BetaSpendLimitRBACGroupScope`

      - `Type RBACGroup`

        default: rbac_group

      - `RBACGroupID string`

    - `type BetaSpendLimitOrganizationServiceScope`

      - `Type OrganizationService`

        default: organization_service

      - `Service string`

    - `type BetaSpendLimitOrganizationScope`

      - `Type Organization`

        default: organization

    - `type BetaSpendLimitWorkspaceScope`

      Scope selecting one workspace of a Claude Console organization.

      - `Type Workspace`

        Scope type. Always `workspace` for this scope.

        default: workspace

      - `WorkspaceID string`

        Tagged ID of the workspace the spend limit applies to.

    - `type BetaSpendLimitUsageTierScope`

      Scope of the monthly spend cap Anthropic sets for a Claude Console
      organization from its usage tier, or a higher cap Anthropic granted the
      organization. Read-only; its `created_at` and `updated_at` are the
      organization's creation time, so `amount` can change while `updated_at` stays
      the same.

      - `Type UsageTier`

        Scope type. Always `usage_tier` for this scope.

        default: usage_tier

  - `UpdatedAt Time`

    RFC 3339 datetime at which the spend limit was last modified.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Organization.SpendLimits.List(context.TODO(), anthropic.BetaOrganizationSpendLimitListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "amount": "50000",
      "created_at": "2019-12-27T18:11:19.117Z",
      "currency": "USD",
      "is_enabled": true,
      "period": "daily",
      "scope": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "type": "spend_limit",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Spend Limits › Effective

### List Effective Spend Limits

`client.Beta.Organization.SpendLimits.Effective.List(ctx, query) (*PageCursor[BetaSpendSummary], error)`

**GET** `/v1/organizations/spend_limits/effective`

List each member's effective spend limit and period-to-date spend.

Returns one row per (member, period) the member resolves a spend limit
for, with the `source` scope the spend limit was inherited from.
Paginates by member, so a member's periods never split across pages.
Supported for Claude Enterprise organizations only, not for Claude Console
organizations.

#### Parameters

- `query BetaOrganizationSpendLimitEffectiveListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Maximum number of members per page. A member's period rows never split across pages, so a page may carry more rows than this. Defaults to `20`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page` field.

  - `Period []string Optional` (query parameter)

    Restrict the report to these limit periods. Omit to return one row per period each member resolves a spend limit for.

    maxItems: 3

    - `const BetaOrganizationSpendLimitEffectiveListParamsPeriodDaily BetaOrganizationSpendLimitEffectiveListParamsPeriod = "daily"`

    - `const BetaOrganizationSpendLimitEffectiveListParamsPeriodMonthly BetaOrganizationSpendLimitEffectiveListParamsPeriod = "monthly"`

    - `const BetaOrganizationSpendLimitEffectiveListParamsPeriodWeekly BetaOrganizationSpendLimitEffectiveListParamsPeriod = "weekly"`

  - `UserIDs []string Optional` (query parameter)

    Restrict the report to these members, by tagged user ID (`user_...`). At most 100 entries.

    maxItems: 100

#### Returns

- `type BetaSpendSummary`

  Per-member effective-limit report row (`GET /spend_limits/effective`).

  - `Actor BetaSpendSummaryActorUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

      - `Type UserActor`

        Actor type. Always `user_actor`.

        default: user_actor

      - `Deleted bool`

        True only when the underlying account has been deleted.

        default: false

      - `EmailAddress string`

        The user's email address. Null when the account is unavailable or has been deleted.

      - `Name string`

        The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

      - `UserID string`

        Tagged ID of the user.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

      - `Type ScopedAPIKeyActor`

        default: scoped_api_key_actor

      - `ScopedAPIKeyID string`

  - `Amount string`

    Effective limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD). `null` means no limit applies for this row's `period` — each period resolves independently, so another period may still cap this member.

  - `Currency string`

    ISO 4217 code of the organization's billing currency; the unit for `amount` and `period_to_date_spend`.

  - `Period BetaSpendLimitPeriod`

    Period this row's effective limit and spend are reported for.

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `PeriodToDateSpend string`

    The member's spend so far in the current period, as a non-negative decimal string in the minor unit of `currency` (cents for USD). May carry fractional minor units up to three decimal places (e.g. `"12050.5"`) — metered usage is not rounded to whole cents. Reads as `"0"` when the spend reading is temporarily unavailable.

  - `Scope BetaSpendSummaryScopeUnion`

    - `type BetaSpendLimitUserScope`

      Scope selecting a single member of the organization.

      - `Type User`

        Scope type. Always `user` for this scope.

        default: user

      - `UserID string`

        Tagged ID of the member the spend limit applies to.

    - `type BetaSpendLimitSeatTierScope`

      - `Type SeatTier`

        default: seat_tier

      - `SeatTier string`

    - `type BetaSpendLimitRBACGroupScope`

      - `Type RBACGroup`

        default: rbac_group

      - `RBACGroupID string`

    - `type BetaSpendLimitOrganizationServiceScope`

      - `Type OrganizationService`

        default: organization_service

      - `Service string`

    - `type BetaSpendLimitOrganizationScope`

      - `Type Organization`

        default: organization

    - `type BetaSpendLimitWorkspaceScope`

      Scope selecting one workspace of a Claude Console organization.

      - `Type Workspace`

        Scope type. Always `workspace` for this scope.

        default: workspace

      - `WorkspaceID string`

        Tagged ID of the workspace the spend limit applies to.

    - `type BetaSpendLimitUsageTierScope`

      Scope of the monthly spend cap Anthropic sets for a Claude Console
      organization from its usage tier, or a higher cap Anthropic granted the
      organization. Read-only; its `created_at` and `updated_at` are the
      organization's creation time, so `amount` can change while `updated_at` stays
      the same.

      - `Type UsageTier`

        Scope type. Always `usage_tier` for this scope.

        default: usage_tier

  - `Source BetaSpendSummarySourceUnion`

    - `type BetaSpendLimitUserScope`

      Scope selecting a single member of the organization.

    - `type BetaSpendLimitSeatTierScope`

    - `type BetaSpendLimitRBACGroupScope`

    - `type BetaSpendLimitOrganizationServiceScope`

    - `type BetaSpendLimitOrganizationScope`

    - `type BetaSpendLimitWorkspaceScope`

      Scope selecting one workspace of a Claude Console organization.

    - `type BetaSpendLimitUsageTierScope`

      Scope of the monthly spend cap Anthropic sets for a Claude Console
      organization from its usage tier, or a higher cap Anthropic granted the
      organization. Read-only; its `created_at` and `updated_at` are the
      organization's creation time, so `amount` can change while `updated_at` stays
      the same.

  - `SpendLimitID string`

#### 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"),
	)
	page, err := client.Beta.Organization.SpendLimits.Effective.List(context.TODO(), anthropic.BetaOrganizationSpendLimitEffectiveListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "actor": {
        "deleted": true,
        "email_address": "email_address",
        "name": "name",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "amount": "50000",
      "currency": "USD",
      "period": "daily",
      "period_to_date_spend": "12050.5",
      "scope": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "source": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "spend_limit_id": "spend_limit_id"
    }
  ],
  "next_page": "next_page"
}
```

## Beta › Organization › Spend Limits › Increase Requests

### List Spend Limit Increase Requests

`client.Beta.Organization.SpendLimits.IncreaseRequests.List(ctx, query) (*PageCursor[BetaSpendLimitIncreaseRequest], error)`

**GET** `/v1/organizations/spend_limit_increase_requests`

List spend limit increase requests, most recent first.

Pending requests include a live `spend_summary` for the requester.
Requests whose requester is no longer a member are excluded.

#### Parameters

- `query BetaOrganizationSpendLimitIncreaseRequestListParams`

  - `ActorIDs []string Optional` (query parameter)

    Filter by requester, as `user_...` tagged IDs.

  - `Limit param.Opt[int64] Optional` (query parameter)

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`.

  - `Status []BetaSpendLimitIncreaseRequestStatus Optional` (query parameter)

    Filter by status. Omit to return all.

    - `const BetaSpendLimitIncreaseRequestStatusApproved BetaSpendLimitIncreaseRequestStatus = "approved"`

    - `const BetaSpendLimitIncreaseRequestStatusDenied BetaSpendLimitIncreaseRequestStatus = "denied"`

    - `const BetaSpendLimitIncreaseRequestStatusPending BetaSpendLimitIncreaseRequestStatus = "pending"`

#### Returns

- `type BetaSpendLimitIncreaseRequest`

  - `Type SpendLimitIncreaseRequest`

    default: spend_limit_increase_request

  - `ID string`

  - `Actor BetaSpendLimitIncreaseRequestActorUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

      - `Type UserActor`

        Actor type. Always `user_actor`.

        default: user_actor

      - `Deleted bool`

        True only when the underlying account has been deleted.

        default: false

      - `EmailAddress string`

        The user's email address. Null when the account is unavailable or has been deleted.

      - `Name string`

        The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

      - `UserID string`

        Tagged ID of the user.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

      - `Type ScopedAPIKeyActor`

        default: scoped_api_key_actor

      - `ScopedAPIKeyID string`

  - `CreatedAt Time`

    format: date-time

  - `Period BetaSpendLimitPeriod`

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `ResolvedAt Time`

    format: date-time

  - `ResolvedBy BetaSpendLimitIncreaseRequestResolvedByUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

  - `SpendSummary BetaSpendSummary`

    Per-member effective-limit report row (`GET /spend_limits/effective`).

    - `Actor BetaSpendSummaryActorUnion`

      - `type BetaSpendLimitUserActor`

        A user within the organization. `name` and `email_address` are
        null when the underlying account is unavailable or has been deleted;
        `deleted` is true only for deleted accounts.

      - `type BetaSpendLimitScopedAPIKeyActor`

        A scoped Admin API key acting on behalf of the organization.

    - `Amount string`

      Effective limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD). `null` means no limit applies for this row's `period` — each period resolves independently, so another period may still cap this member.

    - `Currency string`

      ISO 4217 code of the organization's billing currency; the unit for `amount` and `period_to_date_spend`.

    - `Period BetaSpendLimitPeriod`

      Period this row's effective limit and spend are reported for.

    - `PeriodToDateSpend string`

      The member's spend so far in the current period, as a non-negative decimal string in the minor unit of `currency` (cents for USD). May carry fractional minor units up to three decimal places (e.g. `"12050.5"`) — metered usage is not rounded to whole cents. Reads as `"0"` when the spend reading is temporarily unavailable.

    - `Scope BetaSpendSummaryScopeUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

        - `Type User`

          Scope type. Always `user` for this scope.

          default: user

        - `UserID string`

          Tagged ID of the member the spend limit applies to.

      - `type BetaSpendLimitSeatTierScope`

        - `Type SeatTier`

          default: seat_tier

        - `SeatTier string`

      - `type BetaSpendLimitRBACGroupScope`

        - `Type RBACGroup`

          default: rbac_group

        - `RBACGroupID string`

      - `type BetaSpendLimitOrganizationServiceScope`

        - `Type OrganizationService`

          default: organization_service

        - `Service string`

      - `type BetaSpendLimitOrganizationScope`

        - `Type Organization`

          default: organization

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

        - `Type Workspace`

          Scope type. Always `workspace` for this scope.

          default: workspace

        - `WorkspaceID string`

          Tagged ID of the workspace the spend limit applies to.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

        - `Type UsageTier`

          Scope type. Always `usage_tier` for this scope.

          default: usage_tier

    - `Source BetaSpendSummarySourceUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

      - `type BetaSpendLimitSeatTierScope`

      - `type BetaSpendLimitRBACGroupScope`

      - `type BetaSpendLimitOrganizationServiceScope`

      - `type BetaSpendLimitOrganizationScope`

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

    - `SpendLimitID string`

  - `Status BetaSpendLimitIncreaseRequestStatus`

    - `const BetaSpendLimitIncreaseRequestStatusApproved BetaSpendLimitIncreaseRequestStatus = "approved"`

    - `const BetaSpendLimitIncreaseRequestStatusDenied BetaSpendLimitIncreaseRequestStatus = "denied"`

    - `const BetaSpendLimitIncreaseRequestStatusPending BetaSpendLimitIncreaseRequestStatus = "pending"`

#### 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"),
	)
	page, err := client.Beta.Organization.SpendLimits.IncreaseRequests.List(context.TODO(), anthropic.BetaOrganizationSpendLimitIncreaseRequestListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "actor": {
        "deleted": true,
        "email_address": "email_address",
        "name": "name",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "created_at": "2019-12-27T18:11:19.117Z",
      "period": "daily",
      "resolved_at": "2019-12-27T18:11:19.117Z",
      "resolved_by": {
        "deleted": true,
        "email_address": "email_address",
        "name": "name",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "spend_summary": {
        "actor": {
          "deleted": true,
          "email_address": "email_address",
          "name": "name",
          "type": "user_actor",
          "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
        },
        "amount": "50000",
        "currency": "USD",
        "period": "daily",
        "period_to_date_spend": "12050.5",
        "scope": {
          "type": "user",
          "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
        },
        "source": {
          "type": "user",
          "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
        },
        "spend_limit_id": "spend_limit_id"
      },
      "status": "approved",
      "type": "spend_limit_increase_request"
    }
  ],
  "next_page": "next_page"
}
```

### Get Spend Limit Increase Request

`client.Beta.Organization.SpendLimits.IncreaseRequests.Get(ctx, spendLimitIncreaseRequestID) (*BetaSpendLimitIncreaseRequest, error)`

**GET** `/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}`

Retrieve a spend limit increase request.

While `pending`, the response includes a live `spend_summary` for the
requester at the request's period.

#### Parameters

- `spendLimitIncreaseRequestID string` (path parameter)

  ID of the spend limit increase request.

#### Returns

- `type BetaSpendLimitIncreaseRequest`

  - `Type SpendLimitIncreaseRequest`

    default: spend_limit_increase_request

  - `ID string`

  - `Actor BetaSpendLimitIncreaseRequestActorUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

      - `Type UserActor`

        Actor type. Always `user_actor`.

        default: user_actor

      - `Deleted bool`

        True only when the underlying account has been deleted.

        default: false

      - `EmailAddress string`

        The user's email address. Null when the account is unavailable or has been deleted.

      - `Name string`

        The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

      - `UserID string`

        Tagged ID of the user.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

      - `Type ScopedAPIKeyActor`

        default: scoped_api_key_actor

      - `ScopedAPIKeyID string`

  - `CreatedAt Time`

    format: date-time

  - `Period BetaSpendLimitPeriod`

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `ResolvedAt Time`

    format: date-time

  - `ResolvedBy BetaSpendLimitIncreaseRequestResolvedByUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

  - `SpendSummary BetaSpendSummary`

    Per-member effective-limit report row (`GET /spend_limits/effective`).

    - `Actor BetaSpendSummaryActorUnion`

      - `type BetaSpendLimitUserActor`

        A user within the organization. `name` and `email_address` are
        null when the underlying account is unavailable or has been deleted;
        `deleted` is true only for deleted accounts.

      - `type BetaSpendLimitScopedAPIKeyActor`

        A scoped Admin API key acting on behalf of the organization.

    - `Amount string`

      Effective limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD). `null` means no limit applies for this row's `period` — each period resolves independently, so another period may still cap this member.

    - `Currency string`

      ISO 4217 code of the organization's billing currency; the unit for `amount` and `period_to_date_spend`.

    - `Period BetaSpendLimitPeriod`

      Period this row's effective limit and spend are reported for.

    - `PeriodToDateSpend string`

      The member's spend so far in the current period, as a non-negative decimal string in the minor unit of `currency` (cents for USD). May carry fractional minor units up to three decimal places (e.g. `"12050.5"`) — metered usage is not rounded to whole cents. Reads as `"0"` when the spend reading is temporarily unavailable.

    - `Scope BetaSpendSummaryScopeUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

        - `Type User`

          Scope type. Always `user` for this scope.

          default: user

        - `UserID string`

          Tagged ID of the member the spend limit applies to.

      - `type BetaSpendLimitSeatTierScope`

        - `Type SeatTier`

          default: seat_tier

        - `SeatTier string`

      - `type BetaSpendLimitRBACGroupScope`

        - `Type RBACGroup`

          default: rbac_group

        - `RBACGroupID string`

      - `type BetaSpendLimitOrganizationServiceScope`

        - `Type OrganizationService`

          default: organization_service

        - `Service string`

      - `type BetaSpendLimitOrganizationScope`

        - `Type Organization`

          default: organization

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

        - `Type Workspace`

          Scope type. Always `workspace` for this scope.

          default: workspace

        - `WorkspaceID string`

          Tagged ID of the workspace the spend limit applies to.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

        - `Type UsageTier`

          Scope type. Always `usage_tier` for this scope.

          default: usage_tier

    - `Source BetaSpendSummarySourceUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

      - `type BetaSpendLimitSeatTierScope`

      - `type BetaSpendLimitRBACGroupScope`

      - `type BetaSpendLimitOrganizationServiceScope`

      - `type BetaSpendLimitOrganizationScope`

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

    - `SpendLimitID string`

  - `Status BetaSpendLimitIncreaseRequestStatus`

    - `const BetaSpendLimitIncreaseRequestStatusApproved BetaSpendLimitIncreaseRequestStatus = "approved"`

    - `const BetaSpendLimitIncreaseRequestStatusDenied BetaSpendLimitIncreaseRequestStatus = "denied"`

    - `const BetaSpendLimitIncreaseRequestStatusPending BetaSpendLimitIncreaseRequestStatus = "pending"`

#### 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"),
	)
	betaSpendLimitIncreaseRequest, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Get(context.TODO(), "spend_limit_increase_request_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSpendLimitIncreaseRequest.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "actor": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "period": "daily",
  "resolved_at": "2019-12-27T18:11:19.117Z",
  "resolved_by": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "spend_summary": {
    "actor": {
      "deleted": true,
      "email_address": "email_address",
      "name": "name",
      "type": "user_actor",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "amount": "50000",
    "currency": "USD",
    "period": "daily",
    "period_to_date_spend": "12050.5",
    "scope": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "source": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "spend_limit_id": "spend_limit_id"
  },
  "status": "approved",
  "type": "spend_limit_increase_request"
}
```

### Approve Spend Limit Increase Request

`client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(ctx, spendLimitIncreaseRequestID, body) (*BetaOrganizationSpendLimitIncreaseRequestApproveResponse, error)`

**POST** `/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve`

Approve a pending spend limit increase request.

Writes a per-user spend limit at `amount` for the requester and
transitions the request to `approved`. `period` defaults to the period
the member was blocked on. Anthropic emails the requester unless
`suppress_notification` is set.

#### Parameters

- `spendLimitIncreaseRequestID string` (path parameter)

  ID of the spend limit increase request.

- `body BetaOrganizationSpendLimitIncreaseRequestApproveParams`

  - `Amount string`

    New per-user spend limit as a non-negative integer decimal string (minor units).

  - `Period BetaSpendLimitPeriod Optional`

  - `SuppressNotification param.Opt[bool] Optional`

#### Returns

- `type BetaOrganizationSpendLimitIncreaseRequestApproveResponse`

  - `Type SpendLimitIncreaseRequest`

    default: spend_limit_increase_request

  - `ID string`

  - `Actor BetaOrganizationSpendLimitIncreaseRequestApproveResponseActorUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

      - `Type UserActor`

        Actor type. Always `user_actor`.

        default: user_actor

      - `Deleted bool`

        True only when the underlying account has been deleted.

        default: false

      - `EmailAddress string`

        The user's email address. Null when the account is unavailable or has been deleted.

      - `Name string`

        The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

      - `UserID string`

        Tagged ID of the user.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

      - `Type ScopedAPIKeyActor`

        default: scoped_api_key_actor

      - `ScopedAPIKeyID string`

  - `CreatedAt Time`

    format: date-time

  - `Period BetaSpendLimitPeriod`

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `ResolvedAt Time`

    format: date-time

  - `ResolvedBy BetaOrganizationSpendLimitIncreaseRequestApproveResponseResolvedByUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

  - `SpendLimit BetaSpendLimit`

    A configured spend limit: a cap on metered spend for one scope and period.

    - `Type SpendLimit`

      Object type. Always `spend_limit`.

      default: spend_limit

    - `ID string`

      Unique tagged ID of the spend limit (`spl_...`).

    - `Amount string`

      Limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD): "50000" is $500.00. `null` means no numeric cap is configured at this scope — see the effective report for whether a limit applies.

    - `CreatedAt Time`

      RFC 3339 datetime at which the spend limit was created.

      format: date-time

    - `Currency string`

      ISO 4217 code of the organization's billing currency; the unit for `amount`.

    - `IsEnabled bool`

      Read-only. `false` when extra usage is switched off for this organization (`organization` limit); `amount` is kept and applies again when it's switched back on. Always `true` for other limits.

    - `Period BetaSpendLimitPeriod`

      Length of the window the limit resets over. `amount` caps spend within each period.

    - `Scope BetaSpendLimitScopeUnion`

      What the limit applies to. A tagged union on `type`; each variant carries the identifier for its scope.

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

        - `Type User`

          Scope type. Always `user` for this scope.

          default: user

        - `UserID string`

          Tagged ID of the member the spend limit applies to.

      - `type BetaSpendLimitSeatTierScope`

        - `Type SeatTier`

          default: seat_tier

        - `SeatTier string`

      - `type BetaSpendLimitRBACGroupScope`

        - `Type RBACGroup`

          default: rbac_group

        - `RBACGroupID string`

      - `type BetaSpendLimitOrganizationServiceScope`

        - `Type OrganizationService`

          default: organization_service

        - `Service string`

      - `type BetaSpendLimitOrganizationScope`

        - `Type Organization`

          default: organization

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

        - `Type Workspace`

          Scope type. Always `workspace` for this scope.

          default: workspace

        - `WorkspaceID string`

          Tagged ID of the workspace the spend limit applies to.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

        - `Type UsageTier`

          Scope type. Always `usage_tier` for this scope.

          default: usage_tier

    - `UpdatedAt Time`

      RFC 3339 datetime at which the spend limit was last modified.

      format: date-time

  - `SpendSummary BetaSpendSummary`

    Per-member effective-limit report row (`GET /spend_limits/effective`).

    - `Actor BetaSpendSummaryActorUnion`

      - `type BetaSpendLimitUserActor`

        A user within the organization. `name` and `email_address` are
        null when the underlying account is unavailable or has been deleted;
        `deleted` is true only for deleted accounts.

      - `type BetaSpendLimitScopedAPIKeyActor`

        A scoped Admin API key acting on behalf of the organization.

    - `Amount string`

      Effective limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD). `null` means no limit applies for this row's `period` — each period resolves independently, so another period may still cap this member.

    - `Currency string`

      ISO 4217 code of the organization's billing currency; the unit for `amount` and `period_to_date_spend`.

    - `Period BetaSpendLimitPeriod`

      Period this row's effective limit and spend are reported for.

    - `PeriodToDateSpend string`

      The member's spend so far in the current period, as a non-negative decimal string in the minor unit of `currency` (cents for USD). May carry fractional minor units up to three decimal places (e.g. `"12050.5"`) — metered usage is not rounded to whole cents. Reads as `"0"` when the spend reading is temporarily unavailable.

    - `Scope BetaSpendSummaryScopeUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

      - `type BetaSpendLimitSeatTierScope`

      - `type BetaSpendLimitRBACGroupScope`

      - `type BetaSpendLimitOrganizationServiceScope`

      - `type BetaSpendLimitOrganizationScope`

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

    - `Source BetaSpendSummarySourceUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

      - `type BetaSpendLimitSeatTierScope`

      - `type BetaSpendLimitRBACGroupScope`

      - `type BetaSpendLimitOrganizationServiceScope`

      - `type BetaSpendLimitOrganizationScope`

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

    - `SpendLimitID string`

  - `Status BetaSpendLimitIncreaseRequestStatus`

    - `const BetaSpendLimitIncreaseRequestStatusApproved BetaSpendLimitIncreaseRequestStatus = "approved"`

    - `const BetaSpendLimitIncreaseRequestStatusDenied BetaSpendLimitIncreaseRequestStatus = "denied"`

    - `const BetaSpendLimitIncreaseRequestStatusPending BetaSpendLimitIncreaseRequestStatus = "pending"`

#### 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"),
	)
	response, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(
		context.TODO(),
		"spend_limit_increase_request_id",
		anthropic.BetaOrganizationSpendLimitIncreaseRequestApproveParams{
			Amount: "50000",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "actor": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "period": "daily",
  "resolved_at": "2019-12-27T18:11:19.117Z",
  "resolved_by": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "spend_limit": {
    "id": "id",
    "amount": "50000",
    "created_at": "2019-12-27T18:11:19.117Z",
    "currency": "USD",
    "is_enabled": true,
    "period": "daily",
    "scope": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "type": "spend_limit",
    "updated_at": "2019-12-27T18:11:19.117Z"
  },
  "spend_summary": {
    "actor": {
      "deleted": true,
      "email_address": "email_address",
      "name": "name",
      "type": "user_actor",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "amount": "50000",
    "currency": "USD",
    "period": "daily",
    "period_to_date_spend": "12050.5",
    "scope": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "source": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "spend_limit_id": "spend_limit_id"
  },
  "status": "approved",
  "type": "spend_limit_increase_request"
}
```

### Deny Spend Limit Increase Request

`client.Beta.Organization.SpendLimits.IncreaseRequests.Deny(ctx, spendLimitIncreaseRequestID, body) (*BetaSpendLimitIncreaseRequest, error)`

**POST** `/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/deny`

Deny a pending spend limit increase request.

Idempotent on `denied`; denying an already-`approved` request returns
400. Anthropic emails the requester unless `suppress_notification` is set.

#### Parameters

- `spendLimitIncreaseRequestID string` (path parameter)

  ID of the spend limit increase request.

- `body BetaOrganizationSpendLimitIncreaseRequestDenyParams`

  - `SuppressNotification param.Opt[bool] Optional`

#### Returns

- `type BetaSpendLimitIncreaseRequest`

  - `Type SpendLimitIncreaseRequest`

    default: spend_limit_increase_request

  - `ID string`

  - `Actor BetaSpendLimitIncreaseRequestActorUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

      - `Type UserActor`

        Actor type. Always `user_actor`.

        default: user_actor

      - `Deleted bool`

        True only when the underlying account has been deleted.

        default: false

      - `EmailAddress string`

        The user's email address. Null when the account is unavailable or has been deleted.

      - `Name string`

        The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

      - `UserID string`

        Tagged ID of the user.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

      - `Type ScopedAPIKeyActor`

        default: scoped_api_key_actor

      - `ScopedAPIKeyID string`

  - `CreatedAt Time`

    format: date-time

  - `Period BetaSpendLimitPeriod`

    - `const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"`

    - `const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"`

    - `const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"`

  - `ResolvedAt Time`

    format: date-time

  - `ResolvedBy BetaSpendLimitIncreaseRequestResolvedByUnion`

    - `type BetaSpendLimitUserActor`

      A user within the organization. `name` and `email_address` are
      null when the underlying account is unavailable or has been deleted;
      `deleted` is true only for deleted accounts.

    - `type BetaSpendLimitScopedAPIKeyActor`

      A scoped Admin API key acting on behalf of the organization.

  - `SpendSummary BetaSpendSummary`

    Per-member effective-limit report row (`GET /spend_limits/effective`).

    - `Actor BetaSpendSummaryActorUnion`

      - `type BetaSpendLimitUserActor`

        A user within the organization. `name` and `email_address` are
        null when the underlying account is unavailable or has been deleted;
        `deleted` is true only for deleted accounts.

      - `type BetaSpendLimitScopedAPIKeyActor`

        A scoped Admin API key acting on behalf of the organization.

    - `Amount string`

      Effective limit amount as a non-negative integer decimal string in the minor unit of `currency` (cents for USD). `null` means no limit applies for this row's `period` — each period resolves independently, so another period may still cap this member.

    - `Currency string`

      ISO 4217 code of the organization's billing currency; the unit for `amount` and `period_to_date_spend`.

    - `Period BetaSpendLimitPeriod`

      Period this row's effective limit and spend are reported for.

    - `PeriodToDateSpend string`

      The member's spend so far in the current period, as a non-negative decimal string in the minor unit of `currency` (cents for USD). May carry fractional minor units up to three decimal places (e.g. `"12050.5"`) — metered usage is not rounded to whole cents. Reads as `"0"` when the spend reading is temporarily unavailable.

    - `Scope BetaSpendSummaryScopeUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

        - `Type User`

          Scope type. Always `user` for this scope.

          default: user

        - `UserID string`

          Tagged ID of the member the spend limit applies to.

      - `type BetaSpendLimitSeatTierScope`

        - `Type SeatTier`

          default: seat_tier

        - `SeatTier string`

      - `type BetaSpendLimitRBACGroupScope`

        - `Type RBACGroup`

          default: rbac_group

        - `RBACGroupID string`

      - `type BetaSpendLimitOrganizationServiceScope`

        - `Type OrganizationService`

          default: organization_service

        - `Service string`

      - `type BetaSpendLimitOrganizationScope`

        - `Type Organization`

          default: organization

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

        - `Type Workspace`

          Scope type. Always `workspace` for this scope.

          default: workspace

        - `WorkspaceID string`

          Tagged ID of the workspace the spend limit applies to.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

        - `Type UsageTier`

          Scope type. Always `usage_tier` for this scope.

          default: usage_tier

    - `Source BetaSpendSummarySourceUnion`

      - `type BetaSpendLimitUserScope`

        Scope selecting a single member of the organization.

      - `type BetaSpendLimitSeatTierScope`

      - `type BetaSpendLimitRBACGroupScope`

      - `type BetaSpendLimitOrganizationServiceScope`

      - `type BetaSpendLimitOrganizationScope`

      - `type BetaSpendLimitWorkspaceScope`

        Scope selecting one workspace of a Claude Console organization.

      - `type BetaSpendLimitUsageTierScope`

        Scope of the monthly spend cap Anthropic sets for a Claude Console
        organization from its usage tier, or a higher cap Anthropic granted the
        organization. Read-only; its `created_at` and `updated_at` are the
        organization's creation time, so `amount` can change while `updated_at` stays
        the same.

    - `SpendLimitID string`

  - `Status BetaSpendLimitIncreaseRequestStatus`

    - `const BetaSpendLimitIncreaseRequestStatusApproved BetaSpendLimitIncreaseRequestStatus = "approved"`

    - `const BetaSpendLimitIncreaseRequestStatusDenied BetaSpendLimitIncreaseRequestStatus = "denied"`

    - `const BetaSpendLimitIncreaseRequestStatusPending BetaSpendLimitIncreaseRequestStatus = "pending"`

#### 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"),
	)
	betaSpendLimitIncreaseRequest, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Deny(
		context.TODO(),
		"spend_limit_increase_request_id",
		anthropic.BetaOrganizationSpendLimitIncreaseRequestDenyParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaSpendLimitIncreaseRequest.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "actor": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "period": "daily",
  "resolved_at": "2019-12-27T18:11:19.117Z",
  "resolved_by": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "spend_summary": {
    "actor": {
      "deleted": true,
      "email_address": "email_address",
      "name": "name",
      "type": "user_actor",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "amount": "50000",
    "currency": "USD",
    "period": "daily",
    "period_to_date_spend": "12050.5",
    "scope": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "source": {
      "type": "user",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "spend_limit_id": "spend_limit_id"
  },
  "status": "approved",
  "type": "spend_limit_increase_request"
}
```

## Beta › Organization › RBAC Groups

### Create RBAC Group

`client.Beta.Organization.RBACGroups.New(ctx, body) (*BetaRBACGroup, error)`

**POST** `/v1/organizations/rbac_groups`

Create an RBAC Group in the Claude Enterprise tenant. Groups created via the API have source type `"direct"`.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `body BetaOrganizationRBACGroupNewParams`

  - `Name string`

    Name of the RBAC Group. Not uniqueness-enforced.

    minLength: 1, maxLength: 255

#### Returns

- `type BetaRBACGroup`

  - `Type RBACGroup`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

    default: rbac_group

  - `ID string`

    ID of the RBAC Group.

  - `CreatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was created.

    format: date-time

  - `Name string`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `RoleIDs []string`

    RBAC Role IDs attached to this RBAC Group. Role attachment is managed in the admin settings and is read-only on this API. `null` means role data was temporarily unavailable — retry to distinguish from an empty list.

  - `SourceType BetaRBACGroupSourceType`

    How the RBAC Group was created: `"direct"` for groups created directly (for example, in the organization's admin settings), `"scim"` for groups provisioned by the identity provider.

    - `const BetaRBACGroupSourceTypeDirect BetaRBACGroupSourceType = "direct"`

    - `const BetaRBACGroupSourceTypeSCIM BetaRBACGroupSourceType = "scim"`

  - `UpdatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was last updated.

    format: date-time

#### 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"),
	)
	betaRBACGroup, err := client.Beta.Organization.RBACGroups.New(context.TODO(), anthropic.BetaOrganizationRBACGroupNewParams{
		Name: "Engineering",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaRBACGroup.ID)
}
```

##### Response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "name": "Engineering",
  "role_ids": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "roles": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "source_type": "direct",
  "type": "rbac_group",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### List RBAC Groups

`client.Beta.Organization.RBACGroups.List(ctx, query) (*PageCursor[BetaRBACGroup], error)`

**GET** `/v1/organizations/rbac_groups`

List RBAC Groups in the Claude Enterprise tenant.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `query BetaOrganizationRBACGroupListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

#### Returns

- `type BetaRBACGroup`

  - `Type RBACGroup`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

    default: rbac_group

  - `ID string`

    ID of the RBAC Group.

  - `CreatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was created.

    format: date-time

  - `Name string`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `RoleIDs []string`

    RBAC Role IDs attached to this RBAC Group. Role attachment is managed in the admin settings and is read-only on this API. `null` means role data was temporarily unavailable — retry to distinguish from an empty list.

  - `SourceType BetaRBACGroupSourceType`

    How the RBAC Group was created: `"direct"` for groups created directly (for example, in the organization's admin settings), `"scim"` for groups provisioned by the identity provider.

    - `const BetaRBACGroupSourceTypeDirect BetaRBACGroupSourceType = "direct"`

    - `const BetaRBACGroupSourceTypeSCIM BetaRBACGroupSourceType = "scim"`

  - `UpdatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was last updated.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Organization.RBACGroups.List(context.TODO(), anthropic.BetaOrganizationRBACGroupListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "name": "Engineering",
      "role_ids": [
        "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
      ],
      "roles": [
        "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
      ],
      "source_type": "direct",
      "type": "rbac_group",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "has_more": false,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9"
}
```

### Get RBAC Group

`client.Beta.Organization.RBACGroups.Get(ctx, rbacGroupID) (*BetaRBACGroup, error)`

**GET** `/v1/organizations/rbac_groups/{rbac_group_id}`

Retrieve an RBAC Group by ID.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacGroupID string` (path parameter)

  ID of the RBAC Group.

#### Returns

- `type BetaRBACGroup`

  - `Type RBACGroup`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

    default: rbac_group

  - `ID string`

    ID of the RBAC Group.

  - `CreatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was created.

    format: date-time

  - `Name string`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `RoleIDs []string`

    RBAC Role IDs attached to this RBAC Group. Role attachment is managed in the admin settings and is read-only on this API. `null` means role data was temporarily unavailable — retry to distinguish from an empty list.

  - `SourceType BetaRBACGroupSourceType`

    How the RBAC Group was created: `"direct"` for groups created directly (for example, in the organization's admin settings), `"scim"` for groups provisioned by the identity provider.

    - `const BetaRBACGroupSourceTypeDirect BetaRBACGroupSourceType = "direct"`

    - `const BetaRBACGroupSourceTypeSCIM BetaRBACGroupSourceType = "scim"`

  - `UpdatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was last updated.

    format: date-time

#### 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"),
	)
	betaRBACGroup, err := client.Beta.Organization.RBACGroups.Get(context.TODO(), "rbac_group_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaRBACGroup.ID)
}
```

##### Response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "name": "Engineering",
  "role_ids": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "roles": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "source_type": "direct",
  "type": "rbac_group",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Update RBAC Group

`client.Beta.Organization.RBACGroups.Update(ctx, rbacGroupID, body) (*BetaRBACGroup, error)`

**POST** `/v1/organizations/rbac_groups/{rbac_group_id}`

Update an RBAC Group's name. Groups provisioned by an identity provider (source type `"scim"`) cannot be modified via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacGroupID string` (path parameter)

  ID of the RBAC Group.

- `body BetaOrganizationRBACGroupUpdateParams`

  - `Name param.Opt[string] Optional`

    Name of the RBAC Group. Not uniqueness-enforced.

    minLength: 1, maxLength: 255

#### Returns

- `type BetaRBACGroup`

  - `Type RBACGroup`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

    default: rbac_group

  - `ID string`

    ID of the RBAC Group.

  - `CreatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was created.

    format: date-time

  - `Name string`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `RoleIDs []string`

    RBAC Role IDs attached to this RBAC Group. Role attachment is managed in the admin settings and is read-only on this API. `null` means role data was temporarily unavailable — retry to distinguish from an empty list.

  - `SourceType BetaRBACGroupSourceType`

    How the RBAC Group was created: `"direct"` for groups created directly (for example, in the organization's admin settings), `"scim"` for groups provisioned by the identity provider.

    - `const BetaRBACGroupSourceTypeDirect BetaRBACGroupSourceType = "direct"`

    - `const BetaRBACGroupSourceTypeSCIM BetaRBACGroupSourceType = "scim"`

  - `UpdatedAt Time`

    RFC 3339 timestamp of when the RBAC Group was last updated.

    format: date-time

#### 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"),
	)
	betaRBACGroup, err := client.Beta.Organization.RBACGroups.Update(
		context.TODO(),
		"rbac_group_id",
		anthropic.BetaOrganizationRBACGroupUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaRBACGroup.ID)
}
```

##### Response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "name": "Engineering",
  "role_ids": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "roles": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "source_type": "direct",
  "type": "rbac_group",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Delete RBAC Group

`client.Beta.Organization.RBACGroups.Delete(ctx, rbacGroupID) (*BetaOrganizationRBACGroupDeleteResponse, error)`

**DELETE** `/v1/organizations/rbac_groups/{rbac_group_id}`

Delete an RBAC Group. Groups provisioned by an identity provider (source type `"scim"`) cannot be deleted via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacGroupID string` (path parameter)

  ID of the RBAC Group.

#### Returns

- `type BetaOrganizationRBACGroupDeleteResponse`

  - `Type RBACGroupDeleted`

    Deleted object type.

    For RBAC Groups, this is always `"rbac_group_deleted"`.

    default: rbac_group_deleted

  - `ID string`

    ID of the RBAC Group.

#### 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"),
	)
	rbacGroup, err := client.Beta.Organization.RBACGroups.Delete(context.TODO(), "rbac_group_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", rbacGroup.ID)
}
```

##### Response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "type": "rbac_group_deleted"
}
```

## Beta › Organization › RBAC Groups › Members

### List RBAC Group Members

`client.Beta.Organization.RBACGroups.Members.List(ctx, rbacGroupID, query) (*PageCursor[BetaRBACGroupMember], error)`

**GET** `/v1/organizations/rbac_groups/{rbac_group_id}/members`

List members of an RBAC Group.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacGroupID string` (path parameter)

  ID of the RBAC Group.

- `query BetaOrganizationRBACGroupMemberListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

#### Returns

- `type BetaRBACGroupMember`

  - `Type RBACGroupMember`

    Object type.

    For RBAC Group Members, this is always `"rbac_group_member"`.

    default: rbac_group_member

  - `CreatedAt Time`

    RFC 3339 timestamp of when the User was added to the RBAC Group.

    format: date-time

  - `Email string`

    Email of the User.

  - `RBACGroupID string`

    ID of the RBAC Group.

  - `UserID string`

    ID of the User.

#### 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"),
	)
	page, err := client.Beta.Organization.RBACGroups.Members.List(
		context.TODO(),
		"rbac_group_id",
		anthropic.BetaOrganizationRBACGroupMemberListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "created_at": "2024-10-30T23:58:27.427722Z",
      "email": "user@emaildomain.com",
      "group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "type": "rbac_group_member",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
    }
  ],
  "has_more": false,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9"
}
```

### Add RBAC Group Member

`client.Beta.Organization.RBACGroups.Members.Add(ctx, rbacGroupID, body) (*BetaRBACGroupMember, error)`

**POST** `/v1/organizations/rbac_groups/{rbac_group_id}/members`

Add a User to an RBAC Group. Membership of groups provisioned by an identity provider (source type `"scim"`) cannot be modified via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacGroupID string` (path parameter)

  ID of the RBAC Group.

- `body BetaOrganizationRBACGroupMemberAddParams`

  - `UserID string`

    ID of the User.

#### Returns

- `type BetaRBACGroupMember`

  - `Type RBACGroupMember`

    Object type.

    For RBAC Group Members, this is always `"rbac_group_member"`.

    default: rbac_group_member

  - `CreatedAt Time`

    RFC 3339 timestamp of when the User was added to the RBAC Group.

    format: date-time

  - `Email string`

    Email of the User.

  - `RBACGroupID string`

    ID of the RBAC Group.

  - `UserID string`

    ID of the User.

#### 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"),
	)
	betaRBACGroupMember, err := client.Beta.Organization.RBACGroups.Members.Add(
		context.TODO(),
		"rbac_group_id",
		anthropic.BetaOrganizationRBACGroupMemberAddParams{
			UserID: "user_01WCz1FkmYMm4gnmykNKUu3Q",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaRBACGroupMember.RBACGroupID)
}
```

##### Response (200)

```json
{
  "created_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "type": "rbac_group_member",
  "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
}
```

### Remove RBAC Group Member

`client.Beta.Organization.RBACGroups.Members.Remove(ctx, userID, body) (*BetaOrganizationRBACGroupMemberRemoveResponse, error)`

**DELETE** `/v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id}`

Remove a User from an RBAC Group. Membership of groups provisioned by an identity provider (source type `"scim"`) cannot be modified via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups API is available to Claude Enterprise organizations only.

#### Parameters

- `userID string` (path parameter)

  ID of the User.

- `body BetaOrganizationRBACGroupMemberRemoveParams`

  - `RBACGroupID string` (path parameter)

    ID of the RBAC Group.

#### Returns

- `type BetaOrganizationRBACGroupMemberRemoveResponse`

  - `Type RBACGroupMemberDeleted`

    Deleted object type. For RBAC Group Members, this is always `"rbac_group_member_deleted"`.

    default: rbac_group_member_deleted

  - `RBACGroupID string`

    ID of the RBAC Group.

  - `UserID string`

    ID of the User.

#### 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"),
	)
	member, err := client.Beta.Organization.RBACGroups.Members.Remove(
		context.TODO(),
		"user_id",
		anthropic.BetaOrganizationRBACGroupMemberRemoveParams{
			RBACGroupID: "rbac_group_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", member.RBACGroupID)
}
```

##### Response (200)

```json
{
  "group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "type": "rbac_group_member_deleted",
  "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
}
```

## Beta › Organization › RBAC Roles

### List RBAC Roles

`client.Beta.Organization.RBACRoles.List(ctx, query) (*PageCursor[BetaRBACRole], error)`

**GET** `/v1/organizations/rbac_roles`

List RBAC Roles in the organization.

The RBAC Roles API is available to Claude Enterprise organizations only.

#### Parameters

- `query BetaOrganizationRBACRoleListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

#### Returns

- `type BetaRBACRole`

  - `Type RBACRole`

    Object type.

    For RBAC Roles, this is always `"rbac_role"`.

    default: rbac_role

  - `ID string`

    ID of the RBAC Role.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the RBAC Role was created.

    format: date-time

  - `DisplayName string`

    Name of the RBAC Role. For a role created by Anthropic, this name can differ from the label claude.ai shows, and Anthropic may change the name. To keep a lasting reference to a role, store its `id`.

  - `UpdatedAt Time`

    RFC 3339 datetime string indicating when the RBAC Role was last updated.

    format: date-time

  - `Name string`

    **Deprecated**: Use `display_name` instead; `name` always has the same value.

    Deprecated: use `display_name` instead. Name of the RBAC Role; always the same value as `display_name`.

#### 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"),
	)
	page, err := client.Beta.Organization.RBACRoles.List(context.TODO(), anthropic.BetaOrganizationRBACRoleListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "display_name": "Project Editor",
      "name": "Project Editor",
      "type": "rbac_role",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "has_more": true,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19yb2xlXzAxIn0"
}
```

### Get RBAC Role

`client.Beta.Organization.RBACRoles.Get(ctx, rbacRoleID) (*BetaRBACRole, error)`

**GET** `/v1/organizations/rbac_roles/{rbac_role_id}`

Retrieve an RBAC Role by ID.

The RBAC Roles API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacRoleID string` (path parameter)

  ID of the RBAC Role.

#### Returns

- `type BetaRBACRole`

  - `Type RBACRole`

    Object type.

    For RBAC Roles, this is always `"rbac_role"`.

    default: rbac_role

  - `ID string`

    ID of the RBAC Role.

  - `CreatedAt Time`

    RFC 3339 datetime string indicating when the RBAC Role was created.

    format: date-time

  - `DisplayName string`

    Name of the RBAC Role. For a role created by Anthropic, this name can differ from the label claude.ai shows, and Anthropic may change the name. To keep a lasting reference to a role, store its `id`.

  - `UpdatedAt Time`

    RFC 3339 datetime string indicating when the RBAC Role was last updated.

    format: date-time

  - `Name string`

    **Deprecated**: Use `display_name` instead; `name` always has the same value.

    Deprecated: use `display_name` instead. Name of the RBAC Role; always the same value as `display_name`.

#### 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"),
	)
	betaRBACRole, err := client.Beta.Organization.RBACRoles.Get(context.TODO(), "rbac_role_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaRBACRole.ID)
}
```

##### Response (200)

```json
{
  "id": "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "Project Editor",
  "name": "Project Editor",
  "type": "rbac_role",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

## Beta › Organization › RBAC Roles › Permissions

### List RBAC Role Permissions

`client.Beta.Organization.RBACRoles.Permissions.List(ctx, rbacRoleID, query) (*PageCursor[BetaRBACRolePermission], error)`

**GET** `/v1/organizations/rbac_roles/{rbac_role_id}/permissions`

List the permissions an RBAC Role grants.

The RBAC Roles API is available to Claude Enterprise organizations only.

#### Parameters

- `rbacRoleID string` (path parameter)

  ID of the RBAC Role.

- `query BetaOrganizationRBACRolePermissionListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

#### Returns

- `type BetaRBACRolePermission`

  - `Type RBACRolePermission`

    Object type.

    For RBAC Role Permissions, this is always `"rbac_role_permission"`.

    default: rbac_role_permission

  - `Action string`

    Action the permission grants on the resource.

    The vocabulary follows the resource: an `organization` grant carries a
    product-feature entitlement (for example `chat`), an admin-panel
    permission entitlement (`permission_*`), or a blanket capability-access
    mode — `capability_access_all` grants every product-feature entitlement,
    and `capability_access_all_ga` grants the generally-available subset as
    it stands at permission-check time; neither mode grants model-access
    entitlements. A consumer enumerating a role's per-feature grants should
    treat a blanket row as granting every product-feature entitlement it
    covers, or it will under-report the role's effective access. A `connector_tool` grant carries
    a tool-access action (`use` or `always_allow`); a `connector_scope` grant
    carries the scope action `grant` (the role may receive the named OAuth
    scope when tokens are minted for the connector); `connector` and
    `all_connectors` grants carry a tool-access action, the scope action, or
    an authentication-method action (`interactive` or `managed`).

  - `Resource BetaRBACRolePermissionResourceUnion`

    What the permission applies to.

    A tagged union: `type` names the kind of resource and determines which
    identifier fields are present.

    - `type BetaRBACOrganizationPermissionResource`

      - `Type Organization`

        Kind of resource the permission applies to.

        default: organization

      - `OrganizationID string`

        UUID of the organization the permission applies to.

    - `type BetaRBACConnectorToolPermissionResource`

      - `Type ConnectorTool`

        Kind of resource the permission applies to.

        default: connector_tool

      - `ConnectorID string`

        ID of the connector the permission applies to.

      - `ToolName string`

        Published name of the connector tool the permission applies to.

        When the published name contains characters outside `[a-zA-Z0-9_-]` (or
        collides with a reserved form), it is server-encoded into a stable
        `{prefix}_{32-hex}` form — a shortened readable prefix of the name plus
        a hash — from which the published name is not recoverable.

    - `type BetaRBACConnectorScopePermissionResource`

      - `Type ConnectorScope`

        Kind of resource the permission applies to.

        default: connector_scope

      - `ConnectorID string`

        ID of the connector the permission applies to.

      - `Scope string`

        OAuth scope the permission names — the role may receive this scope when
        tokens are minted for the connector.

        Subject to the same encoding rule as `tool_name`: a scope containing
        characters outside `[a-zA-Z0-9_-]` (or colliding with a reserved form)
        appears server-encoded in a stable `{prefix}_{32-hex}` form. OAuth
        scopes routinely contain `:` and `/`, so most appear encoded.

    - `type BetaRBACConnectorPermissionResource`

      - `Type Connector`

        Kind of resource the permission applies to.

        default: connector

      - `ConnectorID string`

        ID of the connector the permission applies to.

    - `type BetaRBACAllConnectorsPermissionResource`

      - `Type AllConnectors`

        Kind of resource the permission applies to.

        default: all_connectors

#### 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"),
	)
	page, err := client.Beta.Organization.RBACRoles.Permissions.List(
		context.TODO(),
		"rbac_role_id",
		anthropic.BetaOrganizationRBACRolePermissionListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "action": "use",
      "resource": {
        "organization_id": "3c4f5e6d-7a8b-49c0-9d1e-2f3a4b5c6d7e",
        "type": "organization"
      },
      "type": "rbac_role_permission"
    }
  ],
  "has_more": true,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19yb2xlXzAxIn0"
}
```

## Beta › Organization › Plugins

### Create Plugin

`client.Beta.Organization.Plugins.New(ctx, params) (*BetaPlugin, error)`

**POST** `/v1/organizations/plugins`

Create an organization-owned Plugin and its first version by uploading the
version's files.

The upload is `multipart/form-data`: the version's files (`files`, each part sent
as `files[]`), with an optional `marketplace_id` and `release_notes`. The manifest's `name` becomes the
Plugin's `name`, and `display_name`, `description` and `manifest_version` come
from the manifest too.

`name` may contain lowercase letters (from any alphabet), digits, and hyphens, up
to 64 characters. Uppercase letters, spaces, underscores, and other punctuation are
rejected.

The `name` must be unique within the marketplace: a name already taken
returns a 409 with `error_code` `plugin_name_taken` and, when a Plugin holds it,
that Plugin's ID in `details.plugin_id`. A Plugin going into the organization's
library marketplace is also refused with a 409 when one of its skills has the name of
an organization skill (a skill an administrator uploaded for the whole organization
in claude.ai): `error_code` `skill_name_taken`, with that name in
`details.skill_name`; rename the skill, or remove the organization skill in
claude.ai. A 503 with `error_code`
`registration_pending` means the Plugin and its version were stored (their IDs are
in `details`) but are not yet usable in claude.ai: do not retry the create (the
retry would return `plugin_name_taken`); create a version on the stored Plugin
instead, which completes it.

For a worked example, see [Create a plugin](https://platform.claude.com/docs/en/manage-claude/plugins-api?sdk_languages=go#create-a-plugin)
in the Plugins API guide.

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `params BetaOrganizationPluginNewParams`

  - `Files []Reader`

    The version's files: one part per file, the part's filename being the file's path within the Plugin (for example `skills/review-pr/SKILL.md`), or a single `.zip` or `.plugin` archive holding them all. On the wire each part is named `files[]`, and a part named plain `files` is not read; with cURL, `-F 'files[]=@SKILL.md;filename=skills/review-pr/SKILL.md'`. The files must include the manifest, `.claude-plugin/plugin.json`.

  - `MarketplaceID param.Opt[string] Optional`

    ID of the organization-owned plugin marketplace to create the Plugin in (prefixed `marketplace_`). It must be a `manual` marketplace, one whose Plugins are uploaded rather than synchronized from a repository. When omitted, the Plugin is created in the organization's library marketplace, an organization-owned `manual` marketplace created on first use.

  - `ReleaseNotes param.Opt[string] Optional`

    Release notes stored with the version and shown in its version history in claude.ai; up to 5,000 characters.

    maxLength: 5000

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPlugin`

  - `Type Plugin`

    Always `plugin`.

    default: plugin

  - `ID string`

    The Plugin's ID.

  - `Components []BetaPluginComponent`

    What the served version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    The served version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginCreatedByUnion`

    Who created the Plugin; null when no creator is recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The served version's description.

  - `DisplayName string`

    The served version's display name.

  - `LatestVersionID string`

    The newest version.

  - `ManifestVersion string`

    The version string the served version's manifest declares.

  - `MarketplaceID string`

    The ID of the plugin marketplace the Plugin lives in.

  - `Name string`

    Lowercase identifier, unique within its plugin marketplace. Fixed for an organization-owned Plugin's lifetime; a member-owned Plugin's changes when its owner renames it in claude.ai, while its `id` stays the same.

  - `OrganizationInstallationPreference BetaPluginOrganizationInstallationPreference`

    Organization-owned Plugin: the organization-wide installation setting every member gets unless an RBAC Group they belong to holds its own — the Plugin's own setting, or its plugin marketplace's default. Null for a member-owned Plugin, which has shares instead. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginOrganizationInstallationPreferenceAutoInstall BetaPluginOrganizationInstallationPreference = "auto_install"`

    - `const BetaPluginOrganizationInstallationPreferenceAvailable BetaPluginOrganizationInstallationPreference = "available"`

    - `const BetaPluginOrganizationInstallationPreferenceNotAvailable BetaPluginOrganizationInstallationPreference = "not_available"`

    - `const BetaPluginOrganizationInstallationPreferenceRequired BetaPluginOrganizationInstallationPreference = "required"`

  - `OrganizationInstallationPreferenceInherited bool`

    Organization-owned Plugin: true while it has no organization-wide setting of its own and `organization_installation_preference` is its plugin marketplace's default. Null for a member-owned Plugin.

  - `Owner BetaPluginOwnerUnion`

    Who owns the Plugin: the organization, or the member whose personal plugin marketplace it lives in.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Reach BetaPluginReach`

    How far the served version reaches: `remote` when it declares an MCP server or a CLI, `privileged` when it declares a hook, monitor, language server or settings but nothing remote, `contained` otherwise; null when not classifiable.

    - `const BetaPluginReachContained BetaPluginReach = "contained"`

    - `const BetaPluginReachPrivileged BetaPluginReach = "privileged"`

    - `const BetaPluginReachRemote BetaPluginReach = "remote"`

  - `ServedVersionID string`

    The version claude.ai serves to members.

  - `ServedVersionPinned bool`

    False while the served version follows each new version; true once it has been pinned to one.

  - `UpdatedAt Time`

    RFC 3339. Moves on a new version and on a served-version change; a change to the Plugin's installation settings or shares does not move it.

    format: date-time

#### Example

```go
package main

import (
	"bytes"
	"context"
	"fmt"
	"io"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaPlugin, err := client.Beta.Organization.Plugins.New(context.TODO(), anthropic.BetaOrganizationPluginNewParams{
		Files: []io.Reader{io.Reader(bytes.NewBuffer([]byte("Example data")))},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPlugin.ID)
}
```

##### Response (200)

```json
{
  "id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "components": [
    {
      "description": "description",
      "name": "review-pr",
      "type": "skill"
    }
  ],
  "content_scan": {
    "assessment": "warn",
    "reason": "credential-exposure",
    "status": "completed"
  },
  "created_at": "2026-03-14T09:26:53.589793Z",
  "created_by": {
    "email_address": "user@example.com",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "description": "Reviews pull requests against your team's conventions.",
  "display_name": "Code Review Helper",
  "latest_version_id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
  "manifest_version": "1.2.0",
  "marketplace_id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
  "name": "code-review-helper",
  "organization_installation_preference": "available",
  "organization_installation_preference_inherited": true,
  "owner": {
    "type": "organization"
  },
  "reach": "contained",
  "served_version_id": "pluginver_01K9wPcHd4Rm2Tx8Vq6Ln3Sb",
  "served_version_pinned": true,
  "type": "plugin",
  "updated_at": "2026-03-14T09:26:53.589793Z"
}
```

### Get Plugin

`client.Beta.Organization.Plugins.Get(ctx, pluginID, params) (*BetaPlugin, error)`

**GET** `/v1/organizations/plugins/{plugin_id}`

Retrieve a Plugin by ID.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `params BetaOrganizationPluginGetParams`

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPlugin`

  - `Type Plugin`

    Always `plugin`.

    default: plugin

  - `ID string`

    The Plugin's ID.

  - `Components []BetaPluginComponent`

    What the served version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    The served version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginCreatedByUnion`

    Who created the Plugin; null when no creator is recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The served version's description.

  - `DisplayName string`

    The served version's display name.

  - `LatestVersionID string`

    The newest version.

  - `ManifestVersion string`

    The version string the served version's manifest declares.

  - `MarketplaceID string`

    The ID of the plugin marketplace the Plugin lives in.

  - `Name string`

    Lowercase identifier, unique within its plugin marketplace. Fixed for an organization-owned Plugin's lifetime; a member-owned Plugin's changes when its owner renames it in claude.ai, while its `id` stays the same.

  - `OrganizationInstallationPreference BetaPluginOrganizationInstallationPreference`

    Organization-owned Plugin: the organization-wide installation setting every member gets unless an RBAC Group they belong to holds its own — the Plugin's own setting, or its plugin marketplace's default. Null for a member-owned Plugin, which has shares instead. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginOrganizationInstallationPreferenceAutoInstall BetaPluginOrganizationInstallationPreference = "auto_install"`

    - `const BetaPluginOrganizationInstallationPreferenceAvailable BetaPluginOrganizationInstallationPreference = "available"`

    - `const BetaPluginOrganizationInstallationPreferenceNotAvailable BetaPluginOrganizationInstallationPreference = "not_available"`

    - `const BetaPluginOrganizationInstallationPreferenceRequired BetaPluginOrganizationInstallationPreference = "required"`

  - `OrganizationInstallationPreferenceInherited bool`

    Organization-owned Plugin: true while it has no organization-wide setting of its own and `organization_installation_preference` is its plugin marketplace's default. Null for a member-owned Plugin.

  - `Owner BetaPluginOwnerUnion`

    Who owns the Plugin: the organization, or the member whose personal plugin marketplace it lives in.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Reach BetaPluginReach`

    How far the served version reaches: `remote` when it declares an MCP server or a CLI, `privileged` when it declares a hook, monitor, language server or settings but nothing remote, `contained` otherwise; null when not classifiable.

    - `const BetaPluginReachContained BetaPluginReach = "contained"`

    - `const BetaPluginReachPrivileged BetaPluginReach = "privileged"`

    - `const BetaPluginReachRemote BetaPluginReach = "remote"`

  - `ServedVersionID string`

    The version claude.ai serves to members.

  - `ServedVersionPinned bool`

    False while the served version follows each new version; true once it has been pinned to one.

  - `UpdatedAt Time`

    RFC 3339. Moves on a new version and on a served-version change; a change to the Plugin's installation settings or shares does not move it.

    format: date-time

#### 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"),
	)
	betaPlugin, err := client.Beta.Organization.Plugins.Get(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPlugin.ID)
}
```

##### Response (200)

```json
{
  "id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "components": [
    {
      "description": "description",
      "name": "review-pr",
      "type": "skill"
    }
  ],
  "content_scan": {
    "assessment": "warn",
    "reason": "credential-exposure",
    "status": "completed"
  },
  "created_at": "2026-03-14T09:26:53.589793Z",
  "created_by": {
    "email_address": "user@example.com",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "description": "Reviews pull requests against your team's conventions.",
  "display_name": "Code Review Helper",
  "latest_version_id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
  "manifest_version": "1.2.0",
  "marketplace_id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
  "name": "code-review-helper",
  "organization_installation_preference": "available",
  "organization_installation_preference_inherited": true,
  "owner": {
    "type": "organization"
  },
  "reach": "contained",
  "served_version_id": "pluginver_01K9wPcHd4Rm2Tx8Vq6Ln3Sb",
  "served_version_pinned": true,
  "type": "plugin",
  "updated_at": "2026-03-14T09:26:53.589793Z"
}
```

### Update Plugin

`client.Beta.Organization.Plugins.Update(ctx, pluginID, params) (*BetaPlugin, error)`

**POST** `/v1/organizations/plugins/{plugin_id}`

Change which stored version of an organization-owned Plugin is served to members,
for example to roll back to an earlier one. This pins the served version: later
uploads are stored but no longer change what is served, and pinning cannot currently
be undone, here or in claude.ai.

Pass the version as `served_version_id`: an earlier one to roll back, a later one to
start serving a version that was stored without being served, or the one already
served to pin it without changing what is served. No new version is created.

When the organization has content scanning enabled, a version whose scan is still
running is refused with a 409 (`error_code` `scan_pending`; retry once the scan
finishes) and one whose scan failed, errored or reached no verdict with a 400
(`scan_failed`; a `warn` is accepted). When the Plugin is in the organization's
library marketplace, a version other than the one served is also refused with a 409
when one of its skills has a name that an organization skill (one an administrator
uploaded for the whole organization in claude.ai) has since taken: `error_code`
`skill_name_taken`, with that name in `details.skill_name`. A member-owned Plugin
cannot be updated here (403).

This endpoint does not write installation settings; they are written at
`/v1/organizations/plugins/{plugin_id}/installation_settings/{target}`.

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `params BetaOrganizationPluginUpdateParams`

  - `ServedVersionID string`

    Serve this version of the Plugin (prefixed `pluginver_`) and pin the served version to it; `latest` is not accepted.

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPlugin`

  - `Type Plugin`

    Always `plugin`.

    default: plugin

  - `ID string`

    The Plugin's ID.

  - `Components []BetaPluginComponent`

    What the served version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    The served version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginCreatedByUnion`

    Who created the Plugin; null when no creator is recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The served version's description.

  - `DisplayName string`

    The served version's display name.

  - `LatestVersionID string`

    The newest version.

  - `ManifestVersion string`

    The version string the served version's manifest declares.

  - `MarketplaceID string`

    The ID of the plugin marketplace the Plugin lives in.

  - `Name string`

    Lowercase identifier, unique within its plugin marketplace. Fixed for an organization-owned Plugin's lifetime; a member-owned Plugin's changes when its owner renames it in claude.ai, while its `id` stays the same.

  - `OrganizationInstallationPreference BetaPluginOrganizationInstallationPreference`

    Organization-owned Plugin: the organization-wide installation setting every member gets unless an RBAC Group they belong to holds its own — the Plugin's own setting, or its plugin marketplace's default. Null for a member-owned Plugin, which has shares instead. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginOrganizationInstallationPreferenceAutoInstall BetaPluginOrganizationInstallationPreference = "auto_install"`

    - `const BetaPluginOrganizationInstallationPreferenceAvailable BetaPluginOrganizationInstallationPreference = "available"`

    - `const BetaPluginOrganizationInstallationPreferenceNotAvailable BetaPluginOrganizationInstallationPreference = "not_available"`

    - `const BetaPluginOrganizationInstallationPreferenceRequired BetaPluginOrganizationInstallationPreference = "required"`

  - `OrganizationInstallationPreferenceInherited bool`

    Organization-owned Plugin: true while it has no organization-wide setting of its own and `organization_installation_preference` is its plugin marketplace's default. Null for a member-owned Plugin.

  - `Owner BetaPluginOwnerUnion`

    Who owns the Plugin: the organization, or the member whose personal plugin marketplace it lives in.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Reach BetaPluginReach`

    How far the served version reaches: `remote` when it declares an MCP server or a CLI, `privileged` when it declares a hook, monitor, language server or settings but nothing remote, `contained` otherwise; null when not classifiable.

    - `const BetaPluginReachContained BetaPluginReach = "contained"`

    - `const BetaPluginReachPrivileged BetaPluginReach = "privileged"`

    - `const BetaPluginReachRemote BetaPluginReach = "remote"`

  - `ServedVersionID string`

    The version claude.ai serves to members.

  - `ServedVersionPinned bool`

    False while the served version follows each new version; true once it has been pinned to one.

  - `UpdatedAt Time`

    RFC 3339. Moves on a new version and on a served-version change; a change to the Plugin's installation settings or shares does not move it.

    format: date-time

#### 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"),
	)
	betaPlugin, err := client.Beta.Organization.Plugins.Update(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginUpdateParams{
			ServedVersionID: "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPlugin.ID)
}
```

##### Response (200)

```json
{
  "id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "components": [
    {
      "description": "description",
      "name": "review-pr",
      "type": "skill"
    }
  ],
  "content_scan": {
    "assessment": "warn",
    "reason": "credential-exposure",
    "status": "completed"
  },
  "created_at": "2026-03-14T09:26:53.589793Z",
  "created_by": {
    "email_address": "user@example.com",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "description": "Reviews pull requests against your team's conventions.",
  "display_name": "Code Review Helper",
  "latest_version_id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
  "manifest_version": "1.2.0",
  "marketplace_id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
  "name": "code-review-helper",
  "organization_installation_preference": "available",
  "organization_installation_preference_inherited": true,
  "owner": {
    "type": "organization"
  },
  "reach": "contained",
  "served_version_id": "pluginver_01K9wPcHd4Rm2Tx8Vq6Ln3Sb",
  "served_version_pinned": true,
  "type": "plugin",
  "updated_at": "2026-03-14T09:26:53.589793Z"
}
```

### List Plugins

`client.Beta.Organization.Plugins.List(ctx, params) (*PageCursor[BetaPlugin], error)`

**GET** `/v1/organizations/plugins`

List the Plugins created under the organization, newest first: those in the
organization's own plugin marketplaces and those in members' personal plugin
marketplaces.

Plugins in members' personal marketplaces are listed with the same detail as the
organization's own, and their files can be downloaded through the version archive
endpoint, which records each such download on the Compliance API activity feed.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `params BetaOrganizationPluginListParams`

  - `CreatedAtGt param.Opt[Time] Optional` (query parameter)

    RFC 3339 timestamp bound; combine [gte], [gt], [lte], [lt].

    format: date-time

  - `CreatedAtGte param.Opt[Time] Optional` (query parameter)

    RFC 3339 timestamp bound; combine [gte], [gt], [lte], [lt].

    format: date-time

  - `CreatedAtLt param.Opt[Time] Optional` (query parameter)

    RFC 3339 timestamp bound; combine [gte], [gt], [lte], [lt].

    format: date-time

  - `CreatedAtLte param.Opt[Time] Optional` (query parameter)

    RFC 3339 timestamp bound; combine [gte], [gt], [lte], [lt].

    format: date-time

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `100`.

    minimum: 1, maximum: 100

  - `MarketplaceID param.Opt[string] Optional` (query parameter)

    Only Plugins in this plugin marketplace (prefixed `marketplace_`).

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

  - `OwnerType BetaOrganizationPluginListParamsOwnerType Optional` (query parameter)

    `organization` for Plugins in the organization's plugin marketplaces, `user` for Plugins in members' personal plugin marketplaces.

    - `const BetaOrganizationPluginListParamsOwnerTypeOrganization BetaOrganizationPluginListParamsOwnerType = "organization"`

    - `const BetaOrganizationPluginListParamsOwnerTypeUser BetaOrganizationPluginListParamsOwnerType = "user"`

  - `OwnerUserID param.Opt[string] Optional` (query parameter)

    Only Plugins in this member's personal plugin marketplaces (prefixed `user_`); a removed member's ID is accepted.

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

    maxLength: 2048

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPlugin`

  - `Type Plugin`

    Always `plugin`.

    default: plugin

  - `ID string`

    The Plugin's ID.

  - `Components []BetaPluginComponent`

    What the served version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    The served version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginCreatedByUnion`

    Who created the Plugin; null when no creator is recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The served version's description.

  - `DisplayName string`

    The served version's display name.

  - `LatestVersionID string`

    The newest version.

  - `ManifestVersion string`

    The version string the served version's manifest declares.

  - `MarketplaceID string`

    The ID of the plugin marketplace the Plugin lives in.

  - `Name string`

    Lowercase identifier, unique within its plugin marketplace. Fixed for an organization-owned Plugin's lifetime; a member-owned Plugin's changes when its owner renames it in claude.ai, while its `id` stays the same.

  - `OrganizationInstallationPreference BetaPluginOrganizationInstallationPreference`

    Organization-owned Plugin: the organization-wide installation setting every member gets unless an RBAC Group they belong to holds its own — the Plugin's own setting, or its plugin marketplace's default. Null for a member-owned Plugin, which has shares instead. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginOrganizationInstallationPreferenceAutoInstall BetaPluginOrganizationInstallationPreference = "auto_install"`

    - `const BetaPluginOrganizationInstallationPreferenceAvailable BetaPluginOrganizationInstallationPreference = "available"`

    - `const BetaPluginOrganizationInstallationPreferenceNotAvailable BetaPluginOrganizationInstallationPreference = "not_available"`

    - `const BetaPluginOrganizationInstallationPreferenceRequired BetaPluginOrganizationInstallationPreference = "required"`

  - `OrganizationInstallationPreferenceInherited bool`

    Organization-owned Plugin: true while it has no organization-wide setting of its own and `organization_installation_preference` is its plugin marketplace's default. Null for a member-owned Plugin.

  - `Owner BetaPluginOwnerUnion`

    Who owns the Plugin: the organization, or the member whose personal plugin marketplace it lives in.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Reach BetaPluginReach`

    How far the served version reaches: `remote` when it declares an MCP server or a CLI, `privileged` when it declares a hook, monitor, language server or settings but nothing remote, `contained` otherwise; null when not classifiable.

    - `const BetaPluginReachContained BetaPluginReach = "contained"`

    - `const BetaPluginReachPrivileged BetaPluginReach = "privileged"`

    - `const BetaPluginReachRemote BetaPluginReach = "remote"`

  - `ServedVersionID string`

    The version claude.ai serves to members.

  - `ServedVersionPinned bool`

    False while the served version follows each new version; true once it has been pinned to one.

  - `UpdatedAt Time`

    RFC 3339. Moves on a new version and on a served-version change; a change to the Plugin's installation settings or shares does not move it.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Organization.Plugins.List(context.TODO(), anthropic.BetaOrganizationPluginListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
      "components": [
        {
          "description": "description",
          "name": "review-pr",
          "type": "skill"
        }
      ],
      "content_scan": {
        "assessment": "warn",
        "reason": "credential-exposure",
        "status": "completed"
      },
      "created_at": "2026-03-14T09:26:53.589793Z",
      "created_by": {
        "email_address": "user@example.com",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "description": "Reviews pull requests against your team's conventions.",
      "display_name": "Code Review Helper",
      "latest_version_id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
      "manifest_version": "1.2.0",
      "marketplace_id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
      "name": "code-review-helper",
      "organization_installation_preference": "available",
      "organization_installation_preference_inherited": true,
      "owner": {
        "type": "organization"
      },
      "reach": "contained",
      "served_version_id": "pluginver_01K9wPcHd4Rm2Tx8Vq6Ln3Sb",
      "served_version_pinned": true,
      "type": "plugin",
      "updated_at": "2026-03-14T09:26:53.589793Z"
    }
  ],
  "next_page": "page_MjAyNi0wOS0xNlQxNDowNTowOVo"
}
```

### Delete Plugin

`client.Beta.Organization.Plugins.Delete(ctx, pluginID, body) (*BetaDeletedPlugin, error)`

**DELETE** `/v1/organizations/plugins/{plugin_id}`

Permanently delete a Plugin and every version it holds, exactly as when an
administrator deletes it in claude.ai. The Plugin may belong to the organization or
to a member, including a member who has since left the organization.

An organization-owned Plugin's installation settings go with it; a member-owned
Plugin's shares are withdrawn and its owner no longer has it.

To take an organization-owned Plugin out of use reversibly, set its
organization-wide installation setting to `not_available` instead (and
remove or change any group settings, which override it for their members). Only a
Plugin in a `manual` marketplace can be deleted here; one synchronized from a
repository is removed by removing it from the repository (400).

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `body BetaOrganizationPluginDeleteParams`

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaDeletedPlugin`

  - `Type PluginDeleted`

    Always `plugin_deleted`.

    default: plugin_deleted

  - `ID string`

    The deleted Plugin's ID.

#### 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"),
	)
	betaDeletedPlugin, err := client.Beta.Organization.Plugins.Delete(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedPlugin.ID)
}
```

##### Response (200)

```json
{
  "id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "type": "plugin_deleted"
}
```

## Beta › Organization › Plugins › Versions

### Create Plugin Version

`client.Beta.Organization.Plugins.Versions.New(ctx, pluginID, params) (*BetaPluginVersion, error)`

**POST** `/v1/organizations/plugins/{plugin_id}/versions`

Add a version to an organization-owned Plugin by uploading the new version's
files; it becomes the version served to members unless the Plugin's served version
has been pinned.

The upload is the same `multipart/form-data` as creating a Plugin: the version's
files (`files`, each part sent as `files[]`) and optional `release_notes`. The uploaded manifest's `name`
must equal the Plugin's `name`. Returns the stored version; read the Plugin back to
see which version it serves.

Only a Plugin in a `manual` marketplace takes uploads; a Plugin synchronized from
a repository gets its versions from the repository. When the Plugin is in the
organization's library marketplace, a version that adds a skill with the name of an
organization skill (a skill an administrator uploaded for the whole organization in
claude.ai) is refused with a 409: `error_code` `skill_name_taken`, with that name in
`details.skill_name`. A 503 with `error_code`
`registration_pending` means the version was stored but is not yet usable; a later
version create on the Plugin completes it.

For a worked example, see [Create a version](https://platform.claude.com/docs/en/manage-claude/plugins-api?sdk_languages=go#create-a-version)
in the Plugins API guide.

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `params BetaOrganizationPluginVersionNewParams`

  - `Files []Reader`

    The version's files: one part per file, the part's filename being the file's path within the Plugin (for example `skills/review-pr/SKILL.md`), or a single `.zip` or `.plugin` archive holding them all. On the wire each part is named `files[]`, and a part named plain `files` is not read; with cURL, `-F 'files[]=@SKILL.md;filename=skills/review-pr/SKILL.md'`. The files must include the manifest, `.claude-plugin/plugin.json`.

  - `ReleaseNotes param.Opt[string] Optional`

    Release notes stored with the version and shown in its version history in claude.ai; up to 5,000 characters.

    maxLength: 5000

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginVersion`

  - `Type PluginVersion`

    Always `plugin_version`.

    default: plugin_version

  - `ID string`

    The version's ID.

  - `Components []BetaPluginComponent`

    What the version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    This version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginVersionCreatedByUnion`

    Who uploaded this version; null when not recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The manifest's description; null when it declares none.

  - `DisplayName string`

    The manifest's display name; null when it declares none.

  - `ManifestVersion string`

    The version string the manifest declares; null when it declares none.

  - `PluginID string`

    The Plugin's ID.

  - `Reach BetaPluginVersionReach`

    How far the version reaches: `remote`, `privileged` or `contained`, as on the Plugin; null when not classifiable.

    - `const BetaPluginVersionReachContained BetaPluginVersionReach = "contained"`

    - `const BetaPluginVersionReachPrivileged BetaPluginVersionReach = "privileged"`

    - `const BetaPluginVersionReachRemote BetaPluginVersionReach = "remote"`

  - `ReleaseNotes string`

    As supplied with the upload; null when none were supplied.

#### Example

```go
package main

import (
	"bytes"
	"context"
	"fmt"
	"io"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaPluginVersion, err := client.Beta.Organization.Plugins.Versions.New(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginVersionNewParams{
			Files: []io.Reader{io.Reader(bytes.NewBuffer([]byte("Example data")))},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
  "components": [
    {
      "description": "description",
      "name": "review-pr",
      "type": "skill"
    }
  ],
  "content_scan": {
    "assessment": "warn",
    "reason": "credential-exposure",
    "status": "completed"
  },
  "created_at": "2026-03-14T09:26:53.589793Z",
  "created_by": {
    "email_address": "user@example.com",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "description": "Reviews pull requests against your team's conventions.",
  "display_name": "Code Review Helper",
  "manifest_version": "1.2.0",
  "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "reach": "contained",
  "release_notes": "Adds a review checklist for database migrations.",
  "type": "plugin_version"
}
```

### List Plugin Versions

`client.Beta.Organization.Plugins.Versions.List(ctx, pluginID, params) (*PageCursor[BetaPluginVersion], error)`

**GET** `/v1/organizations/plugins/{plugin_id}/versions`

List a Plugin's versions, newest first.

The first item of the first page is the version the Plugin's `latest_version_id`
refers to.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `params BetaOrganizationPluginVersionListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

    maxLength: 2048

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginVersion`

  - `Type PluginVersion`

    Always `plugin_version`.

    default: plugin_version

  - `ID string`

    The version's ID.

  - `Components []BetaPluginComponent`

    What the version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    This version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginVersionCreatedByUnion`

    Who uploaded this version; null when not recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The manifest's description; null when it declares none.

  - `DisplayName string`

    The manifest's display name; null when it declares none.

  - `ManifestVersion string`

    The version string the manifest declares; null when it declares none.

  - `PluginID string`

    The Plugin's ID.

  - `Reach BetaPluginVersionReach`

    How far the version reaches: `remote`, `privileged` or `contained`, as on the Plugin; null when not classifiable.

    - `const BetaPluginVersionReachContained BetaPluginVersionReach = "contained"`

    - `const BetaPluginVersionReachPrivileged BetaPluginVersionReach = "privileged"`

    - `const BetaPluginVersionReachRemote BetaPluginVersionReach = "remote"`

  - `ReleaseNotes string`

    As supplied with the upload; null when none were supplied.

#### 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"),
	)
	page, err := client.Beta.Organization.Plugins.Versions.List(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginVersionListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
      "components": [
        {
          "description": "description",
          "name": "review-pr",
          "type": "skill"
        }
      ],
      "content_scan": {
        "assessment": "warn",
        "reason": "credential-exposure",
        "status": "completed"
      },
      "created_at": "2026-03-14T09:26:53.589793Z",
      "created_by": {
        "email_address": "user@example.com",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "description": "Reviews pull requests against your team's conventions.",
      "display_name": "Code Review Helper",
      "manifest_version": "1.2.0",
      "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
      "reach": "contained",
      "release_notes": "Adds a review checklist for database migrations.",
      "type": "plugin_version"
    }
  ],
  "next_page": "page_MjAyNi0wOS0xNlQxNDowNTowOVo"
}
```

### Get Plugin Version

`client.Beta.Organization.Plugins.Versions.Get(ctx, version, params) (*BetaPluginVersion, error)`

**GET** `/v1/organizations/plugins/{plugin_id}/versions/{version}`

Retrieve one version of a Plugin by its ID, or the Plugin's newest version.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `version string` (path parameter)

  ID of the Plugin Version (prefixed `pluginver_`), or `latest` for the newest one.

- `params BetaOrganizationPluginVersionGetParams`

  - `PluginID string` (path parameter)

    ID of the Plugin (prefixed `plugin_`).

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginVersion`

  - `Type PluginVersion`

    Always `plugin_version`.

    default: plugin_version

  - `ID string`

    The version's ID.

  - `Components []BetaPluginComponent`

    What the version contains; null when not enumerated.

    - `Type BetaPluginComponentType`

      The kind of component.

      - `const BetaPluginComponentTypeAgent BetaPluginComponentType = "agent"`

      - `const BetaPluginComponentTypeCli BetaPluginComponentType = "cli"`

      - `const BetaPluginComponentTypeCommand BetaPluginComponentType = "command"`

      - `const BetaPluginComponentTypeHook BetaPluginComponentType = "hook"`

      - `const BetaPluginComponentTypeMCPServer BetaPluginComponentType = "mcp_server"`

      - `const BetaPluginComponentTypeSkill BetaPluginComponentType = "skill"`

    - `Description string`

      What the component declares about itself; always null for MCP servers, hooks, and CLIs.

    - `Name string`

      The component's name: a skill's, command's or agent's name, an MCP server's key in the manifest, the event a hook runs on, or a CLI's executable.

  - `ContentScan BetaPluginContentScan`

    This version's content scan; null when it has not been scanned.

    - `Assessment BetaPluginContentScanAssessment`

      The scan's verdict; set only when `status` is `completed`.

      - `const BetaPluginContentScanAssessmentFail BetaPluginContentScanAssessment = "fail"`

      - `const BetaPluginContentScanAssessmentPass BetaPluginContentScanAssessment = "pass"`

      - `const BetaPluginContentScanAssessmentUnknown BetaPluginContentScanAssessment = "unknown"`

      - `const BetaPluginContentScanAssessmentWarn BetaPluginContentScanAssessment = "warn"`

    - `Reason string`

      The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` or `guardrail-tampering`; a mechanism this API does not yet name reads as `other`. Null on a `pass`, whenever `assessment` is null, and when no mechanism is reported for the verdict.

    - `Status BetaPluginContentScanStatus`

      `processing` while a scan runs, `completed` when it ran to completion, `errored` when it could not run or its outcome cannot be read.

      - `const BetaPluginContentScanStatusCompleted BetaPluginContentScanStatus = "completed"`

      - `const BetaPluginContentScanStatusErrored BetaPluginContentScanStatus = "errored"`

      - `const BetaPluginContentScanStatusProcessing BetaPluginContentScanStatus = "processing"`

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `CreatedBy BetaPluginVersionCreatedByUnion`

    Who uploaded this version; null when not recorded.

    - `type BetaPluginUserActor`

      - `Type UserActor`

        A member of the organization.

        default: user_actor

      - `EmailAddress string`

        The member's email address; may be null, for example when they are no longer a member of the organization.

      - `UserID string`

        The member's User ID.

    - `type BetaPluginAPIActor`

      - `Type APIActor`

        An Admin API key, in the same form the Compliance API activity feed uses for it.

        default: api_actor

      - `APIKeyID string`

        The key's ID.

  - `Description string`

    The manifest's description; null when it declares none.

  - `DisplayName string`

    The manifest's display name; null when it declares none.

  - `ManifestVersion string`

    The version string the manifest declares; null when it declares none.

  - `PluginID string`

    The Plugin's ID.

  - `Reach BetaPluginVersionReach`

    How far the version reaches: `remote`, `privileged` or `contained`, as on the Plugin; null when not classifiable.

    - `const BetaPluginVersionReachContained BetaPluginVersionReach = "contained"`

    - `const BetaPluginVersionReachPrivileged BetaPluginVersionReach = "privileged"`

    - `const BetaPluginVersionReachRemote BetaPluginVersionReach = "remote"`

  - `ReleaseNotes string`

    As supplied with the upload; null when none were supplied.

#### 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"),
	)
	betaPluginVersion, err := client.Beta.Organization.Plugins.Versions.Get(
		context.TODO(),
		"version",
		anthropic.BetaOrganizationPluginVersionGetParams{
			PluginID: "plugin_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginVersion.ID)
}
```

##### Response (200)

```json
{
  "id": "pluginver_01KaZmQpRsTuVwXyZ2b4c6d8",
  "components": [
    {
      "description": "description",
      "name": "review-pr",
      "type": "skill"
    }
  ],
  "content_scan": {
    "assessment": "warn",
    "reason": "credential-exposure",
    "status": "completed"
  },
  "created_at": "2026-03-14T09:26:53.589793Z",
  "created_by": {
    "email_address": "user@example.com",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "description": "Reviews pull requests against your team's conventions.",
  "display_name": "Code Review Helper",
  "manifest_version": "1.2.0",
  "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "reach": "contained",
  "release_notes": "Adds a review checklist for database migrations.",
  "type": "plugin_version"
}
```

### Download Plugin Version Archive

`client.Beta.Organization.Plugins.Versions.Download(ctx, version, params) (*Response, error)`

**GET** `/v1/organizations/plugins/{plugin_id}/versions/{version}/content`

Download one version's `.zip` archive, exactly as stored. Each download of a
Plugin from a member's personal plugin marketplace is recorded on the Compliance API
activity feed.

The response body is the archive (`Content-Type: application/zip`), sent as an
attachment whose filename is derived from the Plugin's name; name saved files from
the IDs in the request path, since that filename is not unique.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every read scope above (`read:plugins`, `read:org_audit`, and
`read:compliance_org_data`) can download the files of plugins in members' personal
marketplaces, including files that claude.ai's admin settings do not show, and a
`read:org_audit` or `read:compliance_org_data` key created for all of your parent
organization's linked organizations can do this in any organization under it that has
access to this API, by passing `organization_id`. Each such download records a
`claude_plugin_archive_accessed` event on the Compliance API activity feed,
identifying the key, the plugin, the version, and the member. Downloads of
organization-owned plugins are not recorded.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `version string` (path parameter)

  ID of the Plugin Version (prefixed `pluginver_`). `latest` is not accepted here.

- `params BetaOrganizationPluginVersionDownloadParams`

  - `PluginID string` (path parameter)

    ID of the Plugin (prefixed `plugin_`).

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaOrganizationPluginVersionDownloadResponse interface{…}`

#### 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"),
	)
	response, err := client.Beta.Organization.Plugins.Versions.Download(
		context.TODO(),
		"version",
		anthropic.BetaOrganizationPluginVersionDownloadParams{
			PluginID: "plugin_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response)
}
```

## Beta › Organization › Plugins › Installation Settings

### List Plugin Installation Settings

`client.Beta.Organization.Plugins.InstallationSettings.List(ctx, pluginID, params) (*PageCursor[BetaPluginInstallationSetting], error)`

**GET** `/v1/organizations/plugins/{plugin_id}/installation_settings`

List an organization-owned Plugin's installation settings, which say which
members it is for, most recently created first.

The list holds the Plugin's own organization-wide setting (absent while the Plugin
inherits its marketplace's default) and each RBAC Group's own setting. A
member-owned Plugin has shares instead, so this path returns 404 for one.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `params BetaOrganizationPluginInstallationSettingListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `100`.

    minimum: 1, maximum: 100

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

    maxLength: 2048

  - `TargetType BetaOrganizationPluginInstallationSettingListParamsTargetType Optional` (query parameter)

    Only settings for this kind of target: `organization` (the organization-wide setting) or `rbac_group` (an RBAC Group's).

    - `const BetaOrganizationPluginInstallationSettingListParamsTargetTypeOrganization BetaOrganizationPluginInstallationSettingListParamsTargetType = "organization"`

    - `const BetaOrganizationPluginInstallationSettingListParamsTargetTypeRBACGroup BetaOrganizationPluginInstallationSettingListParamsTargetType = "rbac_group"`

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginInstallationSetting`

  The installation setting an organization-owned Plugin holds for one
  target. It has no ID of its own: it is addressed by the Plugin's ID and the
  target.

  - `Type PluginInstallationSetting`

    Always `plugin_installation_setting`.

    default: plugin_installation_setting

  - `CreatedAt Time`

    When the target was first given a setting for this Plugin.

    format: date-time

  - `InstallationPreference BetaPluginInstallationSettingInstallationPreference`

    The setting the target holds for this Plugin. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginInstallationSettingInstallationPreferenceAutoInstall BetaPluginInstallationSettingInstallationPreference = "auto_install"`

    - `const BetaPluginInstallationSettingInstallationPreferenceAvailable BetaPluginInstallationSettingInstallationPreference = "available"`

    - `const BetaPluginInstallationSettingInstallationPreferenceNotAvailable BetaPluginInstallationSettingInstallationPreference = "not_available"`

    - `const BetaPluginInstallationSettingInstallationPreferenceRequired BetaPluginInstallationSettingInstallationPreference = "required"`

  - `PluginID string`

    The Plugin's ID.

  - `Target BetaPluginInstallationSettingTargetUnion`

    Whose setting this is: `organization` (the Plugin's own organization-wide setting) or `rbac_group` (one RBAC Group's own setting); `organization_member` does not occur here.

    - `type BetaPluginTargetOrganization`

      - `Type Organization`

        Every member of the organization.

        default: organization

    - `type BetaPluginTargetRBACGroup`

      - `Type RBACGroup`

        An RBAC Group.

        default: rbac_group

      - `RBACGroupID string`

        The RBAC Group's ID.

    - `type BetaPluginTargetOrganizationMember`

      - `Type OrganizationMember`

        One member of the organization.

        default: organization_member

      - `UserID string`

        The member's User ID.

  - `UpdatedAt Time`

    When its setting last changed.

    format: date-time

#### 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"),
	)
	page, err := client.Beta.Organization.Plugins.InstallationSettings.List(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginInstallationSettingListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "created_at": "2026-03-14T09:26:53.589793Z",
      "installation_preference": "required",
      "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
      "target": {
        "type": "organization"
      },
      "type": "plugin_installation_setting",
      "updated_at": "2026-03-14T09:26:53.589793Z"
    }
  ],
  "next_page": "page_MjAyNi0wOS0xNlQxNDowNTowOVo"
}
```

### Set Plugin Installation Setting

`client.Beta.Organization.Plugins.InstallationSettings.Set(ctx, target, params) (*BetaPluginInstallationSetting, error)`

**POST** `/v1/organizations/plugins/{plugin_id}/installation_settings/{target}`

Set or change an organization-owned Plugin's installation setting for the whole
organization or for one RBAC Group.

Writing the value a target already holds of its own changes nothing.

A member-owned Plugin has shares instead of installation settings, so this path
returns 404 for one.

Send a Plugin's installation-setting writes one at a time. If several writes for the
same Plugin arrive at the same time, the server handles them one after another and
can answer some of them with `503` instead of applying them. That `503` carries
`x-should-retry: true`, and the write is safe to repeat: wait a second or two, then
send it again.

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `target string` (path parameter)

  The target whose setting is written: the literal `organization` for the Plugin's organization-wide setting, or an RBAC Group's ID (prefixed `rbac_group_`) for that group's own setting. Writing the `organization` target stops the Plugin from inheriting its marketplace's default, even when the value written equals that default.

- `params BetaOrganizationPluginInstallationSettingSetParams`

  - `PluginID string` (path parameter)

    ID of the Plugin (prefixed `plugin_`).

  - `InstallationPreference BetaOrganizationPluginInstallationSettingSetParamsInstallationPreference`

    The installation setting the target is to hold for this Plugin: one of `required`, `auto_install`, `available`, `not_available`.

    - `const BetaOrganizationPluginInstallationSettingSetParamsInstallationPreferenceAutoInstall BetaOrganizationPluginInstallationSettingSetParamsInstallationPreference = "auto_install"`

    - `const BetaOrganizationPluginInstallationSettingSetParamsInstallationPreferenceAvailable BetaOrganizationPluginInstallationSettingSetParamsInstallationPreference = "available"`

    - `const BetaOrganizationPluginInstallationSettingSetParamsInstallationPreferenceNotAvailable BetaOrganizationPluginInstallationSettingSetParamsInstallationPreference = "not_available"`

    - `const BetaOrganizationPluginInstallationSettingSetParamsInstallationPreferenceRequired BetaOrganizationPluginInstallationSettingSetParamsInstallationPreference = "required"`

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginInstallationSetting`

  The installation setting an organization-owned Plugin holds for one
  target. It has no ID of its own: it is addressed by the Plugin's ID and the
  target.

  - `Type PluginInstallationSetting`

    Always `plugin_installation_setting`.

    default: plugin_installation_setting

  - `CreatedAt Time`

    When the target was first given a setting for this Plugin.

    format: date-time

  - `InstallationPreference BetaPluginInstallationSettingInstallationPreference`

    The setting the target holds for this Plugin. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginInstallationSettingInstallationPreferenceAutoInstall BetaPluginInstallationSettingInstallationPreference = "auto_install"`

    - `const BetaPluginInstallationSettingInstallationPreferenceAvailable BetaPluginInstallationSettingInstallationPreference = "available"`

    - `const BetaPluginInstallationSettingInstallationPreferenceNotAvailable BetaPluginInstallationSettingInstallationPreference = "not_available"`

    - `const BetaPluginInstallationSettingInstallationPreferenceRequired BetaPluginInstallationSettingInstallationPreference = "required"`

  - `PluginID string`

    The Plugin's ID.

  - `Target BetaPluginInstallationSettingTargetUnion`

    Whose setting this is: `organization` (the Plugin's own organization-wide setting) or `rbac_group` (one RBAC Group's own setting); `organization_member` does not occur here.

    - `type BetaPluginTargetOrganization`

      - `Type Organization`

        Every member of the organization.

        default: organization

    - `type BetaPluginTargetRBACGroup`

      - `Type RBACGroup`

        An RBAC Group.

        default: rbac_group

      - `RBACGroupID string`

        The RBAC Group's ID.

    - `type BetaPluginTargetOrganizationMember`

      - `Type OrganizationMember`

        One member of the organization.

        default: organization_member

      - `UserID string`

        The member's User ID.

  - `UpdatedAt Time`

    When its setting last changed.

    format: date-time

#### 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"),
	)
	betaPluginInstallationSetting, err := client.Beta.Organization.Plugins.InstallationSettings.Set(
		context.TODO(),
		"target",
		anthropic.BetaOrganizationPluginInstallationSettingSetParams{
			PluginID:               "plugin_id",
			InstallationPreference: anthropic.BetaOrganizationPluginInstallationSettingSetParamsInstallationPreferenceRequired,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginInstallationSetting.PluginID)
}
```

##### Response (200)

```json
{
  "created_at": "2026-03-14T09:26:53.589793Z",
  "installation_preference": "required",
  "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "target": {
    "type": "organization"
  },
  "type": "plugin_installation_setting",
  "updated_at": "2026-03-14T09:26:53.589793Z"
}
```

### Remove Plugin Installation Setting

`client.Beta.Organization.Plugins.InstallationSettings.Remove(ctx, target, params) (*BetaDeletedPluginInstallationSetting, error)`

**DELETE** `/v1/organizations/plugins/{plugin_id}/installation_settings/{target}`

Remove an organization-owned Plugin's own installation setting for the whole
organization or for one RBAC Group.

Removing the `organization` target returns the Plugin to its marketplace's default
installation setting and leaves the groups' settings in place. Removing a group's
setting makes the group's members fall back to the Plugin's organization-wide setting
or to the settings of their other groups.

A target that holds no setting of its own returns 404 (a Plugin that already inherits
its marketplace's default holds no `organization` setting), and so does a member-owned
Plugin.

A removal counts as one of the Plugin's installation-setting writes: send all of those
writes one at a time. If several arrive for the same Plugin at the same time, the server
handles them one after another and can answer some of them with `503` and
`x-should-retry: true` instead of applying them; wait a second or two and send the
removal again. A `404` on the repeat means the setting is already gone.

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `target string` (path parameter)

  The target whose own setting is removed: the literal `organization` for the Plugin's organization-wide setting, or an RBAC Group's ID (prefixed `rbac_group_`) for that group's own setting. Removing the `organization` setting returns the Plugin to its marketplace's default.

- `params BetaOrganizationPluginInstallationSettingRemoveParams`

  - `PluginID string` (path parameter)

    ID of the Plugin (prefixed `plugin_`).

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaDeletedPluginInstallationSetting`

  Confirmation that one target's installation setting was removed, naming
  the Plugin and the target in place of an ID.

  - `Type PluginInstallationSettingDeleted`

    Always `plugin_installation_setting_deleted`.

    default: plugin_installation_setting_deleted

  - `PluginID string`

    The Plugin's ID.

  - `Target BetaDeletedPluginInstallationSettingTargetUnion`

    Whose setting was removed.

    - `type BetaPluginTargetOrganization`

      - `Type Organization`

        Every member of the organization.

        default: organization

    - `type BetaPluginTargetRBACGroup`

      - `Type RBACGroup`

        An RBAC Group.

        default: rbac_group

      - `RBACGroupID string`

        The RBAC Group's ID.

    - `type BetaPluginTargetOrganizationMember`

      - `Type OrganizationMember`

        One member of the organization.

        default: organization_member

      - `UserID string`

        The member's User ID.

#### 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"),
	)
	betaDeletedPluginInstallationSetting, err := client.Beta.Organization.Plugins.InstallationSettings.Remove(
		context.TODO(),
		"target",
		anthropic.BetaOrganizationPluginInstallationSettingRemoveParams{
			PluginID: "plugin_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedPluginInstallationSetting.PluginID)
}
```

##### Response (200)

```json
{
  "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
  "target": {
    "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
    "type": "rbac_group"
  },
  "type": "plugin_installation_setting_deleted"
}
```

## Beta › Organization › Plugins › Shares

### List Plugin Shares

`client.Beta.Organization.Plugins.Shares.List(ctx, pluginID, params) (*PageCursor[BetaPluginShare], error)`

**GET** `/v1/organizations/plugins/{plugin_id}/shares`

List the shares the owner of a member-owned Plugin has given — to every member of
the organization, to an RBAC Group, or to one member — most recently granted first.

Shares are read-only in this API: members give and withdraw them in claude.ai, and
who gave a share is recorded on the Compliance API activity feed rather than on the
share. An organization-owned Plugin has installation settings instead, so this path
returns 404 for one.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `pluginID string` (path parameter)

  ID of the Plugin (prefixed `plugin_`).

- `params BetaOrganizationPluginShareListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `100`.

    minimum: 1, maximum: 100

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

    maxLength: 2048

  - `TargetType BetaOrganizationPluginShareListParamsTargetType Optional` (query parameter)

    Only shares with this kind of target: `organization` (every member), `rbac_group` (one RBAC Group), or `organization_member` (one member).

    - `const BetaOrganizationPluginShareListParamsTargetTypeOrganization BetaOrganizationPluginShareListParamsTargetType = "organization"`

    - `const BetaOrganizationPluginShareListParamsTargetTypeOrganizationMember BetaOrganizationPluginShareListParamsTargetType = "organization_member"`

    - `const BetaOrganizationPluginShareListParamsTargetTypeRBACGroup BetaOrganizationPluginShareListParamsTargetType = "rbac_group"`

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginShare`

  One share the owner of a member-owned Plugin has given. Shares are
  read-only in this API and have no ID of their own; who gave a share is
  recorded on the Compliance API activity feed, not here.

  - `Type PluginShare`

    Always `plugin_share`.

    default: plugin_share

  - `GrantedAt Time`

    When the share was given; a share whose role is later changed in claude.ai is re-granted and carries the time of that change.

    format: date-time

  - `PluginID string`

    The Plugin's ID.

  - `Target BetaPluginShareTargetUnion`

    Who the Plugin is shared with: `organization` (every member), `rbac_group` (one RBAC Group), or `organization_member` (one member).

    - `type BetaPluginTargetOrganization`

      - `Type Organization`

        Every member of the organization.

        default: organization

    - `type BetaPluginTargetRBACGroup`

      - `Type RBACGroup`

        An RBAC Group.

        default: rbac_group

      - `RBACGroupID string`

        The RBAC Group's ID.

    - `type BetaPluginTargetOrganizationMember`

      - `Type OrganizationMember`

        One member of the organization.

        default: organization_member

      - `UserID string`

        The member's User ID.

#### 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"),
	)
	page, err := client.Beta.Organization.Plugins.Shares.List(
		context.TODO(),
		"plugin_id",
		anthropic.BetaOrganizationPluginShareListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "granted_at": "2026-03-14T09:26:53.589793Z",
      "plugin_id": "plugin_01JyHfbRkZvD1gW7oTqXc3Ne",
      "target": {
        "type": "organization"
      },
      "type": "plugin_share"
    }
  ],
  "next_page": "page_MjAyNi0wOS0xNlQxNDowNTowOVo"
}
```

## Beta › Organization › Plugin Marketplaces

### List Plugin Marketplaces

`client.Beta.Organization.PluginMarketplaces.List(ctx, params) (*PageCursor[BetaPluginMarketplace], error)`

**GET** `/v1/organizations/plugin_marketplaces`

List the plugin marketplaces Plugins live in, newest first: the organization's own
and its members' personal ones.

Plugin marketplaces are created, connected to a repository and deleted in
claude.ai, not through this API. The organization's library marketplace, the
organization-owned `manual` marketplace that uploads go to when no marketplace is
named, is created the first time something is put in it and is listed from then on.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `params BetaOrganizationPluginMarketplaceListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

  - `OwnerType BetaOrganizationPluginMarketplaceListParamsOwnerType Optional` (query parameter)

    `organization` for the organization's plugin marketplaces, `user` for members' personal plugin marketplaces.

    - `const BetaOrganizationPluginMarketplaceListParamsOwnerTypeOrganization BetaOrganizationPluginMarketplaceListParamsOwnerType = "organization"`

    - `const BetaOrganizationPluginMarketplaceListParamsOwnerTypeUser BetaOrganizationPluginMarketplaceListParamsOwnerType = "user"`

  - `Page param.Opt[string] Optional` (query parameter)

    Optionally set to the `next_page` token from the previous response.

    maxLength: 2048

  - `Source BetaOrganizationPluginMarketplaceListParamsSource Optional` (query parameter)

    Only plugin marketplaces with this `source`: `manual` for those whose Plugins are uploaded; `github`, `gitlab` or `public_git` for those synchronized from a Git repository. `directory` (Anthropic's catalog) is never listed here.

    - `const BetaOrganizationPluginMarketplaceListParamsSourceDirectory BetaOrganizationPluginMarketplaceListParamsSource = "directory"`

    - `const BetaOrganizationPluginMarketplaceListParamsSourceGitHub BetaOrganizationPluginMarketplaceListParamsSource = "github"`

    - `const BetaOrganizationPluginMarketplaceListParamsSourceGitlab BetaOrganizationPluginMarketplaceListParamsSource = "gitlab"`

    - `const BetaOrganizationPluginMarketplaceListParamsSourceManual BetaOrganizationPluginMarketplaceListParamsSource = "manual"`

    - `const BetaOrganizationPluginMarketplaceListParamsSourcePublicGit BetaOrganizationPluginMarketplaceListParamsSource = "public_git"`

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginMarketplace`

  - `Type PluginMarketplace`

    Always `plugin_marketplace`.

    default: plugin_marketplace

  - `ID string`

    The plugin marketplace's ID, prefixed `marketplace_`.

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `DefaultInstallationPreference BetaPluginMarketplaceDefaultInstallationPreference`

    Organization plugin marketplace: the organization-wide setting every Plugin in it with no setting of its own gets. Null for a member's personal plugin marketplace. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceAutoInstall BetaPluginMarketplaceDefaultInstallationPreference = "auto_install"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceAvailable BetaPluginMarketplaceDefaultInstallationPreference = "available"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceNotAvailable BetaPluginMarketplaceDefaultInstallationPreference = "not_available"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceRequired BetaPluginMarketplaceDefaultInstallationPreference = "required"`

  - `LastSyncEndedAt Time`

    RFC 3339. When the most recent synchronization attempt to finish did so, whatever its outcome; for a repository plugin marketplace no synchronization has run on yet, when it was created. Null for a plugin marketplace that is not synchronized from a repository.

    format: date-time

  - `LastSyncReadSha string`

    The commit the last synchronization attempt that reached the repository read, whether or not its content was then accepted (see `sync_status`); an attempt that ends `failed_auth` or `failed_transient` leaves it unchanged. Null until an attempt has first read the repository, and for a plugin marketplace that is not synchronized from a repository.

  - `Name string`

    Fixed for the plugin marketplace's lifetime.

  - `Owner BetaPluginMarketplaceOwnerUnion`

    The organization, or the member whose personal plugin marketplace it is.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Source BetaPluginMarketplaceSource`

    Where the plugin marketplace's Plugins come from: `manual` when they are uploaded; `github`, `gitlab` or `public_git` when they are synchronized from the Git repository the owner connected, into which nothing can be uploaded; `directory` is Anthropic's own catalog, which this API does not list. A value this API does not yet name is returned as stored.

    - `const BetaPluginMarketplaceSourceDirectory BetaPluginMarketplaceSource = "directory"`

    - `const BetaPluginMarketplaceSourceGitHub BetaPluginMarketplaceSource = "github"`

    - `const BetaPluginMarketplaceSourceGitlab BetaPluginMarketplaceSource = "gitlab"`

    - `const BetaPluginMarketplaceSourceManual BetaPluginMarketplaceSource = "manual"`

    - `const BetaPluginMarketplaceSourcePublicGit BetaPluginMarketplaceSource = "public_git"`

  - `SyncStatus BetaPluginMarketplaceSyncStatus`

    Outcome of the plugin marketplace's most recent synchronization: one of `success`, `in_progress`, `failed_content`, `failed_transient`, `failed_auth`, `failed_limits`; a value this API does not yet name is returned as stored. Null until a synchronization is first attempted — so always for a `manual` plugin marketplace.

    - `const BetaPluginMarketplaceSyncStatusFailedAuth BetaPluginMarketplaceSyncStatus = "failed_auth"`

    - `const BetaPluginMarketplaceSyncStatusFailedContent BetaPluginMarketplaceSyncStatus = "failed_content"`

    - `const BetaPluginMarketplaceSyncStatusFailedLimits BetaPluginMarketplaceSyncStatus = "failed_limits"`

    - `const BetaPluginMarketplaceSyncStatusFailedTransient BetaPluginMarketplaceSyncStatus = "failed_transient"`

    - `const BetaPluginMarketplaceSyncStatusInProgress BetaPluginMarketplaceSyncStatus = "in_progress"`

    - `const BetaPluginMarketplaceSyncStatusSuccess BetaPluginMarketplaceSyncStatus = "success"`

#### 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"),
	)
	page, err := client.Beta.Organization.PluginMarketplaces.List(context.TODO(), anthropic.BetaOrganizationPluginMarketplaceListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
      "created_at": "2026-03-14T09:26:53.589793Z",
      "default_installation_preference": "available",
      "last_sync_ended_at": "2026-03-14T09:26:53.589793Z",
      "last_sync_read_sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
      "name": "engineering-tools",
      "owner": {
        "type": "organization"
      },
      "source": "github",
      "sync_status": "success",
      "type": "plugin_marketplace"
    }
  ],
  "next_page": "page_MjAyNi0wOS0xNlQxNDowNTowOVo"
}
```

### Get Plugin Marketplace

`client.Beta.Organization.PluginMarketplaces.Get(ctx, marketplaceID, params) (*BetaPluginMarketplace, error)`

**GET** `/v1/organizations/plugin_marketplaces/{marketplace_id}`

Retrieve a plugin marketplace by ID.

**Accepted credentials:** an Admin API key with the `read:plugins` or `read:org_audit` scope, or a Compliance Access Key with the `read:compliance_org_data` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `marketplaceID string` (path parameter)

  ID of the plugin marketplace (prefixed `marketplace_`).

- `params BetaOrganizationPluginMarketplaceGetParams`

  - `OrganizationID param.Opt[string] Optional` (query parameter)

    For a `read:org_audit` or `read:compliance_org_data` key created for all of a parent organization's linked organizations: a child organization of that parent to read instead of the organization the key was created in, given as the organization's UUID or its `org_`-prefixed ID. A value that is neither returns a 400; an organization that is not a child of the key's parent, or where the Plugins API is not available, returns a 404. Any other key may pass only its own organization's ID here; another organization returns a 404.

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginMarketplace`

  - `Type PluginMarketplace`

    Always `plugin_marketplace`.

    default: plugin_marketplace

  - `ID string`

    The plugin marketplace's ID, prefixed `marketplace_`.

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `DefaultInstallationPreference BetaPluginMarketplaceDefaultInstallationPreference`

    Organization plugin marketplace: the organization-wide setting every Plugin in it with no setting of its own gets. Null for a member's personal plugin marketplace. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceAutoInstall BetaPluginMarketplaceDefaultInstallationPreference = "auto_install"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceAvailable BetaPluginMarketplaceDefaultInstallationPreference = "available"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceNotAvailable BetaPluginMarketplaceDefaultInstallationPreference = "not_available"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceRequired BetaPluginMarketplaceDefaultInstallationPreference = "required"`

  - `LastSyncEndedAt Time`

    RFC 3339. When the most recent synchronization attempt to finish did so, whatever its outcome; for a repository plugin marketplace no synchronization has run on yet, when it was created. Null for a plugin marketplace that is not synchronized from a repository.

    format: date-time

  - `LastSyncReadSha string`

    The commit the last synchronization attempt that reached the repository read, whether or not its content was then accepted (see `sync_status`); an attempt that ends `failed_auth` or `failed_transient` leaves it unchanged. Null until an attempt has first read the repository, and for a plugin marketplace that is not synchronized from a repository.

  - `Name string`

    Fixed for the plugin marketplace's lifetime.

  - `Owner BetaPluginMarketplaceOwnerUnion`

    The organization, or the member whose personal plugin marketplace it is.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Source BetaPluginMarketplaceSource`

    Where the plugin marketplace's Plugins come from: `manual` when they are uploaded; `github`, `gitlab` or `public_git` when they are synchronized from the Git repository the owner connected, into which nothing can be uploaded; `directory` is Anthropic's own catalog, which this API does not list. A value this API does not yet name is returned as stored.

    - `const BetaPluginMarketplaceSourceDirectory BetaPluginMarketplaceSource = "directory"`

    - `const BetaPluginMarketplaceSourceGitHub BetaPluginMarketplaceSource = "github"`

    - `const BetaPluginMarketplaceSourceGitlab BetaPluginMarketplaceSource = "gitlab"`

    - `const BetaPluginMarketplaceSourceManual BetaPluginMarketplaceSource = "manual"`

    - `const BetaPluginMarketplaceSourcePublicGit BetaPluginMarketplaceSource = "public_git"`

  - `SyncStatus BetaPluginMarketplaceSyncStatus`

    Outcome of the plugin marketplace's most recent synchronization: one of `success`, `in_progress`, `failed_content`, `failed_transient`, `failed_auth`, `failed_limits`; a value this API does not yet name is returned as stored. Null until a synchronization is first attempted — so always for a `manual` plugin marketplace.

    - `const BetaPluginMarketplaceSyncStatusFailedAuth BetaPluginMarketplaceSyncStatus = "failed_auth"`

    - `const BetaPluginMarketplaceSyncStatusFailedContent BetaPluginMarketplaceSyncStatus = "failed_content"`

    - `const BetaPluginMarketplaceSyncStatusFailedLimits BetaPluginMarketplaceSyncStatus = "failed_limits"`

    - `const BetaPluginMarketplaceSyncStatusFailedTransient BetaPluginMarketplaceSyncStatus = "failed_transient"`

    - `const BetaPluginMarketplaceSyncStatusInProgress BetaPluginMarketplaceSyncStatus = "in_progress"`

    - `const BetaPluginMarketplaceSyncStatusSuccess BetaPluginMarketplaceSyncStatus = "success"`

#### 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"),
	)
	betaPluginMarketplace, err := client.Beta.Organization.PluginMarketplaces.Get(
		context.TODO(),
		"marketplace_id",
		anthropic.BetaOrganizationPluginMarketplaceGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginMarketplace.ID)
}
```

##### Response (200)

```json
{
  "id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
  "created_at": "2026-03-14T09:26:53.589793Z",
  "default_installation_preference": "available",
  "last_sync_ended_at": "2026-03-14T09:26:53.589793Z",
  "last_sync_read_sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
  "name": "engineering-tools",
  "owner": {
    "type": "organization"
  },
  "source": "github",
  "sync_status": "success",
  "type": "plugin_marketplace"
}
```

### Update Plugin Marketplace

`client.Beta.Organization.PluginMarketplaces.Update(ctx, marketplaceID, params) (*BetaPluginMarketplace, error)`

**POST** `/v1/organizations/plugin_marketplaces/{marketplace_id}`

Set the default installation setting of one of the organization's own plugin
marketplaces. Every Plugin in it without a setting of its own gets this default as
its organization-wide setting, including Plugins added later.

Pass it as `default_installation_preference`. A member's personal marketplace
cannot be updated here (403).

**Accepted credentials:** an Admin API key with the `write:plugins` scope.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `marketplaceID string` (path parameter)

  ID of the plugin marketplace (prefixed `marketplace_`).

- `params BetaOrganizationPluginMarketplaceUpdateParams`

  - `DefaultInstallationPreference BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreference`

    The organization-wide installation setting every Plugin in the marketplace without one of its own gets: one of `required`, `auto_install`, `available`, `not_available`. Once set it can be changed but not removed.

    - `const BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreferenceAutoInstall BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreference = "auto_install"`

    - `const BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreferenceAvailable BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreference = "available"`

    - `const BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreferenceNotAvailable BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreference = "not_available"`

    - `const BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreferenceRequired BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreference = "required"`

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginMarketplace`

  - `Type PluginMarketplace`

    Always `plugin_marketplace`.

    default: plugin_marketplace

  - `ID string`

    The plugin marketplace's ID, prefixed `marketplace_`.

  - `CreatedAt Time`

    RFC 3339.

    format: date-time

  - `DefaultInstallationPreference BetaPluginMarketplaceDefaultInstallationPreference`

    Organization plugin marketplace: the organization-wide setting every Plugin in it with no setting of its own gets. Null for a member's personal plugin marketplace. One of `required`, `auto_install`, `available`, `not_available`; a value this API does not yet name is returned as stored.

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceAutoInstall BetaPluginMarketplaceDefaultInstallationPreference = "auto_install"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceAvailable BetaPluginMarketplaceDefaultInstallationPreference = "available"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceNotAvailable BetaPluginMarketplaceDefaultInstallationPreference = "not_available"`

    - `const BetaPluginMarketplaceDefaultInstallationPreferenceRequired BetaPluginMarketplaceDefaultInstallationPreference = "required"`

  - `LastSyncEndedAt Time`

    RFC 3339. When the most recent synchronization attempt to finish did so, whatever its outcome; for a repository plugin marketplace no synchronization has run on yet, when it was created. Null for a plugin marketplace that is not synchronized from a repository.

    format: date-time

  - `LastSyncReadSha string`

    The commit the last synchronization attempt that reached the repository read, whether or not its content was then accepted (see `sync_status`); an attempt that ends `failed_auth` or `failed_transient` leaves it unchanged. Null until an attempt has first read the repository, and for a plugin marketplace that is not synchronized from a repository.

  - `Name string`

    Fixed for the plugin marketplace's lifetime.

  - `Owner BetaPluginMarketplaceOwnerUnion`

    The organization, or the member whose personal plugin marketplace it is.

    - `type BetaPluginOwnerOrganization`

      - `Type Organization`

        The Plugin lives in a plugin marketplace the organization owns.

        default: organization

    - `type BetaPluginOwnerUser`

      - `Type User`

        The Plugin lives in one member's personal plugin marketplace.

        default: user

      - `UserID string`

        The member's User ID.

  - `Source BetaPluginMarketplaceSource`

    Where the plugin marketplace's Plugins come from: `manual` when they are uploaded; `github`, `gitlab` or `public_git` when they are synchronized from the Git repository the owner connected, into which nothing can be uploaded; `directory` is Anthropic's own catalog, which this API does not list. A value this API does not yet name is returned as stored.

    - `const BetaPluginMarketplaceSourceDirectory BetaPluginMarketplaceSource = "directory"`

    - `const BetaPluginMarketplaceSourceGitHub BetaPluginMarketplaceSource = "github"`

    - `const BetaPluginMarketplaceSourceGitlab BetaPluginMarketplaceSource = "gitlab"`

    - `const BetaPluginMarketplaceSourceManual BetaPluginMarketplaceSource = "manual"`

    - `const BetaPluginMarketplaceSourcePublicGit BetaPluginMarketplaceSource = "public_git"`

  - `SyncStatus BetaPluginMarketplaceSyncStatus`

    Outcome of the plugin marketplace's most recent synchronization: one of `success`, `in_progress`, `failed_content`, `failed_transient`, `failed_auth`, `failed_limits`; a value this API does not yet name is returned as stored. Null until a synchronization is first attempted — so always for a `manual` plugin marketplace.

    - `const BetaPluginMarketplaceSyncStatusFailedAuth BetaPluginMarketplaceSyncStatus = "failed_auth"`

    - `const BetaPluginMarketplaceSyncStatusFailedContent BetaPluginMarketplaceSyncStatus = "failed_content"`

    - `const BetaPluginMarketplaceSyncStatusFailedLimits BetaPluginMarketplaceSyncStatus = "failed_limits"`

    - `const BetaPluginMarketplaceSyncStatusFailedTransient BetaPluginMarketplaceSyncStatus = "failed_transient"`

    - `const BetaPluginMarketplaceSyncStatusInProgress BetaPluginMarketplaceSyncStatus = "in_progress"`

    - `const BetaPluginMarketplaceSyncStatusSuccess BetaPluginMarketplaceSyncStatus = "success"`

#### 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"),
	)
	betaPluginMarketplace, err := client.Beta.Organization.PluginMarketplaces.Update(
		context.TODO(),
		"marketplace_id",
		anthropic.BetaOrganizationPluginMarketplaceUpdateParams{
			DefaultInstallationPreference: anthropic.BetaOrganizationPluginMarketplaceUpdateParamsDefaultInstallationPreferenceAvailable,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginMarketplace.ID)
}
```

##### Response (200)

```json
{
  "id": "marketplace_01HxQ3v9KpZ2mTn8RwLc4Ys7",
  "created_at": "2026-03-14T09:26:53.589793Z",
  "default_installation_preference": "available",
  "last_sync_ended_at": "2026-03-14T09:26:53.589793Z",
  "last_sync_read_sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
  "name": "engineering-tools",
  "owner": {
    "type": "organization"
  },
  "source": "github",
  "sync_status": "success",
  "type": "plugin_marketplace"
}
```

### Validate Plugin Marketplace Repository

`client.Beta.Organization.PluginMarketplaces.ValidateRepository(ctx, params) (*BetaPluginMarketplaceValidationReport, error)`

**POST** `/v1/organizations/plugin_marketplaces/validate_repository`

Check whether a plugin marketplace held in a public GitHub repository would
synchronize into claude.ai, without connecting or storing it.

To check a `.zip` of the marketplace directory instead, use Validate Plugin Marketplace Archive.

The report says whether `marketplace.json` is well-formed, which plugins a
synchronization would skip and why, and which plugins would synchronize only in
part, with some files left out. A repository that is missing, private, or has no such branch or commit is reported, not refused: the response is a report with `valid: false`. Plugin sources outside the marketplace
are fetched anonymously from GitHub, so a private one is reported as not found; a
source on any other host is not fetched here, and the report notes that it will be
checked when the marketplace actually synchronizes.

Nothing is recorded on the Compliance API activity feed.

For a worked example, see [Validate marketplace content](https://platform.claude.com/docs/en/manage-claude/plugins-api?sdk_languages=go#validate-marketplace-content)
in the Plugins API guide.

**Accepted credentials:** an Admin API key with the `read:plugins` or `write:plugins` scope; `read:org_audit` and `read:compliance_org_data` do not grant it.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `params BetaOrganizationPluginMarketplaceValidateRepositoryParams`

  - `RepositoryURL string`

    The `https://` URL of a public repository on github.com that holds the marketplace. Any other host, a URL with credentials in it, or one that does not name a repository is a 400.

    minLength: 1

  - `Ref param.Opt[string] Optional`

    The branch to validate the tip of, or the full 40-character SHA of the commit to validate. When omitted, the branch a synchronization would read (usually the repository's default branch); if that is not the default branch, the report's `ref` says which branch was read. An empty string, or a value that is neither a branch name nor a 40-character SHA, is a 400.

    minLength: 1

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginMarketplaceValidationReport`

  The outcome of validating plugin marketplace content: a report, not a
  stored object, so nothing in it can be retrieved afterwards.

  - `Type PluginMarketplaceValidationReport`

    Always `plugin_marketplace_validation_report`.

    default: plugin_marketplace_validation_report

  - `CommitSha string`

    The full SHA of the commit that was validated: for a repository, the commit that was read; for an uploaded archive, the commit recorded in the archive's comment (as a Git host's download writes it; not verified), else null.

  - `ManifestError string`

    Set when nothing could be validated: the repository or archive could not be read, or marketplace.json is missing, malformed or over a limit. Null otherwise.

  - `ManifestErrorCode string`

    A stable identifier for `manifest_error`; null when that is.

  - `PluginErrors []BetaPluginMarketplaceValidationPluginError`

    One entry per plugin a synchronization would skip entirely, keyed by the plugin's name in marketplace.json.

    - `Error string`

      Why the plugin would be skipped by a synchronization.

    - `ErrorCode string`

      A stable identifier for the reason — the value to branch on.

    - `Name string`

      The plugin's name, as its entry in marketplace.json declares it.

  - `PluginWarnings []BetaPluginMarketplaceValidationPluginWarnings`

    One entry per plugin that would synchronize with some of its contents left out, keyed by the plugin's name in marketplace.json.

    - `Name string`

      The plugin's name, as its entry in marketplace.json declares it.

    - `Warnings []BetaPluginMarketplaceValidationPluginWarning`

      The parts of the plugin a synchronization would leave out.

      - `ErrorCode string`

        A stable identifier for the kind of warning.

      - `Message string`

        What would be left out, and why.

  - `Ref string`

    For a repository, the branch that was read by name: the one requested, or else the branch a synchronization of this repository is set to read. Null when no branch is named or set and the repository's default branch was read, for a request by commit SHA, and for an uploaded archive.

  - `TotalPluginCount int64`

    How many plugins marketplace.json declares; 0 when it could not be read.

  - `Valid bool`

    True when marketplace.json is well-formed and no plugin would be skipped; warnings never make it false.

#### 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"),
	)
	betaPluginMarketplaceValidationReport, err := client.Beta.Organization.PluginMarketplaces.ValidateRepository(context.TODO(), anthropic.BetaOrganizationPluginMarketplaceValidateRepositoryParams{
		RepositoryURL: "https://github.com/example-org/example-marketplace",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginMarketplaceValidationReport.Valid)
}
```

##### Response (200)

```json
{
  "commit_sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
  "manifest_error": "manifest_error",
  "manifest_error_code": "marketplace_sync_manifest_not_found",
  "plugin_errors": [
    {
      "error": "error",
      "error_code": "marketplace_sync_plugin_missing_manifest",
      "name": "name"
    }
  ],
  "plugin_warnings": [
    {
      "name": "name",
      "warnings": [
        {
          "error_code": "marketplace_sync_zipball_symlink_dangling",
          "message": "message"
        }
      ]
    }
  ],
  "ref": "main",
  "total_plugin_count": 0,
  "type": "plugin_marketplace_validation_report",
  "valid": false
}
```

### Validate Plugin Marketplace Archive

`client.Beta.Organization.PluginMarketplaces.ValidateArchive(ctx, params) (*BetaPluginMarketplaceValidationReport, error)`

**POST** `/v1/organizations/plugin_marketplaces/validate_archive`

Check whether a plugin marketplace, uploaded as a `.zip` of the marketplace
directory, would synchronize into claude.ai, without connecting or storing it.

To check a public GitHub repository instead, use Validate Plugin Marketplace Repository.

The report says whether `marketplace.json` is well-formed, which plugins a
synchronization would skip and why, and which plugins would synchronize only in
part, with some files left out. An archive that cannot be read as a marketplace is reported, not refused: the response is a report with `valid: false`. Plugin sources outside the marketplace
are fetched anonymously from GitHub, so a private one is reported as not found; a
source on any other host is not fetched here, and the report notes that it will be
checked when the marketplace actually synchronizes.

Nothing is recorded on the Compliance API activity feed.

For a worked example, see [Validate marketplace content](https://platform.claude.com/docs/en/manage-claude/plugins-api?sdk_languages=go#validate-marketplace-content)
in the Plugins API guide.

**Accepted credentials:** an Admin API key with the `read:plugins` or `write:plugins` scope; `read:org_audit` and `read:compliance_org_data` do not grant it.

Every request must include the beta header `anthropic-beta: ce-plugins-2026-09-01`. A request without it returns `404`, exactly as if the endpoint did not exist. The Plugins API is in beta and is available to Claude Enterprise organizations only. It is not available to Claude Platform (Claude Console) organizations, or to organizations with HIPAA readiness enabled.

#### Parameters

- `params BetaOrganizationPluginMarketplaceValidateArchiveParams`

  - `Archive Reader`

    A .zip of the marketplace directory (its contents at the root, or wrapped in one folder as a Git host's download produces), sent as a file part with a filename; DEFLATE- or STORE-compressed, at most 32 MB. A part sent without a filename, a second archive part, or any other form field is a 400; a larger archive is a 413.

    format: binary

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

    This endpoint is in beta: requests must send `ce-plugins-2026-09-01` in this header.

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

#### Returns

- `type BetaPluginMarketplaceValidationReport`

  The outcome of validating plugin marketplace content: a report, not a
  stored object, so nothing in it can be retrieved afterwards.

  - `Type PluginMarketplaceValidationReport`

    Always `plugin_marketplace_validation_report`.

    default: plugin_marketplace_validation_report

  - `CommitSha string`

    The full SHA of the commit that was validated: for a repository, the commit that was read; for an uploaded archive, the commit recorded in the archive's comment (as a Git host's download writes it; not verified), else null.

  - `ManifestError string`

    Set when nothing could be validated: the repository or archive could not be read, or marketplace.json is missing, malformed or over a limit. Null otherwise.

  - `ManifestErrorCode string`

    A stable identifier for `manifest_error`; null when that is.

  - `PluginErrors []BetaPluginMarketplaceValidationPluginError`

    One entry per plugin a synchronization would skip entirely, keyed by the plugin's name in marketplace.json.

    - `Error string`

      Why the plugin would be skipped by a synchronization.

    - `ErrorCode string`

      A stable identifier for the reason — the value to branch on.

    - `Name string`

      The plugin's name, as its entry in marketplace.json declares it.

  - `PluginWarnings []BetaPluginMarketplaceValidationPluginWarnings`

    One entry per plugin that would synchronize with some of its contents left out, keyed by the plugin's name in marketplace.json.

    - `Name string`

      The plugin's name, as its entry in marketplace.json declares it.

    - `Warnings []BetaPluginMarketplaceValidationPluginWarning`

      The parts of the plugin a synchronization would leave out.

      - `ErrorCode string`

        A stable identifier for the kind of warning.

      - `Message string`

        What would be left out, and why.

  - `Ref string`

    For a repository, the branch that was read by name: the one requested, or else the branch a synchronization of this repository is set to read. Null when no branch is named or set and the repository's default branch was read, for a request by commit SHA, and for an uploaded archive.

  - `TotalPluginCount int64`

    How many plugins marketplace.json declares; 0 when it could not be read.

  - `Valid bool`

    True when marketplace.json is well-formed and no plugin would be skipped; warnings never make it false.

#### Example

```go
package main

import (
	"bytes"
	"context"
	"fmt"
	"io"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaPluginMarketplaceValidationReport, err := client.Beta.Organization.PluginMarketplaces.ValidateArchive(context.TODO(), anthropic.BetaOrganizationPluginMarketplaceValidateArchiveParams{
		Archive: io.Reader(bytes.NewBuffer([]byte("Example data"))),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaPluginMarketplaceValidationReport.Valid)
}
```

##### Response (200)

```json
{
  "commit_sha": "9fceb02d0ae598e95dc970b74767f19372d61af8",
  "manifest_error": "manifest_error",
  "manifest_error_code": "marketplace_sync_manifest_not_found",
  "plugin_errors": [
    {
      "error": "error",
      "error_code": "marketplace_sync_plugin_missing_manifest",
      "name": "name"
    }
  ],
  "plugin_warnings": [
    {
      "name": "name",
      "warnings": [
        {
          "error_code": "marketplace_sync_zipball_symlink_dangling",
          "message": "message"
        }
      ]
    }
  ],
  "ref": "main",
  "total_plugin_count": 0,
  "type": "plugin_marketplace_validation_report",
  "valid": false
}
```

## Beta › Organization › Telemetry Destinations

### Create a Telemetry Destination

`client.Beta.Organization.TelemetryDestinations.New(ctx, params) (*BetaTelemetryDestination, error)`

**POST** `/v1/organizations/telemetry_destinations`

Register an OpenTelemetry destination for the organization.

The destination starts in state `enabled`. An organization can have at most 10 destinations, including disabled ones.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#add-a-destination) to learn more about adding a destination.

#### Parameters

- `params BetaOrganizationTelemetryDestinationNewParams`

  - `EndpointURL string`

    The base URL of your collector's OTLP/HTTP endpoint, for example `https://gateway.example.com`.

    The URL must use `https` and a hostname, not an IP address. The port, if given, must be 443. The URL must not contain a query string, a fragment, or a username and password. At most 2,048 characters.

    A path prefix, such as `/otlp`, is allowed. Don't include the per-signal path (`/v1/traces`), because the API appends it on delivery. If your collector takes traces on another path, also set `traces.endpoint_url`.

    minLength: 1, maxLength: 2048

  - `Workspaces BetaTelemetryDestinationWorkspacesParamsUnion`

    Which of the organization's workspaces the destination covers.

  - `DisplayName param.Opt[string] Optional`

    Human-readable name for the destination. Optional. 1 to 255 characters.

  - `Headers map[string, string] Optional`

    Request headers that the API sends with every delivery, typically your collector's authentication header (for example `authorization`).

    The API stores the values encrypted and never returns them. Reads show only `header_names`.

    At most 20 headers. Names are at most 128 characters. Two names can't differ only in case. Values are printable ASCII, at most 4,096 characters, and can't begin or end with a space. Names and values together are at most 16,384 bytes.

    Reserved names are rejected, for example `host`, `cookie`, `user-agent`, and names that start with `content-`, `proxy-`, `x-forwarded-`, or `anthropic-`. For this check, `_` in a name counts as `-`.

  - `Traces BetaTelemetryDestinationTracesParams Optional`

    The settings for the traces that the destination receives. If you leave it out, every setting takes its default.

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestination`

  An OpenTelemetry destination: an OTLP/HTTP endpoint, the request headers sent with every delivery to it, what the exported spans contain, and which workspaces it covers. A destination belongs to an organization. A workspace's spans go to every enabled destination that covers it.

  - `Type TelemetryDestination`

  - `ID string`

    The unique ID of the destination (`tdst_...`).

  - `CreatedAt Time`

    Time the destination was created.

    format: date-time

  - `DeliveryHealth BetaTelemetryDestinationDeliveryHealth`

    The most recent delivery results for this destination.

    - `LastError string`

      A message that describes the most recent failed delivery to the destination, or `null` if no delivery has failed yet.

      Examples are `temporary DNS failure`, `TLS failure`, `timeout`, `connection failure`, `invalid address`, `HTTP error (status 503)`, and `redirect (status 301)`. The message is `invalid address` both for a hostname that doesn't exist and for an address that isn't publicly routable. It never contains the endpoint's response body, a header value, a network address, or TLS details.

      `last_error` and `last_error_at` always change together. A later successful delivery doesn't clear them. If `last_success_at` is later than `last_error_at`, a delivery has succeeded since this failure.

      See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-errors) to learn the likely cause of each error.

    - `LastErrorAt Time`

      Time of the failure that `last_error` describes. Changes together with `last_error`. Null until a delivery first fails.

      format: date-time

    - `LastSuccessAt Time`

      Time of the most recent successful delivery to the destination, or `null` if no delivery has succeeded yet.

      format: date-time

  - `DisplayName string`

    Human-readable name for the destination. Null when none was set.

  - `EndpointURL string`

    The base URL of the destination's OTLP/HTTP endpoint, exactly as registered.

    The API appends the per-signal path, such as `/v1/traces`, on delivery, unless `traces.endpoint_url` is set.

  - `HeaderNames []string`

    Names of the registered request headers. Header values are write-only and are never returned.

  - `State BetaTelemetryDestinationStateUnion`

    Whether the destination receives deliveries.

    - `type BetaTelemetryDestinationStateEnabled`

      The telemetry destination receives the spans of the workspaces that it covers.

      - `Type Enabled`

    - `type BetaTelemetryDestinationStateDisabled`

      The API doesn't deliver anything to the telemetry destination.

      Spans produced while it is disabled aren't delivered later.

      - `Type Disabled`

      - `Reason BetaTelemetryDestinationDisabledReasonUnion`

        Whether a caller or the API disabled the destination and, when the API did, why. Read-only.

        - `type BetaTelemetryDestinationDisabledReasonCaller`

          A caller disabled the destination with an update that set `state` to `disabled`.

          - `Type Caller`

        - `type BetaTelemetryDestinationDisabledReasonSustainedFailure`

          The API disabled the destination because deliveries to it failed, with no successful delivery in between, for longer than a threshold that Anthropic configures and that is not part of this contract. The reason is `invalid_address` instead when the most recent failed delivery failed with an invalid address.

          - `Type SustainedFailure`

        - `type BetaTelemetryDestinationDisabledReasonInvalidAddress`

          The API disabled the destination because deliveries to it failed for longer than the same threshold as for `sustained_failure`, and the most recent failed delivery failed with an invalid address: the DNS answer says that the endpoint's hostname doesn't exist or doesn't have an address, or the address that the API would connect to isn't publicly routable or is reserved, for example a loopback, link-local, private-network, or cloud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a temporary DNS failure instead, not an invalid address.

          - `Type InvalidAddress`

        - `type BetaTelemetryDestinationDisabledReasonRedirect`

          The API disabled the destination because the endpoint answered a delivery with a 3xx status. Redirects are never followed, and one such answer disables the destination at once.

          - `Type Redirect`

  - `Traces BetaTelemetryDestinationTraces`

    The destination's settings for the traces it receives.

    - `ContentMode BetaTelemetryDestinationContentMode`

      What the exported spans contain.

      - `const BetaTelemetryDestinationContentModeMetadataOnly BetaTelemetryDestinationContentMode = "metadata_only"`

        The spans contain identifiers, timing, status, token counts, and similar metadata. They don't contain prompt text, completion text, or tool inputs and outputs.

      - `const BetaTelemetryDestinationContentModeContent BetaTelemetryDestinationContentMode = "content"`

        The spans contain the same metadata as `metadata_only`, plus message and tool content.

        An organization with a data-handling restriction, such as under HIPAA, can't choose this mode. The API exports only metadata for such an organization, even to a destination that already has `content`.

    - `Enabled bool`

      Whether the destination receives traces. A destination whose `enabled` is false keeps its other settings.

    - `EndpointURL string`

      The full URL that the API posts traces to, exactly as registered, or `null` if the destination doesn't have one.

      When it is `null`, the API posts traces to `endpoint_url` with `/v1/traces` appended.

    - `MaxContentBytes int64`

      The most bytes of content that one exported span can contain, or `null` if only the API's maximum applies.

      Content means model prompts and responses, and tool inputs and outputs. The API shortens longer content to this size before it delivers the span. A destination whose `content_mode` is `metadata_only` keeps this value. It applies once `content_mode` is `content`.

      format: int32

  - `UpdatedAt Time`

    Time of the last change to the destination's configuration or state. Changes to `delivery_health` don't change it.

    An update that sets a header value always changes it, even when the value is the same as before. Adding or removing a single workspace on the destination's list doesn't change it. An update that changes the list does.

    format: date-time

  - `Workspaces BetaTelemetryDestinationWorkspacesUnion`

    Which of the organization's workspaces the destination covers.

    - `type BetaTelemetryDestinationWorkspacesAll`

      The destination covers every workspace of the organization, including the default workspace, archived workspaces, and workspaces created later. It doesn't have a list.

      - `Type All`

    - `type BetaTelemetryDestinationWorkspacesInclude`

      The destination covers the workspaces on its list, and no others.

      - `Type Include`

    - `type BetaTelemetryDestinationWorkspacesExclude`

      The destination covers every workspace of the organization except the workspaces on its list. A workspace created later is covered until it is added to the list.

      - `Type Exclude`

#### 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"),
	)
	betaTelemetryDestination, err := client.Beta.Organization.TelemetryDestinations.New(context.TODO(), anthropic.BetaOrganizationTelemetryDestinationNewParams{
		EndpointURL: "x",
		Workspaces: anthropic.BetaTelemetryDestinationWorkspacesParamsUnion{
			OfAll: &anthropic.BetaTelemetryDestinationWorkspacesAllParams{},
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTelemetryDestination.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "delivery_health": {
    "last_error": "last_error",
    "last_error_at": "2019-12-27T18:11:19.117Z",
    "last_success_at": "2019-12-27T18:11:19.117Z"
  },
  "display_name": "display_name",
  "endpoint_url": "endpoint_url",
  "header_names": [
    "string"
  ],
  "state": {
    "type": "enabled"
  },
  "traces": {
    "content_mode": "metadata_only",
    "enabled": true,
    "endpoint_url": "endpoint_url",
    "max_content_bytes": 0
  },
  "type": "telemetry_destination",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "workspaces": {
    "type": "all"
  }
}
```

### List Telemetry Destinations

`client.Beta.Organization.TelemetryDestinations.List(ctx, params) (*PageCursor[BetaTelemetryDestination], error)`

**GET** `/v1/organizations/telemetry_destinations`

List the organization's destinations, newest first, optionally only those that cover given workspaces.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#set-up-api-tracing) to learn more about destinations.

#### Parameters

- `params BetaOrganizationTelemetryDestinationListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of destinations to return per page, between 1 and 1,000. Defaults to 20.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`. Leave it out to get the first page.

  - `WorkspaceIDs []string Optional` (query parameter)

    Return only the destinations that cover at least one of these workspaces (`wrkspc_...`).

    Send at most 100 IDs, as `workspace_ids[]`. A destination covers a workspace when its `workspaces.type` is `all`, when its `include` list has the workspace, or when its `exclude` list doesn't have it. Destinations in either state can match. An ID that isn't the ID of one of the organization's workspaces doesn't match any destination, not even one whose type is `all`.

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestination`

  An OpenTelemetry destination: an OTLP/HTTP endpoint, the request headers sent with every delivery to it, what the exported spans contain, and which workspaces it covers. A destination belongs to an organization. A workspace's spans go to every enabled destination that covers it.

  - `Type TelemetryDestination`

  - `ID string`

    The unique ID of the destination (`tdst_...`).

  - `CreatedAt Time`

    Time the destination was created.

    format: date-time

  - `DeliveryHealth BetaTelemetryDestinationDeliveryHealth`

    The most recent delivery results for this destination.

    - `LastError string`

      A message that describes the most recent failed delivery to the destination, or `null` if no delivery has failed yet.

      Examples are `temporary DNS failure`, `TLS failure`, `timeout`, `connection failure`, `invalid address`, `HTTP error (status 503)`, and `redirect (status 301)`. The message is `invalid address` both for a hostname that doesn't exist and for an address that isn't publicly routable. It never contains the endpoint's response body, a header value, a network address, or TLS details.

      `last_error` and `last_error_at` always change together. A later successful delivery doesn't clear them. If `last_success_at` is later than `last_error_at`, a delivery has succeeded since this failure.

      See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-errors) to learn the likely cause of each error.

    - `LastErrorAt Time`

      Time of the failure that `last_error` describes. Changes together with `last_error`. Null until a delivery first fails.

      format: date-time

    - `LastSuccessAt Time`

      Time of the most recent successful delivery to the destination, or `null` if no delivery has succeeded yet.

      format: date-time

  - `DisplayName string`

    Human-readable name for the destination. Null when none was set.

  - `EndpointURL string`

    The base URL of the destination's OTLP/HTTP endpoint, exactly as registered.

    The API appends the per-signal path, such as `/v1/traces`, on delivery, unless `traces.endpoint_url` is set.

  - `HeaderNames []string`

    Names of the registered request headers. Header values are write-only and are never returned.

  - `State BetaTelemetryDestinationStateUnion`

    Whether the destination receives deliveries.

    - `type BetaTelemetryDestinationStateEnabled`

      The telemetry destination receives the spans of the workspaces that it covers.

      - `Type Enabled`

    - `type BetaTelemetryDestinationStateDisabled`

      The API doesn't deliver anything to the telemetry destination.

      Spans produced while it is disabled aren't delivered later.

      - `Type Disabled`

      - `Reason BetaTelemetryDestinationDisabledReasonUnion`

        Whether a caller or the API disabled the destination and, when the API did, why. Read-only.

        - `type BetaTelemetryDestinationDisabledReasonCaller`

          A caller disabled the destination with an update that set `state` to `disabled`.

          - `Type Caller`

        - `type BetaTelemetryDestinationDisabledReasonSustainedFailure`

          The API disabled the destination because deliveries to it failed, with no successful delivery in between, for longer than a threshold that Anthropic configures and that is not part of this contract. The reason is `invalid_address` instead when the most recent failed delivery failed with an invalid address.

          - `Type SustainedFailure`

        - `type BetaTelemetryDestinationDisabledReasonInvalidAddress`

          The API disabled the destination because deliveries to it failed for longer than the same threshold as for `sustained_failure`, and the most recent failed delivery failed with an invalid address: the DNS answer says that the endpoint's hostname doesn't exist or doesn't have an address, or the address that the API would connect to isn't publicly routable or is reserved, for example a loopback, link-local, private-network, or cloud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a temporary DNS failure instead, not an invalid address.

          - `Type InvalidAddress`

        - `type BetaTelemetryDestinationDisabledReasonRedirect`

          The API disabled the destination because the endpoint answered a delivery with a 3xx status. Redirects are never followed, and one such answer disables the destination at once.

          - `Type Redirect`

  - `Traces BetaTelemetryDestinationTraces`

    The destination's settings for the traces it receives.

    - `ContentMode BetaTelemetryDestinationContentMode`

      What the exported spans contain.

      - `const BetaTelemetryDestinationContentModeMetadataOnly BetaTelemetryDestinationContentMode = "metadata_only"`

        The spans contain identifiers, timing, status, token counts, and similar metadata. They don't contain prompt text, completion text, or tool inputs and outputs.

      - `const BetaTelemetryDestinationContentModeContent BetaTelemetryDestinationContentMode = "content"`

        The spans contain the same metadata as `metadata_only`, plus message and tool content.

        An organization with a data-handling restriction, such as under HIPAA, can't choose this mode. The API exports only metadata for such an organization, even to a destination that already has `content`.

    - `Enabled bool`

      Whether the destination receives traces. A destination whose `enabled` is false keeps its other settings.

    - `EndpointURL string`

      The full URL that the API posts traces to, exactly as registered, or `null` if the destination doesn't have one.

      When it is `null`, the API posts traces to `endpoint_url` with `/v1/traces` appended.

    - `MaxContentBytes int64`

      The most bytes of content that one exported span can contain, or `null` if only the API's maximum applies.

      Content means model prompts and responses, and tool inputs and outputs. The API shortens longer content to this size before it delivers the span. A destination whose `content_mode` is `metadata_only` keeps this value. It applies once `content_mode` is `content`.

      format: int32

  - `UpdatedAt Time`

    Time of the last change to the destination's configuration or state. Changes to `delivery_health` don't change it.

    An update that sets a header value always changes it, even when the value is the same as before. Adding or removing a single workspace on the destination's list doesn't change it. An update that changes the list does.

    format: date-time

  - `Workspaces BetaTelemetryDestinationWorkspacesUnion`

    Which of the organization's workspaces the destination covers.

    - `type BetaTelemetryDestinationWorkspacesAll`

      The destination covers every workspace of the organization, including the default workspace, archived workspaces, and workspaces created later. It doesn't have a list.

      - `Type All`

    - `type BetaTelemetryDestinationWorkspacesInclude`

      The destination covers the workspaces on its list, and no others.

      - `Type Include`

    - `type BetaTelemetryDestinationWorkspacesExclude`

      The destination covers every workspace of the organization except the workspaces on its list. A workspace created later is covered until it is added to the list.

      - `Type Exclude`

#### 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"),
	)
	page, err := client.Beta.Organization.TelemetryDestinations.List(context.TODO(), anthropic.BetaOrganizationTelemetryDestinationListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "delivery_health": {
        "last_error": "last_error",
        "last_error_at": "2019-12-27T18:11:19.117Z",
        "last_success_at": "2019-12-27T18:11:19.117Z"
      },
      "display_name": "display_name",
      "endpoint_url": "endpoint_url",
      "header_names": [
        "string"
      ],
      "state": {
        "type": "enabled"
      },
      "traces": {
        "content_mode": "metadata_only",
        "enabled": true,
        "endpoint_url": "endpoint_url",
        "max_content_bytes": 0
      },
      "type": "telemetry_destination",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "workspaces": {
        "type": "all"
      }
    }
  ],
  "next_page": "next_page"
}
```

### Retrieve a Telemetry Destination

`client.Beta.Organization.TelemetryDestinations.Get(ctx, destinationID, query) (*BetaTelemetryDestination, error)`

**GET** `/v1/organizations/telemetry_destinations/{destination_id}`

Read a destination's configuration, state, and most recent delivery results.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-and-health) to learn how the API delivers spans and when it disables a destination.

#### Parameters

- `destinationID string` (path parameter)

  ID of the destination (`tdst_...`).

- `query BetaOrganizationTelemetryDestinationGetParams`

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestination`

  An OpenTelemetry destination: an OTLP/HTTP endpoint, the request headers sent with every delivery to it, what the exported spans contain, and which workspaces it covers. A destination belongs to an organization. A workspace's spans go to every enabled destination that covers it.

  - `Type TelemetryDestination`

  - `ID string`

    The unique ID of the destination (`tdst_...`).

  - `CreatedAt Time`

    Time the destination was created.

    format: date-time

  - `DeliveryHealth BetaTelemetryDestinationDeliveryHealth`

    The most recent delivery results for this destination.

    - `LastError string`

      A message that describes the most recent failed delivery to the destination, or `null` if no delivery has failed yet.

      Examples are `temporary DNS failure`, `TLS failure`, `timeout`, `connection failure`, `invalid address`, `HTTP error (status 503)`, and `redirect (status 301)`. The message is `invalid address` both for a hostname that doesn't exist and for an address that isn't publicly routable. It never contains the endpoint's response body, a header value, a network address, or TLS details.

      `last_error` and `last_error_at` always change together. A later successful delivery doesn't clear them. If `last_success_at` is later than `last_error_at`, a delivery has succeeded since this failure.

      See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-errors) to learn the likely cause of each error.

    - `LastErrorAt Time`

      Time of the failure that `last_error` describes. Changes together with `last_error`. Null until a delivery first fails.

      format: date-time

    - `LastSuccessAt Time`

      Time of the most recent successful delivery to the destination, or `null` if no delivery has succeeded yet.

      format: date-time

  - `DisplayName string`

    Human-readable name for the destination. Null when none was set.

  - `EndpointURL string`

    The base URL of the destination's OTLP/HTTP endpoint, exactly as registered.

    The API appends the per-signal path, such as `/v1/traces`, on delivery, unless `traces.endpoint_url` is set.

  - `HeaderNames []string`

    Names of the registered request headers. Header values are write-only and are never returned.

  - `State BetaTelemetryDestinationStateUnion`

    Whether the destination receives deliveries.

    - `type BetaTelemetryDestinationStateEnabled`

      The telemetry destination receives the spans of the workspaces that it covers.

      - `Type Enabled`

    - `type BetaTelemetryDestinationStateDisabled`

      The API doesn't deliver anything to the telemetry destination.

      Spans produced while it is disabled aren't delivered later.

      - `Type Disabled`

      - `Reason BetaTelemetryDestinationDisabledReasonUnion`

        Whether a caller or the API disabled the destination and, when the API did, why. Read-only.

        - `type BetaTelemetryDestinationDisabledReasonCaller`

          A caller disabled the destination with an update that set `state` to `disabled`.

          - `Type Caller`

        - `type BetaTelemetryDestinationDisabledReasonSustainedFailure`

          The API disabled the destination because deliveries to it failed, with no successful delivery in between, for longer than a threshold that Anthropic configures and that is not part of this contract. The reason is `invalid_address` instead when the most recent failed delivery failed with an invalid address.

          - `Type SustainedFailure`

        - `type BetaTelemetryDestinationDisabledReasonInvalidAddress`

          The API disabled the destination because deliveries to it failed for longer than the same threshold as for `sustained_failure`, and the most recent failed delivery failed with an invalid address: the DNS answer says that the endpoint's hostname doesn't exist or doesn't have an address, or the address that the API would connect to isn't publicly routable or is reserved, for example a loopback, link-local, private-network, or cloud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a temporary DNS failure instead, not an invalid address.

          - `Type InvalidAddress`

        - `type BetaTelemetryDestinationDisabledReasonRedirect`

          The API disabled the destination because the endpoint answered a delivery with a 3xx status. Redirects are never followed, and one such answer disables the destination at once.

          - `Type Redirect`

  - `Traces BetaTelemetryDestinationTraces`

    The destination's settings for the traces it receives.

    - `ContentMode BetaTelemetryDestinationContentMode`

      What the exported spans contain.

      - `const BetaTelemetryDestinationContentModeMetadataOnly BetaTelemetryDestinationContentMode = "metadata_only"`

        The spans contain identifiers, timing, status, token counts, and similar metadata. They don't contain prompt text, completion text, or tool inputs and outputs.

      - `const BetaTelemetryDestinationContentModeContent BetaTelemetryDestinationContentMode = "content"`

        The spans contain the same metadata as `metadata_only`, plus message and tool content.

        An organization with a data-handling restriction, such as under HIPAA, can't choose this mode. The API exports only metadata for such an organization, even to a destination that already has `content`.

    - `Enabled bool`

      Whether the destination receives traces. A destination whose `enabled` is false keeps its other settings.

    - `EndpointURL string`

      The full URL that the API posts traces to, exactly as registered, or `null` if the destination doesn't have one.

      When it is `null`, the API posts traces to `endpoint_url` with `/v1/traces` appended.

    - `MaxContentBytes int64`

      The most bytes of content that one exported span can contain, or `null` if only the API's maximum applies.

      Content means model prompts and responses, and tool inputs and outputs. The API shortens longer content to this size before it delivers the span. A destination whose `content_mode` is `metadata_only` keeps this value. It applies once `content_mode` is `content`.

      format: int32

  - `UpdatedAt Time`

    Time of the last change to the destination's configuration or state. Changes to `delivery_health` don't change it.

    An update that sets a header value always changes it, even when the value is the same as before. Adding or removing a single workspace on the destination's list doesn't change it. An update that changes the list does.

    format: date-time

  - `Workspaces BetaTelemetryDestinationWorkspacesUnion`

    Which of the organization's workspaces the destination covers.

    - `type BetaTelemetryDestinationWorkspacesAll`

      The destination covers every workspace of the organization, including the default workspace, archived workspaces, and workspaces created later. It doesn't have a list.

      - `Type All`

    - `type BetaTelemetryDestinationWorkspacesInclude`

      The destination covers the workspaces on its list, and no others.

      - `Type Include`

    - `type BetaTelemetryDestinationWorkspacesExclude`

      The destination covers every workspace of the organization except the workspaces on its list. A workspace created later is covered until it is added to the list.

      - `Type Exclude`

#### 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"),
	)
	betaTelemetryDestination, err := client.Beta.Organization.TelemetryDestinations.Get(
		context.TODO(),
		"destination_id",
		anthropic.BetaOrganizationTelemetryDestinationGetParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTelemetryDestination.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "delivery_health": {
    "last_error": "last_error",
    "last_error_at": "2019-12-27T18:11:19.117Z",
    "last_success_at": "2019-12-27T18:11:19.117Z"
  },
  "display_name": "display_name",
  "endpoint_url": "endpoint_url",
  "header_names": [
    "string"
  ],
  "state": {
    "type": "enabled"
  },
  "traces": {
    "content_mode": "metadata_only",
    "enabled": true,
    "endpoint_url": "endpoint_url",
    "max_content_bytes": 0
  },
  "type": "telemetry_destination",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "workspaces": {
    "type": "all"
  }
}
```

### Update a Telemetry Destination

`client.Beta.Organization.TelemetryDestinations.Update(ctx, destinationID, params) (*BetaTelemetryDestination, error)`

**POST** `/v1/organizations/telemetry_destinations/{destination_id}`

Change a telemetry destination's settings, its state, or which workspaces it covers.

Send at least one field. Omitted fields keep their stored values, except the registered headers, which a change of the endpoint's hostname or port removes. Only `display_name`, `traces`, `traces.endpoint_url`, `traces.content_mode`, `traces.max_content_bytes`, and individual `headers` values accept `null`.

If another request changes the destination while the update runs, the API returns a 409 `conflict_error`. Read the destination again, then retry the update.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-and-health) to learn more about changing a destination.

#### Parameters

- `destinationID string` (path parameter)

  ID of the destination (`tdst_...`).

- `params BetaOrganizationTelemetryDestinationUpdateParams`

  - `DisplayName param.Opt[string] Optional`

    New human-readable name, 1 to 255 characters. Null clears it.

  - `EndpointURL param.Opt[string] Optional`

    The new base URL of the destination's OTLP/HTTP endpoint. The same rules as on create apply.

    A change of hostname or port first removes every registered header, so send the headers for the new endpoint in the same request. When the destination has a `traces.endpoint_url`, such a change must also set `traces.endpoint_url` to a URL with the new hostname and port, or to `null`. A change of the path alone keeps the headers.

    maxLength: 2048

  - `Headers map[string, string] Optional`

    Headers to set or remove. The API merges them into the destination's headers by name.

    Names compare case-insensitively. A string value sets or replaces that header. A `null` value removes it. Headers that you omit don't change. The field itself can't be `null`.

    A request that sets a header value must also include `endpoint_url`. The current URL is accepted.

    The resulting set must stay within the same limits as on create. When the request sets a value, each stored value that it doesn't set counts as 4,096 bytes toward the 16,384-byte limit, because you can't read its real length. So to change one header of a destination that has four or more other headers, send the values of the others again in the same request.

  - `State BetaTelemetryDestinationStateParamsUnion Optional`

    Whether the destination receives deliveries after the update. The field can't be `null`.

  - `Traces BetaTelemetryDestinationTracesParams Optional`

    The traces settings to change. Omitted settings keep their stored values.

    `null` sets every traces setting to its create default.

  - `Workspaces BetaTelemetryDestinationWorkspacesParamsUnion Optional`

    The new workspace scope, in the same form as on create. The field can't be `null`.

    The API refuses an update that changes the type or sends `workspace_ids` while the destination's list has more than 750 workspaces. Remove workspaces one at a time until 750 or fewer remain, then send the update again.

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestination`

  An OpenTelemetry destination: an OTLP/HTTP endpoint, the request headers sent with every delivery to it, what the exported spans contain, and which workspaces it covers. A destination belongs to an organization. A workspace's spans go to every enabled destination that covers it.

  - `Type TelemetryDestination`

  - `ID string`

    The unique ID of the destination (`tdst_...`).

  - `CreatedAt Time`

    Time the destination was created.

    format: date-time

  - `DeliveryHealth BetaTelemetryDestinationDeliveryHealth`

    The most recent delivery results for this destination.

    - `LastError string`

      A message that describes the most recent failed delivery to the destination, or `null` if no delivery has failed yet.

      Examples are `temporary DNS failure`, `TLS failure`, `timeout`, `connection failure`, `invalid address`, `HTTP error (status 503)`, and `redirect (status 301)`. The message is `invalid address` both for a hostname that doesn't exist and for an address that isn't publicly routable. It never contains the endpoint's response body, a header value, a network address, or TLS details.

      `last_error` and `last_error_at` always change together. A later successful delivery doesn't clear them. If `last_success_at` is later than `last_error_at`, a delivery has succeeded since this failure.

      See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-errors) to learn the likely cause of each error.

    - `LastErrorAt Time`

      Time of the failure that `last_error` describes. Changes together with `last_error`. Null until a delivery first fails.

      format: date-time

    - `LastSuccessAt Time`

      Time of the most recent successful delivery to the destination, or `null` if no delivery has succeeded yet.

      format: date-time

  - `DisplayName string`

    Human-readable name for the destination. Null when none was set.

  - `EndpointURL string`

    The base URL of the destination's OTLP/HTTP endpoint, exactly as registered.

    The API appends the per-signal path, such as `/v1/traces`, on delivery, unless `traces.endpoint_url` is set.

  - `HeaderNames []string`

    Names of the registered request headers. Header values are write-only and are never returned.

  - `State BetaTelemetryDestinationStateUnion`

    Whether the destination receives deliveries.

    - `type BetaTelemetryDestinationStateEnabled`

      The telemetry destination receives the spans of the workspaces that it covers.

      - `Type Enabled`

    - `type BetaTelemetryDestinationStateDisabled`

      The API doesn't deliver anything to the telemetry destination.

      Spans produced while it is disabled aren't delivered later.

      - `Type Disabled`

      - `Reason BetaTelemetryDestinationDisabledReasonUnion`

        Whether a caller or the API disabled the destination and, when the API did, why. Read-only.

        - `type BetaTelemetryDestinationDisabledReasonCaller`

          A caller disabled the destination with an update that set `state` to `disabled`.

          - `Type Caller`

        - `type BetaTelemetryDestinationDisabledReasonSustainedFailure`

          The API disabled the destination because deliveries to it failed, with no successful delivery in between, for longer than a threshold that Anthropic configures and that is not part of this contract. The reason is `invalid_address` instead when the most recent failed delivery failed with an invalid address.

          - `Type SustainedFailure`

        - `type BetaTelemetryDestinationDisabledReasonInvalidAddress`

          The API disabled the destination because deliveries to it failed for longer than the same threshold as for `sustained_failure`, and the most recent failed delivery failed with an invalid address: the DNS answer says that the endpoint's hostname doesn't exist or doesn't have an address, or the address that the API would connect to isn't publicly routable or is reserved, for example a loopback, link-local, private-network, or cloud-metadata address. The API doesn't connect to such an address, and retries the delivery a bounded number of times as it does after a timeout. A timeout or a server failure of the DNS lookup is a temporary DNS failure instead, not an invalid address.

          - `Type InvalidAddress`

        - `type BetaTelemetryDestinationDisabledReasonRedirect`

          The API disabled the destination because the endpoint answered a delivery with a 3xx status. Redirects are never followed, and one such answer disables the destination at once.

          - `Type Redirect`

  - `Traces BetaTelemetryDestinationTraces`

    The destination's settings for the traces it receives.

    - `ContentMode BetaTelemetryDestinationContentMode`

      What the exported spans contain.

      - `const BetaTelemetryDestinationContentModeMetadataOnly BetaTelemetryDestinationContentMode = "metadata_only"`

        The spans contain identifiers, timing, status, token counts, and similar metadata. They don't contain prompt text, completion text, or tool inputs and outputs.

      - `const BetaTelemetryDestinationContentModeContent BetaTelemetryDestinationContentMode = "content"`

        The spans contain the same metadata as `metadata_only`, plus message and tool content.

        An organization with a data-handling restriction, such as under HIPAA, can't choose this mode. The API exports only metadata for such an organization, even to a destination that already has `content`.

    - `Enabled bool`

      Whether the destination receives traces. A destination whose `enabled` is false keeps its other settings.

    - `EndpointURL string`

      The full URL that the API posts traces to, exactly as registered, or `null` if the destination doesn't have one.

      When it is `null`, the API posts traces to `endpoint_url` with `/v1/traces` appended.

    - `MaxContentBytes int64`

      The most bytes of content that one exported span can contain, or `null` if only the API's maximum applies.

      Content means model prompts and responses, and tool inputs and outputs. The API shortens longer content to this size before it delivers the span. A destination whose `content_mode` is `metadata_only` keeps this value. It applies once `content_mode` is `content`.

      format: int32

  - `UpdatedAt Time`

    Time of the last change to the destination's configuration or state. Changes to `delivery_health` don't change it.

    An update that sets a header value always changes it, even when the value is the same as before. Adding or removing a single workspace on the destination's list doesn't change it. An update that changes the list does.

    format: date-time

  - `Workspaces BetaTelemetryDestinationWorkspacesUnion`

    Which of the organization's workspaces the destination covers.

    - `type BetaTelemetryDestinationWorkspacesAll`

      The destination covers every workspace of the organization, including the default workspace, archived workspaces, and workspaces created later. It doesn't have a list.

      - `Type All`

    - `type BetaTelemetryDestinationWorkspacesInclude`

      The destination covers the workspaces on its list, and no others.

      - `Type Include`

    - `type BetaTelemetryDestinationWorkspacesExclude`

      The destination covers every workspace of the organization except the workspaces on its list. A workspace created later is covered until it is added to the list.

      - `Type Exclude`

#### 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"),
	)
	betaTelemetryDestination, err := client.Beta.Organization.TelemetryDestinations.Update(
		context.TODO(),
		"destination_id",
		anthropic.BetaOrganizationTelemetryDestinationUpdateParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTelemetryDestination.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "delivery_health": {
    "last_error": "last_error",
    "last_error_at": "2019-12-27T18:11:19.117Z",
    "last_success_at": "2019-12-27T18:11:19.117Z"
  },
  "display_name": "display_name",
  "endpoint_url": "endpoint_url",
  "header_names": [
    "string"
  ],
  "state": {
    "type": "enabled"
  },
  "traces": {
    "content_mode": "metadata_only",
    "enabled": true,
    "endpoint_url": "endpoint_url",
    "max_content_bytes": 0
  },
  "type": "telemetry_destination",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "workspaces": {
    "type": "all"
  }
}
```

### Delete a Telemetry Destination

`client.Beta.Organization.TelemetryDestinations.Delete(ctx, destinationID, body) (*BetaDeletedTelemetryDestination, error)`

**DELETE** `/v1/organizations/telemetry_destinations/{destination_id}`

Delete a destination and its workspace list.

The API stops sending spans to the destination. The spans of the workspaces it covered still go to the other destinations that cover them. A deleted destination can't be read, listed, or restored.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#delivery-and-health) to learn more about managing a destination.

#### Parameters

- `destinationID string` (path parameter)

  ID of the destination (`tdst_...`).

- `body BetaOrganizationTelemetryDestinationDeleteParams`

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaDeletedTelemetryDestination`

  Confirmation that a destination was deleted.

  - `Type TelemetryDestinationDeleted`

  - `ID string`

    ID of the deleted destination (`tdst_...`).

#### 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"),
	)
	betaDeletedTelemetryDestination, err := client.Beta.Organization.TelemetryDestinations.Delete(
		context.TODO(),
		"destination_id",
		anthropic.BetaOrganizationTelemetryDestinationDeleteParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedTelemetryDestination.ID)
}
```

##### Response (200)

```json
{
  "id": "id",
  "type": "telemetry_destination_deleted"
}
```

### Test a Telemetry Destination

`client.Beta.Organization.TelemetryDestinations.Test(ctx, destinationID, body) (*BetaTelemetryDestinationTestResponse, error)`

**POST** `/v1/organizations/telemetry_destinations/{destination_id}/test`

Send one test span, named `anthropic.test`, to the destination with its registered headers, once and without retries, and report the destination's answer. The response is 200 whether or not the destination answered with a 2xx status: its `result` has the type `success`, or the type `failure` and the reason in `error`. The destination's configuration, `state` and `delivery_health` do not change. A disabled destination can be tested too. Wait 10 seconds between tests of one destination; a request that comes sooner may be answered with status 429.

#### Parameters

- `destinationID string` (path parameter)

  ID of the destination to test (starts with `tdst_`).

- `body BetaOrganizationTelemetryDestinationTestParams`

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestinationTestResponse`

  The result of one test span sent to a destination.

  - `Type TelemetryDestinationTest`

  - `Result BetaTelemetryDestinationTestResultUnion`

    How the test went: `success` when the destination answered with a 2xx status, else `failure` with the reason.

    - `type BetaTelemetryDestinationTestSuccess`

      The destination answered the test span with a 2xx status.

      - `Type Success`

    - `type BetaTelemetryDestinationTestFailure`

      The test span was not delivered.

      - `Type Failure`

      - `Error string`

        A message that describes why the test span was not delivered, including the HTTP status code when the destination returned one. Examples: `HTTP error (status 403)`, `timeout`, `TLS failure`. It has the same form as the destination's `delivery_health.last_error` and never contains the destination's response body, any header value, a network address, or TLS details.

#### 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"),
	)
	betaTelemetryDestinationTestResponse, err := client.Beta.Organization.TelemetryDestinations.Test(
		context.TODO(),
		"destination_id",
		anthropic.BetaOrganizationTelemetryDestinationTestParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTelemetryDestinationTestResponse.Result)
}
```

##### Response (200)

```json
{
  "result": {
    "type": "success"
  },
  "type": "telemetry_destination_test"
}
```

## Beta › Organization › Telemetry Destinations › Workspaces

### List Telemetry Destination Workspaces

`client.Beta.Organization.TelemetryDestinations.Workspaces.List(ctx, destinationID, params) (*PageCursor[BetaTelemetryDestinationWorkspace], error)`

**GET** `/v1/organizations/telemetry_destinations/{destination_id}/workspaces`

List the workspaces on a destination's workspace list, newest entry first.

A destination whose `workspaces.type` is `all` doesn't have a list, so its page is empty. The list includes archived workspaces.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#choose-workspaces-for-a-destination) to learn more about choosing the workspaces of a destination.

#### Parameters

- `destinationID string` (path parameter)

  ID of the destination (`tdst_...`).

- `params BetaOrganizationTelemetryDestinationWorkspaceListParams`

  - `Limit param.Opt[int64] Optional` (query parameter)

    Number of entries to return per page, between 1 and 1,000. Defaults to 20.

    format: int32

  - `Page param.Opt[string] Optional` (query parameter)

    Opaque cursor from a previous response's `next_page`. Leave it out to get the first page.

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestinationWorkspace`

  A workspace on a telemetry destination's workspace list.

  Under `include`, the destination covers the workspace. Under `exclude`, the destination covers every workspace except this one. The entry doesn't have an `id`. Its `telemetry_destination_id` and `workspace_id` together identify it.

  - `Type TelemetryDestinationWorkspace`

  - `CreatedAt Time`

    Time the workspace was added to the list.

    format: date-time

  - `TelemetryDestinationID string`

    ID of the telemetry destination (`tdst_...`).

  - `WorkspaceID string`

    ID of the workspace (`wrkspc_...`).

#### 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"),
	)
	page, err := client.Beta.Organization.TelemetryDestinations.Workspaces.List(
		context.TODO(),
		"destination_id",
		anthropic.BetaOrganizationTelemetryDestinationWorkspaceListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
```

##### Response (200)

```json
{
  "data": [
    {
      "created_at": "2019-12-27T18:11:19.117Z",
      "telemetry_destination_id": "telemetry_destination_id",
      "type": "telemetry_destination_workspace",
      "workspace_id": "workspace_id"
    }
  ],
  "next_page": "next_page"
}
```

### Add a Telemetry Destination Workspace

`client.Beta.Organization.TelemetryDestinations.Workspaces.Add(ctx, workspaceID, params) (*BetaTelemetryDestinationWorkspace, error)`

**POST** `/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}`

Add one workspace to a destination's workspace list.

Under `include` the workspace's spans start going to the destination. Under `exclude` they stop. A list holds at most 1,000 workspaces.

Adding a workspace that is already on the list changes nothing and returns the existing entry. An archived workspace that isn't on the list yet can't be added. A destination whose `workspaces.type` is `all` doesn't have a list, so the API returns 400. To change which workspaces such a destination covers, update its `workspaces`.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#choose-workspaces-for-a-destination) to learn more about choosing the workspaces of a destination.

#### Parameters

- `workspaceID string` (path parameter)

  ID of the workspace to add (`wrkspc_...`).

- `params BetaOrganizationTelemetryDestinationWorkspaceAddParams`

  - `DestinationID string` (path parameter)

    ID of the destination (`tdst_...`).

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaTelemetryDestinationWorkspace`

  A workspace on a telemetry destination's workspace list.

  Under `include`, the destination covers the workspace. Under `exclude`, the destination covers every workspace except this one. The entry doesn't have an `id`. Its `telemetry_destination_id` and `workspace_id` together identify it.

  - `Type TelemetryDestinationWorkspace`

  - `CreatedAt Time`

    Time the workspace was added to the list.

    format: date-time

  - `TelemetryDestinationID string`

    ID of the telemetry destination (`tdst_...`).

  - `WorkspaceID string`

    ID of the workspace (`wrkspc_...`).

#### 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"),
	)
	betaTelemetryDestinationWorkspace, err := client.Beta.Organization.TelemetryDestinations.Workspaces.Add(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationTelemetryDestinationWorkspaceAddParams{
			DestinationID: "destination_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaTelemetryDestinationWorkspace.TelemetryDestinationID)
}
```

##### Response (200)

```json
{
  "created_at": "2019-12-27T18:11:19.117Z",
  "telemetry_destination_id": "telemetry_destination_id",
  "type": "telemetry_destination_workspace",
  "workspace_id": "workspace_id"
}
```

### Remove a Telemetry Destination Workspace

`client.Beta.Organization.TelemetryDestinations.Workspaces.Remove(ctx, workspaceID, params) (*BetaDeletedTelemetryDestinationWorkspace, error)`

**DELETE** `/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}`

Remove one workspace from a destination's workspace list.

Under `include` the workspace's spans stop going to the destination. Under `exclude` they start. An archived workspace can be removed too.

The API returns 404 when the workspace isn't on the list. A destination whose `workspaces.type` is `all` doesn't have a list, so the API returns 400.

See the [OpenTelemetry export guide](https://platform.claude.com/docs/en/manage-claude/opentelemetry?sdk_languages=go#choose-workspaces-for-a-destination) to learn more about choosing the workspaces of a destination.

#### Parameters

- `workspaceID string` (path parameter)

  ID of the workspace to remove (`wrkspc_...`).

- `params BetaOrganizationTelemetryDestinationWorkspaceRemoveParams`

  - `DestinationID string` (path parameter)

    ID of the destination (`tdst_...`).

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

    This endpoint is in beta: requests must send `telemetry-destinations-2026-08-11` in this header.

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

#### Returns

- `type BetaDeletedTelemetryDestinationWorkspace`

  Confirmation that a workspace was removed from a destination's list.

  - `Type TelemetryDestinationWorkspaceDeleted`

  - `TelemetryDestinationID string`

    ID of the telemetry destination (`tdst_...`).

  - `WorkspaceID string`

    ID of the workspace that was removed (`wrkspc_...`).

#### 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"),
	)
	betaDeletedTelemetryDestinationWorkspace, err := client.Beta.Organization.TelemetryDestinations.Workspaces.Remove(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationTelemetryDestinationWorkspaceRemoveParams{
			DestinationID: "destination_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaDeletedTelemetryDestinationWorkspace.TelemetryDestinationID)
}
```

##### Response (200)

```json
{
  "telemetry_destination_id": "telemetry_destination_id",
  "type": "telemetry_destination_workspace_deleted",
  "workspace_id": "workspace_id"
}
```
