> ## Documentation Index
> Fetch the complete documentation index at: https://oma-codex-339-workspace-permissions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Session Thread

> Get Session Thread through the OMA API.

<Info>Every request requires `?beta=true`.</Info>


## OpenAPI

````yaml /openapi/oma.en.json get /v1/sessions/{session_id}/threads/{thread_id}
openapi: 3.1.0
info:
  title: OMA API Reference
  version: 1.0.0
  description: Open Managed Agents application API reference.
servers:
  - url: http://localhost:38080
    description: Local OMA server
security:
  - omaApiKey: []
  - omaBearer: []
paths:
  /v1/sessions/{session_id}/threads/{thread_id}:
    get:
      summary: Get Session Thread
      operationId: BetaGetSessionThread
      parameters:
        - name: beta
          in: query
          required: true
          description: Selects the beta API contract for this endpoint. Must be `true`.
          schema:
            type: boolean
            enum:
              - true
        - name: anthropic-version
          in: header
          required: false
          schema:
            type: string
        - name: anthropic-beta
          in: header
          required: false
          schema:
            type: string
            items:
              type: string
            x-stainless-override-schema:
              x-stainless-param: betas
              x-stainless-extend-default: true
              type: array
              description: Optional header to specify the beta version(s) you want to use.
              items:
                $ref: '#/components/schemas/AnthropicBeta'
            x-default: managed-agents-2026-04-01
        - name: session_id
          in: path
          required: true
          schema:
            type: string
          description: Path parameter session_id
          example: sesn_011CZkZAtmR3yMPDzynEDxu7
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
          description: Path parameter thread_id
          example: sthr_011CZkZVWa6oIjw0rgXZpnBt
      responses:
        '200':
          description: Successful response (OK)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsSessionThread'
        '400':
          description: Invalid argument - The client specified an invalid argument
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '401':
          description: >-
            Unauthenticated - The request does not have valid authentication
            credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '403':
          description: >-
            Permission denied - The caller does not have permission to execute
            the specified operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '404':
          description: Not found - Some requested entity was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '408':
          description: >-
            Deadline exceeded - The deadline expired before the operation could
            complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '409':
          description: Aborted - The operation was aborted due to concurrency issue
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '412':
          description: >-
            Failed precondition - Operation was rejected because the system is
            not in required state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '413':
          description: Out of range - Operation was attempted past the valid range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '429':
          description: >-
            Resource exhausted - Some resource has been exhausted (rate
            limiting)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '431':
          description: Request header fields too large - Request metadata was too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '499':
          description: Cancelled - The operation was cancelled by the client
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '500':
          description: Internal - Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '501':
          description: Unimplemented - The operation is not implemented or supported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '503':
          description: Unavailable - The service is currently unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '504':
          description: Deadline exceeded - Upstream service did not respond in time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
components:
  schemas:
    BetaManagedAgentsSessionThread:
      description: >-
        An execution thread within a `session`. Each session has one primary
        thread plus zero or more child threads spawned by the coordinator.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - session_id
        - status
        - agent
        - parent_thread_id
        - created_at
        - updated_at
        - archived_at
        - usage
        - stats
      properties:
        type:
          type: string
          enum:
            - session_thread
          examples:
            - session_thread
        id:
          description: Unique identifier for this thread.
          type: string
          examples:
            - sthr_011CZkZVWa6oIjw0rgXZpnBt
        session_id:
          description: The session this thread belongs to.
          type: string
          examples:
            - sesn_011CZkZAtmR3yMPDzynEDxu7
        status:
          description: Current execution status of the thread.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadStatus'
          examples:
            - idle
        agent:
          description: >-
            Resolved agent definition for this thread. Snapshot of the agent at
            thread creation time.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionRosterEntry'
          examples:
            - type: agent
              id: agent_011CZkYqphY8vELVzwCUpqiQ
              version: 1
              name: Researcher
              description: A focused research subagent.
              model:
                id: claude-sonnet-4-6
                speed: standard
              system: >-
                You are a research subagent that gathers and summarises sources
                for the coordinating agent.
              tools:
                - type: agent_toolset_20260401
                  default_config:
                    enabled: true
                    permission_policy:
                      type: always_ask
                  configs: []
              mcp_servers: []
              skills: []
        parent_thread_id:
          description: Parent thread that spawned this thread. Null for the primary thread.
          type: string
          nullable: true
          examples:
            - null
        created_at:
          description: When the thread was created.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        updated_at:
          description: When the thread was last updated.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        archived_at:
          description: When the thread was archived. Null if not archived.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - null
        usage:
          description: >-
            Cumulative token usage for this thread. Null until the thread's
            first idle transition.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadUsage'
          nullable: true
          examples:
            - input_tokens: 0
              output_tokens: 0
              cache_read_input_tokens: 0
              cache_creation:
                ephemeral_5m_input_tokens: 0
                ephemeral_1h_input_tokens: 0
        stats:
          description: >-
            Timing statistics for this thread. Null until the thread's first
            status transition.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadStats'
          nullable: true
          examples:
            - duration_seconds: 0
              startup_seconds: 0
              active_seconds: 0
      example:
        type: session_thread
        id: sthr_011CZkZVWa6oIjw0rgXZpnBt
        session_id: sesn_011CZkZAtmR3yMPDzynEDxu7
        status: idle
        agent:
          type: agent
          id: agent_011CZkYqphY8vELVzwCUpqiQ
          version: 1
          name: Researcher
          description: A focused research subagent.
          model:
            id: claude-sonnet-4-6
            speed: standard
          system: >-
            You are a research subagent that gathers and summarises sources for
            the coordinating agent.
          tools:
            - type: agent_toolset_20260401
              default_config:
                enabled: true
                permission_policy:
                  type: always_ask
              configs: []
          mcp_servers: []
          skills: []
        parent_thread_id: null
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
        archived_at: null
        usage:
          input_tokens: 0
          output_tokens: 0
          cache_read_input_tokens: 0
          cache_creation:
            ephemeral_5m_input_tokens: 0
            ephemeral_1h_input_tokens: 0
        stats:
          duration_seconds: 0
          startup_seconds: 0
          active_seconds: 0
    BetaErrorResponse:
      properties:
        error:
          discriminator:
            mapping:
              api_error:
                $ref: '#/components/schemas/BetaAPIError'
              authentication_error:
                $ref: '#/components/schemas/BetaAuthenticationError'
              billing_error:
                $ref: '#/components/schemas/BetaBillingError'
              invalid_request_error:
                $ref: '#/components/schemas/BetaInvalidRequestError'
              not_found_error:
                $ref: '#/components/schemas/BetaNotFoundError'
              overloaded_error:
                $ref: '#/components/schemas/BetaOverloadedError'
              permission_error:
                $ref: '#/components/schemas/BetaPermissionError'
              rate_limit_error:
                $ref: '#/components/schemas/BetaRateLimitError'
              timeout_error:
                $ref: '#/components/schemas/BetaGatewayTimeoutError'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaInvalidRequestError'
            - $ref: '#/components/schemas/BetaAuthenticationError'
            - $ref: '#/components/schemas/BetaBillingError'
            - $ref: '#/components/schemas/BetaPermissionError'
            - $ref: '#/components/schemas/BetaNotFoundError'
            - $ref: '#/components/schemas/BetaRateLimitError'
            - $ref: '#/components/schemas/BetaGatewayTimeoutError'
            - $ref: '#/components/schemas/BetaAPIError'
            - $ref: '#/components/schemas/BetaOverloadedError'
          title: Error
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        type:
          const: error
          default: error
          title: Type
          type: string
      required:
        - error
        - request_id
        - type
      title: ErrorResponse
      type: object
    BetaManagedAgentsSessionThreadStatus:
      type: string
      description: SessionThreadStatus enum
      enum:
        - running
        - idle
        - rescheduling
        - terminated
    BetaManagedAgentsSessionRosterEntry:
      description: A session-resolved multiagent roster entry.
      discriminator:
        propertyName: type
        mapping:
          agent:
            $ref: '#/components/schemas/BetaManagedAgentsSessionThreadAgent'
          advisor:
            $ref: '#/components/schemas/BetaManagedAgentsAdvisor'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadAgent'
        - $ref: '#/components/schemas/BetaManagedAgentsAdvisor'
    BetaTimestamp:
      description: A timestamp in RFC 3339 format
      type: string
      format: date-time
    BetaManagedAgentsSessionThreadUsage:
      description: Cumulative token usage for a session thread across all turns.
      type: object
      additionalProperties: false
      properties:
        input_tokens:
          description: Total input tokens consumed across all turns.
          type: integer
          format: int32
        output_tokens:
          description: Total output tokens generated across all turns.
          type: integer
          format: int32
        cache_read_input_tokens:
          description: Total tokens read from prompt cache.
          type: integer
          format: int32
        cache_creation:
          description: >-
            Tokens used to create prompt cache entries, broken down by cache
            TTL.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsCacheCreationUsage'
        list_cost:
          description: >-
            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.
          allOf:
            - $ref: '#/components/schemas/BetaMonetaryAmount'
          nullable: true
        active_seconds:
          description: >-
            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.
          type: number
          format: double
        server_tool_use:
          description: >-
            Cumulative server-executed tool usage across all turns of this
            thread. Absent until server-tool tracking is available for the
            thread.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsServerToolUsage'
          nullable: true
    BetaManagedAgentsSessionThreadStats:
      description: Timing statistics for a session thread.
      type: object
      additionalProperties: false
      properties:
        duration_seconds:
          description: >-
            Elapsed time since thread creation in seconds. For archived threads,
            frozen at the final update.
          type: number
          format: double
        startup_seconds:
          description: >-
            Time in seconds for the thread to begin running. Zero for child
            threads, which start immediately.
          type: number
          format: double
        active_seconds:
          description: >-
            Cumulative time in seconds the thread spent actively running.
            Excludes idle time.
          type: number
          format: double
    BetaAPIError:
      properties:
        message:
          default: Internal server error
          title: Message
          type: string
        type:
          const: api_error
          default: api_error
          title: Type
          type: string
      required:
        - message
        - type
      title: APIError
      type: object
    BetaAuthenticationError:
      properties:
        message:
          default: Authentication error
          title: Message
          type: string
        type:
          const: authentication_error
          default: authentication_error
          title: Type
          type: string
      required:
        - message
        - type
      title: AuthenticationError
      type: object
    BetaBillingError:
      properties:
        message:
          default: Billing error
          title: Message
          type: string
        type:
          const: billing_error
          default: billing_error
          title: Type
          type: string
      required:
        - message
        - type
      title: BillingError
      type: object
    BetaInvalidRequestError:
      properties:
        message:
          default: Invalid request
          title: Message
          type: string
        type:
          const: invalid_request_error
          default: invalid_request_error
          title: Type
          type: string
      required:
        - message
        - type
      title: InvalidRequestError
      type: object
    BetaNotFoundError:
      properties:
        message:
          default: Not found
          title: Message
          type: string
        type:
          const: not_found_error
          default: not_found_error
          title: Type
          type: string
      required:
        - message
        - type
      title: NotFoundError
      type: object
    BetaOverloadedError:
      properties:
        message:
          default: Overloaded
          title: Message
          type: string
        type:
          const: overloaded_error
          default: overloaded_error
          title: Type
          type: string
      required:
        - message
        - type
      title: OverloadedError
      type: object
    BetaPermissionError:
      properties:
        message:
          default: Permission denied
          title: Message
          type: string
        type:
          const: permission_error
          default: permission_error
          title: Type
          type: string
      required:
        - message
        - type
      title: PermissionError
      type: object
    BetaRateLimitError:
      properties:
        message:
          default: Rate limited
          title: Message
          type: string
        type:
          const: rate_limit_error
          default: rate_limit_error
          title: Type
          type: string
      required:
        - message
        - type
      title: RateLimitError
      type: object
    BetaGatewayTimeoutError:
      properties:
        message:
          default: Request timeout
          title: Message
          type: string
        type:
          const: timeout_error
          default: timeout_error
          title: Type
          type: string
      required:
        - message
        - type
      title: GatewayTimeoutError
      type: object
    BetaManagedAgentsSessionThreadAgent:
      description: >-
        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: object
      additionalProperties: false
      required:
        - type
        - id
        - version
        - name
        - description
        - model
        - system
        - tools
        - mcp_servers
        - skills
      properties:
        type:
          type: string
          enum:
            - agent
          examples:
            - agent
        id:
          type: string
          examples:
            - agent_011CZkYqphY8vELVzwCUpqiQ
        version:
          type: integer
          format: int32
          examples:
            - 1
        name:
          type: string
          examples:
            - Researcher
        description:
          type: string
          nullable: true
          examples:
            - A focused research subagent.
        model:
          $ref: '#/components/schemas/BetaManagedAgentsModelConfig'
          examples:
            - id: claude-sonnet-4-6
              speed: standard
        system:
          type: string
          nullable: true
          examples:
            - >-
              You are a research subagent that gathers and summarises sources
              for the coordinating agent.
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsAgentTool'
          examples:
            - - type: agent_toolset_20260401
                default_config:
                  enabled: true
                  permission_policy:
                    type: always_ask
                configs: []
        mcp_servers:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsMCPServer'
          examples:
            - []
        skills:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSkill'
          examples:
            - []
      example:
        type: agent
        id: agent_011CZkYqphY8vELVzwCUpqiQ
        version: 1
        name: Researcher
        description: A focused research subagent.
        model:
          id: claude-sonnet-4-6
          speed: standard
        system: >-
          You are a research subagent that gathers and summarises sources for
          the coordinating agent.
        tools:
          - type: agent_toolset_20260401
            default_config:
              enabled: true
              permission_policy:
                type: always_ask
            configs: []
        mcp_servers: []
        skills: []
    BetaManagedAgentsAdvisor:
      description: >-
        Platform advisor roster entry: a model the session's primary thread may
        consult mid-turn.
      type: object
      additionalProperties: false
      required:
        - model
        - type
      properties:
        model:
          description: The advisor model id.
          type: string
        type:
          type: string
          enum:
            - advisor
    BetaManagedAgentsCacheCreationUsage:
      description: Prompt-cache creation token usage broken down by cache lifetime.
      type: object
      additionalProperties: false
      properties:
        ephemeral_1h_input_tokens:
          description: Tokens used to create 1-hour ephemeral cache entries.
          type: integer
          format: int32
        ephemeral_5m_input_tokens:
          description: Tokens used to create 5-minute ephemeral cache entries.
          type: integer
          format: int32
    BetaMonetaryAmount:
      description: A monetary amount in a specific currency.
      type: object
      additionalProperties: false
      required:
        - currency
        - amount
      properties:
        currency:
          description: >-
            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.
          allOf:
            - $ref: '#/components/schemas/BetaCurrency'
          examples:
            - USD
        amount:
          description: >-
            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.
          type: string
          examples:
            - '2500'
      example:
        currency: USD
        amount: '2500'
    BetaManagedAgentsServerToolUsage:
      description: >-
        Cumulative count of server-executed tool invocations, broken down by
        tool.
      type: object
      additionalProperties: false
      properties:
        web_search_requests:
          description: Number of server-executed web search requests.
          type: integer
          format: int32
          examples:
            - 3
        web_fetch_requests:
          description: Number of server-executed web fetch requests.
          type: integer
          format: int32
          examples:
            - 0
      example:
        web_search_requests: 3
        web_fetch_requests: 0
    BetaManagedAgentsModelConfig:
      description: Model identifier and configuration.
      type: object
      additionalProperties: false
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/BetaManagedAgentsModel'
        effort:
          description: >-
            How hard the model 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.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsEffort'
          examples:
            - type: low
        inference_geo:
          description: >-
            Geographic region for model inference. When unset, requests fall
            through to the workspace's default_inference_geo.
          type: string
          examples:
            - inference_geo
        speed:
          description: >-
            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.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSpeed'
          examples:
            - standard
      example:
        id: claude-sonnet-4-6
        effort:
          type: low
        inference_geo: inference_geo
        speed: standard
    BetaManagedAgentsAgentTool:
      description: Union type for tool configurations returned in API responses.
      type: object
      discriminator:
        propertyName: type
        mapping:
          agent_toolset_20260401:
            $ref: '#/components/schemas/BetaManagedAgentsAgentToolset20260401'
          mcp_toolset:
            $ref: '#/components/schemas/BetaManagedAgentsMCPToolset'
          custom:
            $ref: '#/components/schemas/BetaManagedAgentsCustomTool'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsAgentToolset20260401'
        - $ref: '#/components/schemas/BetaManagedAgentsMCPToolset'
        - $ref: '#/components/schemas/BetaManagedAgentsCustomTool'
    BetaManagedAgentsMCPServer:
      description: >-
        Union type for MCP server connection definitions returned in API
        responses.
      type: object
      discriminator:
        propertyName: type
        mapping:
          url:
            $ref: '#/components/schemas/BetaManagedAgentsMCPServerURLDefinition'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsMCPServerURLDefinition'
    BetaManagedAgentsSkill:
      description: Resolved skill as returned in API responses.
      discriminator:
        propertyName: type
        mapping:
          anthropic:
            $ref: '#/components/schemas/BetaManagedAgentsAnthropicSkill'
          custom:
            $ref: '#/components/schemas/BetaManagedAgentsCustomSkill'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsAnthropicSkill'
        - $ref: '#/components/schemas/BetaManagedAgentsCustomSkill'
    BetaCurrency:
      type: string
      enum:
        - USD
    BetaManagedAgentsModel:
      title: BetaManagedAgentsModel
      description: |-
        The model that will power your agent.

        See models for additional details and options.
      anyOf:
        - type: string
        - const: claude-sonnet-5
          description: High-performance model for coding and agents
          x-stainless-nominal: false
        - const: claude-fable-5
          description: >-
            Next generation of intelligence for the hardest knowledge work and
            coding problems
          x-stainless-nominal: false
        - const: claude-opus-5
          description: Powerful intelligence for long-running agents and coding
          x-stainless-nominal: false
        - const: claude-opus-4-8
          description: Powerful intelligence for long-running agents and coding
          x-stainless-nominal: false
        - const: claude-opus-4-7
          description: Powerful intelligence for long-running agents and coding
          x-stainless-nominal: false
        - const: claude-opus-4-6
          description: Powerful intelligence for long-running agents and coding
          x-stainless-nominal: false
        - const: claude-sonnet-4-6
          description: Best combination of speed and intelligence
          x-stainless-nominal: false
        - const: claude-haiku-4-5
          description: Fastest model with near-frontier intelligence
          x-stainless-nominal: false
        - const: claude-haiku-4-5-20251001
          description: Fastest model with near-frontier intelligence
          x-stainless-nominal: false
        - const: claude-opus-4-5
          description: Powerful intelligence for long-running agents and coding
          x-stainless-nominal: false
        - const: claude-opus-4-5-20251101
          description: Powerful intelligence for long-running agents and coding
          x-stainless-nominal: false
        - const: claude-sonnet-4-5
          description: High-performance model for agents and coding
          x-stainless-nominal: false
        - const: claude-sonnet-4-5-20250929
          description: High-performance model for agents and coding
          x-stainless-nominal: false
    BetaManagedAgentsEffort:
      description: >-
        How hard the model works on each turn. Sets `output_config.effort` on
        every Messages call the session makes.
      type: object
      discriminator:
        propertyName: type
        mapping:
          low:
            $ref: '#/components/schemas/BetaManagedAgentsEffortLow'
          medium:
            $ref: '#/components/schemas/BetaManagedAgentsEffortMedium'
          high:
            $ref: '#/components/schemas/BetaManagedAgentsEffortHigh'
          xhigh:
            $ref: '#/components/schemas/BetaManagedAgentsEffortXhigh'
          max:
            $ref: '#/components/schemas/BetaManagedAgentsEffortMax'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsEffortLow'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortMedium'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortHigh'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortXhigh'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortMax'
    BetaManagedAgentsSpeed:
      type: string
      description: >-
        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.
      enum:
        - standard
        - fast
    BetaManagedAgentsAgentToolset20260401:
      type: object
      additionalProperties: false
      required:
        - configs
        - default_config
        - type
      properties:
        configs:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsAgentToolConfig'
        default_config:
          $ref: '#/components/schemas/BetaManagedAgentsAgentToolsetDefaultConfig'
        type:
          type: string
          enum:
            - agent_toolset_20260401
    BetaManagedAgentsMCPToolset:
      type: object
      additionalProperties: false
      required:
        - configs
        - default_config
        - mcp_server_name
        - type
      properties:
        configs:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsMCPToolConfig'
        default_config:
          $ref: '#/components/schemas/BetaManagedAgentsMCPToolsetDefaultConfig'
        mcp_server_name:
          type: string
        type:
          type: string
          enum:
            - mcp_toolset
    BetaManagedAgentsCustomTool:
      description: A custom tool as returned in API responses.
      type: object
      additionalProperties: false
      required:
        - description
        - input_schema
        - name
        - type
      properties:
        description:
          type: string
        input_schema:
          $ref: '#/components/schemas/BetaManagedAgentsCustomToolInputSchema'
        name:
          type: string
        type:
          type: string
          enum:
            - custom
    BetaManagedAgentsMCPServerURLDefinition:
      description: URL-based MCP server connection as returned in API responses.
      type: object
      additionalProperties: false
      required:
        - name
        - type
        - url
      properties:
        name:
          type: string
          examples:
            - example-mcp
        type:
          type: string
          enum:
            - url
          examples:
            - url
        url:
          type: string
          examples:
            - https://example-server.modelcontextprotocol.io/sse
      example:
        type: url
        name: example-mcp
        url: https://example-server.modelcontextprotocol.io/sse
    BetaManagedAgentsAnthropicSkill:
      description: A resolved OMA-managed skill.
      type: object
      additionalProperties: false
      required:
        - skill_id
        - type
        - version
      properties:
        skill_id:
          type: string
          examples:
            - xlsx
        type:
          type: string
          enum:
            - anthropic
          examples:
            - anthropic
        version:
          type: string
          examples:
            - '1'
      example:
        type: anthropic
        skill_id: xlsx
        version: '1'
    BetaManagedAgentsCustomSkill:
      description: A resolved user-created custom skill.
      type: object
      additionalProperties: false
      required:
        - skill_id
        - type
        - version
      properties:
        skill_id:
          type: string
          examples:
            - skill_011CZkZFNu9hAbo3jZPRgTlx
        type:
          type: string
          enum:
            - custom
          examples:
            - custom
        version:
          type: string
          examples:
            - '2'
      example:
        type: custom
        skill_id: skill_011CZkZFNu9hAbo3jZPRgTlx
        version: '2'
    BetaManagedAgentsEffortLow:
      description: Low effort. Favors latency over reasoning depth.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - low
    BetaManagedAgentsEffortMedium:
      description: Medium effort. Balances latency and reasoning depth.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - medium
    BetaManagedAgentsEffortHigh:
      description: High effort. Favors reasoning depth.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - high
    BetaManagedAgentsEffortXhigh:
      description: Extra-high effort. Not all models accept this level.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - xhigh
    BetaManagedAgentsEffortMax:
      description: Maximum effort. Favors reasoning depth over latency.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - max
    BetaManagedAgentsAgentToolConfig:
      description: Configuration for a specific agent tool.
      type: object
      additionalProperties: false
      required:
        - enabled
        - name
        - permission_policy
      properties:
        enabled:
          type: boolean
        name:
          $ref: '#/components/schemas/BetaManagedAgentsAgentToolName'
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsAgentToolsetDefaultConfig:
      description: Resolved default configuration for agent tools.
      type: object
      additionalProperties: false
      required:
        - enabled
        - permission_policy
      properties:
        enabled:
          type: boolean
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsMCPToolConfig:
      description: Resolved configuration for a specific MCP tool.
      type: object
      additionalProperties: false
      required:
        - enabled
        - name
        - permission_policy
      properties:
        enabled:
          type: boolean
        name:
          type: string
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsMCPToolsetDefaultConfig:
      description: Resolved default configuration for all tools from an MCP server.
      type: object
      additionalProperties: false
      required:
        - enabled
        - permission_policy
      properties:
        enabled:
          type: boolean
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsCustomToolInputSchema:
      additionalProperties: true
      description: JSON Schema for custom tool input parameters.
      properties:
        type:
          const: object
          title: Type
          type: string
        properties:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: Properties
          x-stainless-skip:
            - terraform
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Required
      required:
        - type
      type: object
    BetaManagedAgentsAgentToolName:
      type: string
      description: Built-in agent tool identifier.
      enum:
        - bash
        - edit
        - read
        - write
        - glob
        - grep
        - web_fetch
        - web_search
    BetaManagedAgentsPermissionPolicy:
      description: Permission policy for tool execution.
      type: object
      discriminator:
        propertyName: type
        mapping:
          always_allow:
            $ref: '#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy'
          always_ask:
            $ref: '#/components/schemas/BetaManagedAgentsAlwaysAskPolicy'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy'
        - $ref: '#/components/schemas/BetaManagedAgentsAlwaysAskPolicy'
    BetaManagedAgentsAlwaysAllowPolicy:
      description: Tool calls are automatically approved without user confirmation.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - always_allow
    BetaManagedAgentsAlwaysAskPolicy:
      description: Tool calls require user confirmation before execution.
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - always_ask
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA workspace API key.
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: OMA workspace API key sent as a bearer token.

````