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

> Get Session through the OMA API.

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


## OpenAPI

````yaml /openapi/oma.en.json get /v1/sessions/{session_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}:
    get:
      summary: Get Session
      operationId: BetaGetSession
      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
      responses:
        '200':
          description: Successful response (OK)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsSession'
        '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:
    BetaManagedAgentsSession:
      description: A Managed Agents `session`.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - status
        - created_at
        - updated_at
        - environment_id
        - title
        - metadata
        - agent
        - resources
        - vault_ids
        - outcome_evaluations
        - usage
        - stats
        - archived_at
        - budget
      properties:
        type:
          type: string
          enum:
            - session
          examples:
            - session
        id:
          type: string
          examples:
            - sesn_011CZkZAtmR3yMPDzynEDxu7
        status:
          $ref: '#/components/schemas/BetaManagedAgentsSessionStatus'
          examples:
            - idle
        created_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        updated_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        environment_id:
          type: string
          examples:
            - env_011CZkZ9X2dpNyB7HsEFoRfW
        title:
          type: string
          nullable: true
          examples:
            - 'Order #1234 inquiry'
        metadata:
          type: object
          additionalProperties:
            type: string
          examples:
            - key: value
        agent:
          $ref: '#/components/schemas/BetaManagedAgentsSessionAgent'
          examples:
            - type: agent
              id: agent_011CZkYpogX7uDKUyvBTophP
              version: 1
              name: My First Agent
              description: A general-purpose starter agent.
              model:
                id: claude-sonnet-4-6
                speed: standard
              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:
                - type: agent_toolset_20260401
                  default_config:
                    enabled: true
                    permission_policy:
                      type: always_ask
                  configs: []
              mcp_servers:
                - type: url
                  name: example-mcp
                  url: https://example-server.modelcontextprotocol.io/sse
              skills:
                - type: anthropic
                  skill_id: xlsx
                  version: '1'
                - type: custom
                  skill_id: skill_011CZkZFNu9hAbo3jZPRgTlx
                  version: '2'
              multiagent: null
        resources:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSessionResource'
          examples:
            - - type: file
                id: sesrsc_011CZkZBJq5dWxk9fVLNcPht
                file_id: file_011CNha8iCJcU1wXNR6q4V8w
                mount_path: /uploads/receipt.pdf
                created_at: '2026-03-15T10:00:00Z'
                updated_at: '2026-03-15T10:00:00Z'
              - type: github_repository
                id: sesrsc_011CZkZCKr6eXyl0gWMOdQiu
                url: https://github.com/example-org/example-repo
                mount_path: /workspace/example-repo
                checkout:
                  type: branch
                  name: main
                created_at: '2026-03-15T10:00:00Z'
                updated_at: '2026-03-15T10:00:00Z'
        vault_ids:
          description: >-
            Vault IDs attached to the session at creation. Empty when no vaults
            were supplied.
          type: array
          items:
            type: string
          examples:
            - - vlt_011CZkZDLs7fYzm1hXNPeRjv
        outcome_evaluations:
          description: >-
            Per-outcome evaluation state. One entry per define_outcome event
            sent to the session.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsOutcomeEvaluationResource'
          examples:
            - - type: outcome_evaluation
                outcome_id: outc_011CZkZRSw2kEfs6ncTVljxP
                description: Produce a 2-page summary as summary.md
                result: satisfied
                iteration: 0
                completed_at: '2026-03-15T10:02:31Z'
                explanation: All five sections present with inline citations.
        usage:
          description: Cumulative token usage for the session.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionUsage'
          examples:
            - input_tokens: 0
              output_tokens: 0
              cache_read_input_tokens: 0
        stats:
          description: Timing statistics for the session.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionStats'
          examples:
            - duration_seconds: 0
              active_seconds: 0
        archived_at:
          description: When the session was archived. Null if not archived.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - null
        deployment_id:
          description: >-
            Deployment ID when the session was created from a deployment
            reference. Null otherwise.
          type: string
          nullable: true
        budget:
          description: The session's enforced spend ceiling, or null when no budget is set.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsBudget'
          nullable: true
          examples:
            - null
      example:
        type: session
        id: sesn_011CZkZAtmR3yMPDzynEDxu7
        status: idle
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
        archived_at: null
        budget: null
        environment_id: env_011CZkZ9X2dpNyB7HsEFoRfW
        title: 'Order #1234 inquiry'
        metadata: {}
        agent:
          type: agent
          id: agent_011CZkYpogX7uDKUyvBTophP
          version: 1
          name: My First Agent
          description: A general-purpose starter agent.
          model:
            id: claude-sonnet-4-6
            speed: standard
          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:
            - type: agent_toolset_20260401
              default_config:
                enabled: true
                permission_policy:
                  type: always_ask
              configs: []
          mcp_servers:
            - type: url
              name: example-mcp
              url: https://example-server.modelcontextprotocol.io/sse
          skills:
            - type: anthropic
              skill_id: xlsx
              version: '1'
            - type: custom
              skill_id: skill_011CZkZFNu9hAbo3jZPRgTlx
              version: '2'
          multiagent: null
        resources:
          - type: file
            id: sesrsc_011CZkZBJq5dWxk9fVLNcPht
            file_id: file_011CNha8iCJcU1wXNR6q4V8w
            mount_path: /uploads/receipt.pdf
            created_at: '2026-03-15T10:00:00Z'
            updated_at: '2026-03-15T10:00:00Z'
          - type: github_repository
            id: sesrsc_011CZkZCKr6eXyl0gWMOdQiu
            url: https://github.com/example-org/example-repo
            mount_path: /workspace/example-repo
            checkout:
              type: branch
              name: main
            created_at: '2026-03-15T10:00:00Z'
            updated_at: '2026-03-15T10:00:00Z'
        vault_ids:
          - vlt_011CZkZDLs7fYzm1hXNPeRjv
        usage:
          input_tokens: 0
          output_tokens: 0
          cache_read_input_tokens: 0
        stats:
          duration_seconds: 0
          active_seconds: 0
        outcome_evaluations:
          - type: outcome_evaluation
            outcome_id: outc_011CZkZRSw2kEfs6ncTVljxP
            description: Produce a 2-page summary as summary.md
            result: satisfied
            iteration: 0
            completed_at: '2026-03-15T10:02:31Z'
            explanation: All five sections present with inline citations.
    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
    BetaManagedAgentsSessionStatus:
      type: string
      description: SessionStatus enum
      enum:
        - rescheduling
        - running
        - idle
        - terminated
    BetaTimestamp:
      description: A timestamp in RFC 3339 format
      type: string
      format: date-time
    BetaManagedAgentsSessionAgent:
      description: >-
        Resolved `agent` definition for a `session`. Snapshot of the `agent` at
        `session` creation time.
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - version
        - name
        - description
        - model
        - system
        - tools
        - mcp_servers
        - skills
        - multiagent
      properties:
        type:
          type: string
          enum:
            - agent
          examples:
            - agent
        id:
          type: string
          examples:
            - agent_011CZkYpogX7uDKUyvBTophP
        version:
          type: integer
          format: int32
          examples:
            - 1
        name:
          type: string
          examples:
            - My First Agent
        description:
          type: string
          nullable: true
          examples:
            - A general-purpose starter agent.
        model:
          $ref: '#/components/schemas/BetaManagedAgentsModelConfig'
          examples:
            - id: claude-sonnet-4-6
              speed: standard
        system:
          type: string
          nullable: true
          examples:
            - >-
              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:
          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:
            - - type: url
                name: example-mcp
                url: https://example-server.modelcontextprotocol.io/sse
        skills:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSkill'
          examples:
            - - type: anthropic
                skill_id: xlsx
                version: '1'
              - type: custom
                skill_id: skill_011CZkZFNu9hAbo3jZPRgTlx
                version: '2'
        multiagent:
          description: >-
            Resolved multiagent orchestration configuration. Null when the agent
            is single-threaded.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionMultiagent'
          nullable: true
          examples:
            - null
      example:
        type: agent
        id: agent_011CZkYpogX7uDKUyvBTophP
        version: 1
        name: My First Agent
        description: A general-purpose starter agent.
        model:
          id: claude-sonnet-4-6
          speed: standard
        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:
          - type: agent_toolset_20260401
            default_config:
              enabled: true
              permission_policy:
                type: always_ask
            configs: []
        mcp_servers:
          - type: url
            name: example-mcp
            url: https://example-server.modelcontextprotocol.io/sse
        skills:
          - type: anthropic
            skill_id: xlsx
            version: '1'
          - type: custom
            skill_id: skill_011CZkZFNu9hAbo3jZPRgTlx
            version: '2'
        multiagent: null
    BetaManagedAgentsSessionResource:
      type: object
      discriminator:
        propertyName: type
        mapping:
          github_repository:
            $ref: '#/components/schemas/BetaManagedAgentsGitHubRepositoryResource'
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileResource'
          memory_store:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryStoreResource'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsGitHubRepositoryResource'
        - $ref: '#/components/schemas/BetaManagedAgentsFileResource'
        - $ref: '#/components/schemas/BetaManagedAgentsMemoryStoreResource'
    BetaManagedAgentsOutcomeEvaluationResource:
      description: >-
        Evaluation state for a single outcome defined via a define_outcome
        event.
      type: object
      additionalProperties: false
      required:
        - type
        - outcome_id
        - description
        - result
        - iteration
        - completed_at
        - explanation
      properties:
        type:
          type: string
          enum:
            - outcome_evaluation
          examples:
            - outcome_evaluation
        outcome_id:
          description: Server-generated outc_ ID for this outcome.
          type: string
          examples:
            - outc_011CZkZRSw2kEfs6ncTVljxP
        description:
          description: What the agent should produce.
          type: string
          examples:
            - Produce a 2-page summary as summary.md
        result:
          description: >-
            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.
          type: string
          examples:
            - satisfied
        iteration:
          description: 0-indexed revision cycle the outcome is currently on.
          type: integer
          format: int32
          examples:
            - 0
        completed_at:
          description: >-
            When the outcome reached a terminal result. Null while
            pending/running/evaluating.
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - '2026-03-15T10:02:31Z'
        explanation:
          description: >-
            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.
          type: string
          nullable: true
          examples:
            - All five sections present with inline citations.
      example:
        type: outcome_evaluation
        outcome_id: outc_011CZkZRSw2kEfs6ncTVljxP
        description: Produce a 2-page summary as summary.md
        result: satisfied
        iteration: 0
        completed_at: '2026-03-15T10:02:31Z'
        explanation: All five sections present with inline citations.
    BetaManagedAgentsSessionUsage:
      description: Cumulative token usage for a session 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 the session across all turns, priced at
            public list rates. Absent until cost tracking is available for the
            session.
          allOf:
            - $ref: '#/components/schemas/BetaMonetaryAmount'
          nullable: true
        server_tool_use:
          description: >-
            Cumulative server-executed tool usage across all turns. Absent until
            server-tool tracking is available for the session.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsServerToolUsage'
          nullable: true
        active_seconds:
          description: >-
            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.
          type: number
          format: double
    BetaManagedAgentsSessionStats:
      description: Timing statistics for a session.
      type: object
      additionalProperties: false
      properties:
        duration_seconds:
          description: >-
            Elapsed time since session creation in seconds. For terminated
            sessions, frozen at the final update.
          type: number
          format: double
        active_seconds:
          description: >-
            Cumulative time in seconds the session spent in running status.
            Excludes idle time.
          type: number
          format: double
    BetaManagedAgentsBudget:
      description: >-
        An enforced spend ceiling on a session. Discriminated on `type`; `limit`
        is the only kind currently supported.
      type: object
      discriminator:
        propertyName: type
        mapping:
          limit:
            $ref: '#/components/schemas/BetaManagedAgentsBudgetLimit'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBudgetLimit'
    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
    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'
    BetaManagedAgentsSessionMultiagent:
      description: >-
        Resolved multiagent orchestration configuration as returned on a
        `session`.
      discriminator:
        propertyName: type
        mapping:
          coordinator:
            $ref: '#/components/schemas/BetaManagedAgentsSessionMultiagentCoordinator'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsSessionMultiagentCoordinator'
    BetaManagedAgentsGitHubRepositoryResource:
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - url
        - mount_path
        - created_at
        - updated_at
      properties:
        type:
          type: string
          enum:
            - github_repository
          examples:
            - github_repository
        id:
          type: string
          examples:
            - sesrsc_011CZkZCKr6eXyl0gWMOdQiu
        url:
          type: string
          examples:
            - https://github.com/example-org/example-repo
        mount_path:
          type: string
          examples:
            - /workspace/example-repo
        checkout:
          $ref: '#/components/schemas/BetaManagedAgentsRepositoryCheckout'
          nullable: true
          examples:
            - type: branch
              name: main
        created_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        updated_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
      example:
        type: github_repository
        id: sesrsc_011CZkZCKr6eXyl0gWMOdQiu
        url: https://github.com/example-org/example-repo
        mount_path: /workspace/example-repo
        checkout:
          type: branch
          name: main
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
    BetaManagedAgentsFileResource:
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - file_id
        - mount_path
        - created_at
        - updated_at
      properties:
        type:
          type: string
          enum:
            - file
          examples:
            - file
        id:
          type: string
          examples:
            - sesrsc_011CZkZBJq5dWxk9fVLNcPht
        file_id:
          type: string
          examples:
            - file_011CNha8iCJcU1wXNR6q4V8w
        mount_path:
          type: string
          examples:
            - /uploads/receipt.pdf
        created_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        updated_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
      example:
        type: file
        id: sesrsc_011CZkZBJq5dWxk9fVLNcPht
        file_id: file_011CNha8iCJcU1wXNR6q4V8w
        mount_path: /uploads/receipt.pdf
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
    BetaManagedAgentsMemoryStoreResource:
      description: A memory store attached to an agent session.
      type: object
      additionalProperties: false
      required:
        - type
        - memory_store_id
      properties:
        type:
          type: string
          enum:
            - memory_store
        memory_store_id:
          description: >-
            The memory store ID (memstore_...). Must belong to the caller's
            organization and workspace.
          type: string
        access:
          description: >-
            Access mode for the mounted store. Defaults to read_write. read_only
            mounts the store as a read-only filesystem.
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsMountMode'
          nullable: true
        name:
          description: >-
            Display name of the memory store, snapshotted at attach time. Later
            edits to the store's name do not propagate to this resource.
          type: string
          nullable: true
        description:
          description: >-
            Description of the memory store, snapshotted at attach time.
            Rendered into the agent's system prompt. Empty string when the store
            has no description.
          type: string
        instructions:
          description: >-
            Per-attachment guidance for the agent on how to use this store.
            Rendered into the memory section of the system prompt. Max 4096
            chars.
          type: string
          maxLength: 4096
          nullable: true
        mount_path:
          description: >-
            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.
          type: string
          nullable: true
    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
    BetaManagedAgentsBudgetLimit:
      description: >-
        A hard spend ceiling. The session stops issuing new model requests once
        the tracked list cost reaches `max_list_cost`.
      type: object
      additionalProperties: false
      required:
        - type
        - max_list_cost
      properties:
        type:
          type: string
          enum:
            - limit
        max_list_cost:
          description: >-
            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.
          allOf:
            - $ref: '#/components/schemas/BetaMonetaryAmount'
    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'
    BetaManagedAgentsSessionMultiagentCoordinator:
      description: >-
        Resolved coordinator topology with full agent definitions for each
        roster member.
      type: object
      additionalProperties: false
      required:
        - type
        - agents
      properties:
        type:
          type: string
          enum:
            - coordinator
        agents:
          description: >-
            Full `agent` definitions the coordinator may spawn as session
            threads.
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSessionRosterEntry'
    BetaManagedAgentsRepositoryCheckout:
      type: object
      discriminator:
        propertyName: type
        mapping:
          branch:
            $ref: '#/components/schemas/BetaManagedAgentsBranchCheckout'
          commit:
            $ref: '#/components/schemas/BetaManagedAgentsCommitCheckout'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBranchCheckout'
        - $ref: '#/components/schemas/BetaManagedAgentsCommitCheckout'
    BetaManagedAgentsMountMode:
      type: string
      description: Access mode for an attached memory store.
      enum:
        - read_write
        - read_only
    BetaCurrency:
      type: string
      enum:
        - USD
    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
    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'
    BetaManagedAgentsBranchCheckout:
      type: object
      additionalProperties: false
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - branch
          examples:
            - branch
        name:
          description: Branch name to check out.
          type: string
          minLength: 1
          maxLength: 255
          examples:
            - main
      example:
        type: branch
        name: main
    BetaManagedAgentsCommitCheckout:
      type: object
      additionalProperties: false
      required:
        - type
        - sha
      properties:
        type:
          type: string
          enum:
            - commit
        sha:
          description: Full commit SHA to check out.
          type: string
          minLength: 7
          maxLength: 64
    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'
    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
    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.

````