> ## Documentation Index
> Fetch the complete documentation index at: https://docs.labelbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start a managed session

> Starts a managed agent session and returns 202 with its sessionId and statusUrl; the agent runs asynchronously, so poll managedAgentsGetSessionV2 or subscribe with managedAgentsStreamSessionEventsV2 to follow it. Omit environmentId to run without an own sandbox and use the on-demand compute tools; a selected environment keeps its own sandbox. Model calls and running compute are billed. Requires an Idempotency-Key header: the same key with the exact HTTP method, escaped path, raw query, and raw body bytes returns the original session; any difference is rejected. A reasoning_effort incompatible with the selected model or its frozen output capacity returns 400 before provisioning. Enabled provider_params.promptCacheTTL or provider_params.promptCacheSharedTTL settings with invalid values, an unsupported model, or shared retention shorter than history retention also return 400 before provisioning for the selected root agent version, including for previously stored agent versions. Roster agent cache settings are validated at delegation before creating each child session. A temporarily unavailable model reference or catalog dependency returns 503. An environment on managed compute whose setup script has no verified, current run returns 422 environment_not_verified before provisioning; run managedAgentsCreateEnvironmentSetupRunV2 first. When the tenant is out of credit it returns 403 session_start_not_admitted with details.reason out_of_credit; add credits and retry. When the tenant is suspended it returns the same 403 with details.reason tenant_suspended. A budget above the agent's multiagent.limits.max_tree_cost_usd returns 400. When the tenant already has as many sessions working at once as it may, it returns 429 tenant_concurrency_limit with details.limit; wait for a session to finish its turn or stop one, then retry.



## OpenAPI

````yaml /recursion/openapi.yaml post /managed-agents/v2/sessions
openapi: 3.1.0
info:
  title: Managed Agents API
  version: 0.16.0
  description: >-
    The Recursion Managed Agents REST API. Authenticate with a Recursion API key
    as a bearer token. An organization-scoped key acts in its own organization
    and needs nothing else; a tenant-scoped key must also send
    `x-organization-id` with an organization id or `default`. Field names follow
    each operation's published schema.
servers:
  - url: https://api.recursion.labelbox.com
security:
  - bearerAuth: []
paths:
  /managed-agents/v2/sessions:
    post:
      tags:
        - Sessions
      summary: Start a managed session
      description: >-
        Starts a managed agent session and returns 202 with its sessionId and
        statusUrl; the agent runs asynchronously, so poll
        managedAgentsGetSessionV2 or subscribe with
        managedAgentsStreamSessionEventsV2 to follow it. Omit environmentId to
        run without an own sandbox and use the on-demand compute tools; a
        selected environment keeps its own sandbox. Model calls and running
        compute are billed. Requires an Idempotency-Key header: the same key
        with the exact HTTP method, escaped path, raw query, and raw body bytes
        returns the original session; any difference is rejected. A
        reasoning_effort incompatible with the selected model or its frozen
        output capacity returns 400 before provisioning. Enabled
        provider_params.promptCacheTTL or provider_params.promptCacheSharedTTL
        settings with invalid values, an unsupported model, or shared retention
        shorter than history retention also return 400 before provisioning for
        the selected root agent version, including for previously stored agent
        versions. Roster agent cache settings are validated at delegation before
        creating each child session. A temporarily unavailable model reference
        or catalog dependency returns 503. An environment on managed compute
        whose setup script has no verified, current run returns 422
        environment_not_verified before provisioning; run
        managedAgentsCreateEnvironmentSetupRunV2 first. When the tenant is out
        of credit it returns 403 session_start_not_admitted with details.reason
        out_of_credit; add credits and retry. When the tenant is suspended it
        returns the same 403 with details.reason tenant_suspended. A budget
        above the agent's multiagent.limits.max_tree_cost_usd returns 400. When
        the tenant already has as many sessions working at once as it may, it
        returns 429 tenant_concurrency_limit with details.limit; wait for a
        session to finish its turn or stop one, then retry.
      operationId: managedAgentsStartSessionV2
      parameters:
        - description: >-
            Replay-protection key in an organization-wide namespace shared by
            keyed mutations. It must contain 1 to 256 visible ASCII characters
            and be sent as exactly one header value. Request identity is the
            exact HTTP method, escaped path, raw query, and raw body bytes. The
            same request replays the original successful response; any different
            request returns 409 idempotency_conflict, and an active matching
            request returns 409 idempotency_in_progress. Completed receipts are
            retained for approximately 24 hours, pending claims may be reclaimed
            after approximately 1 hour, and no deduplication is guaranteed after
            expiry.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            description: >-
              Replay-protection key in an organization-wide namespace shared by
              keyed mutations. It must contain 1 to 256 visible ASCII characters
              and be sent as exactly one header value. Request identity is the
              exact HTTP method, escaped path, raw query, and raw body bytes.
              The same request replays the original successful response; any
              different request returns 409 idempotency_conflict, and an active
              matching request returns 409 idempotency_in_progress. Completed
              receipts are retained for approximately 24 hours, pending claims
              may be reclaimed after approximately 1 hour, and no deduplication
              is guaranteed after expiry.
            maxLength: 256
            minLength: 1
            pattern: ^[!-~]+$
            type: string
        - $ref: '#/components/parameters/RecursionTenantId'
        - $ref: '#/components/parameters/RecursionOrganizationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StandaloneV2StartSessionRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandaloneV2SessionCreatedResponse'
          description: Accepted
          headers:
            Idempotency-Replayed:
              description: True when this response replays an earlier completed request.
              schema:
                type: boolean
              style: simple
            Location:
              description: Relative URL of the created or admitted resource.
              schema:
                type: string
              style: simple
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidJson'
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                discriminator:
                  propertyName: code
                  mapping:
                    invalid_json: '#/components/schemas/ManagedAgentsApiErrorInvalidJson'
                    invalid_request: '#/components/schemas/ManagedAgentsApiErrorInvalidRequest'
                x-recursion-error-codes:
                  - invalid_json
                  - invalid_request
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnauthorized'
                x-recursion-error-codes:
                  - unauthorized
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorForbidden'
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartNotAdmitted
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorWorkspaceBoundaryDenied
                discriminator:
                  propertyName: code
                  mapping:
                    forbidden: '#/components/schemas/ManagedAgentsApiErrorForbidden'
                    session_start_not_admitted: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartNotAdmitted
                    workspace_boundary_denied: >-
                      #/components/schemas/ManagedAgentsApiErrorWorkspaceBoundaryDenied
                x-recursion-error-codes:
                  - forbidden
                  - session_start_not_admitted
                  - workspace_boundary_denied
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorNotFound'
                x-recursion-error-codes:
                  - not_found
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '409':
          headers:
            Retry-After:
              description: >-
                When present, delay in seconds or an HTTP-date after which the
                caller may retry; absence supplies no retry advice.
              schema:
                type: string
              style: simple
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: Conflict.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorConflict'
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorIdempotencyConflict
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorIdempotencyInProgress
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorRevisionConflict'
                discriminator:
                  propertyName: code
                  mapping:
                    conflict: '#/components/schemas/ManagedAgentsApiErrorConflict'
                    idempotency_conflict: >-
                      #/components/schemas/ManagedAgentsApiErrorIdempotencyConflict
                    idempotency_in_progress: >-
                      #/components/schemas/ManagedAgentsApiErrorIdempotencyInProgress
                    revision_conflict: '#/components/schemas/ManagedAgentsApiErrorRevisionConflict'
                x-recursion-error-codes:
                  - conflict
                  - idempotency_conflict
                  - idempotency_in_progress
                  - revision_conflict
        '413':
          description: Payload Too Large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorPayloadTooLarge'
                x-recursion-error-codes:
                  - payload_too_large
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '415':
          description: Unsupported Media Type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnsupportedMediaType'
                x-recursion-error-codes:
                  - unsupported_media_type
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '422':
          description: Unprocessable Entity.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorEnvironmentNotVerified
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorSandboxProviderDisabled
                discriminator:
                  propertyName: code
                  mapping:
                    environment_not_verified: >-
                      #/components/schemas/ManagedAgentsApiErrorEnvironmentNotVerified
                    sandbox_provider_disabled: >-
                      #/components/schemas/ManagedAgentsApiErrorSandboxProviderDisabled
                x-recursion-error-codes:
                  - environment_not_verified
                  - sandbox_provider_disabled
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '429':
          headers:
            Retry-After:
              description: >-
                When present, delay in seconds or an HTTP-date after which the
                caller may retry; absence supplies no retry advice.
              schema:
                type: string
              style: simple
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: Too Many Requests.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorRateLimitExceeded
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorTenantConcurrencyLimit
                discriminator:
                  propertyName: code
                  mapping:
                    rate_limit_exceeded: >-
                      #/components/schemas/ManagedAgentsApiErrorRateLimitExceeded
                    tenant_concurrency_limit: >-
                      #/components/schemas/ManagedAgentsApiErrorTenantConcurrencyLimit
                x-recursion-error-codes:
                  - rate_limit_exceeded
                  - tenant_concurrency_limit
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorInternalError'
                x-recursion-error-codes:
                  - internal_error
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '502':
          description: A dependent service returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorDependencyFailure'
                x-recursion-error-codes:
                  - bad_gateway
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '503':
          description: Service Unavailable.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorContentStoreUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorFileStorageUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorIdempotencyUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorMemoryPolicyReadUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorModelProviderMetadataMissing
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorModelProviderUnconfigured
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorModelProviderUnreachable
                  - $ref: '#/components/schemas/ManagedAgentsApiErrorPersistenceBusy'
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorRunnerImageResolutionFailed
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                  - $ref: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartAdmissionUnavailable
                discriminator:
                  propertyName: code
                  mapping:
                    content_store_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorContentStoreUnconfigured
                    file_storage_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorFileStorageUnconfigured
                    idempotency_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorIdempotencyUnavailable
                    managed_agents_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorManagedAgentsUnavailable
                    memory_policy_read_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorMemoryPolicyReadUnavailable
                    model_gateway_metadata_missing: >-
                      #/components/schemas/ManagedAgentsApiErrorModelProviderMetadataMissing
                    model_gateway_unconfigured: >-
                      #/components/schemas/ManagedAgentsApiErrorModelProviderUnconfigured
                    model_gateway_unreachable: >-
                      #/components/schemas/ManagedAgentsApiErrorModelProviderUnreachable
                    persistence_busy: '#/components/schemas/ManagedAgentsApiErrorPersistenceBusy'
                    runner_image_resolution_failed: >-
                      #/components/schemas/ManagedAgentsApiErrorRunnerImageResolutionFailed
                    service_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorServiceUnavailable
                    session_start_admission_unavailable: >-
                      #/components/schemas/ManagedAgentsApiErrorSessionStartAdmissionUnavailable
                x-recursion-error-codes:
                  - content_store_unconfigured
                  - file_storage_unconfigured
                  - idempotency_unavailable
                  - managed_agents_unavailable
                  - memory_policy_read_unavailable
                  - model_gateway_metadata_missing
                  - model_gateway_unconfigured
                  - model_gateway_unreachable
                  - persistence_busy
                  - runner_image_resolution_failed
                  - service_unavailable
                  - session_start_admission_unavailable
          headers:
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
        '504':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
            recursion-organization-id:
              $ref: '#/components/headers/RecursionOrganizationId'
            recursion-tenant-id:
              $ref: '#/components/headers/RecursionTenantId'
          description: A dependent service timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorDependencyTimeout'
                x-recursion-error-codes:
                  - gateway_timeout
components:
  parameters:
    RecursionTenantId:
      name: x-tenant-id
      in: header
      required: false
      description: >-
        Optional tenant consistency check. When present, it must name the tenant
        bound to the API key, including when x-organization-id is `default`.
      schema:
        minLength: 1
        type: string
    RecursionOrganizationId:
      name: x-organization-id
      in: header
      required: false
      description: >-
        Organization in which to act. Required for a tenant-scoped API key.
        Optional for an organization-scoped key, where it must name that same
        organization. The value may be an organization id or `default`.
      schema:
        minLength: 1
        type: string
  schemas:
    StandaloneV2StartSessionRequest:
      additionalProperties: false
      properties:
        agentId:
          description: Agent to run.
          type: string
        budget:
          allOf:
            - $ref: '#/components/schemas/SessionBudget'
          description: Tree cost cap.
          x-recursion-omission:
            strategy: absent
        credentialRefs:
          description: Selected credentials within the granted vaults.
          items:
            $ref: '#/components/schemas/StandaloneV2VaultCredentialRef'
          type: array
          x-recursion-omission:
            strategy: absent
        environmentId:
          description: Environment whose sandbox the session uses.
          type: string
          x-recursion-omission:
            strategy: absent
        externalSourceId:
          description: Identity within the external source; set with externalSourceType.
          type: string
          x-recursion-omission:
            strategy: absent
        externalSourceType:
          description: External source kind; set with externalSourceId.
          type: string
          x-recursion-omission:
            strategy: absent
        message:
          description: Opening user message.
          type: string
          x-recursion-omission:
            strategy: absent
        metadata:
          additionalProperties:
            type: string
          description: Caller-defined string labels.
          maxProperties: 32
          type: object
          x-recursion-omission:
            strategy: absent
        outcome:
          allOf:
            - $ref: '#/components/schemas/StandaloneV2DefineOutcomeRequest'
          description: Optional definition of done.
          x-recursion-omission:
            strategy: absent
        projectId:
          description: Project billed for the session.
          type: string
          x-recursion-omission:
            strategy: absent
        referencedSessionIds:
          description: Prior sessions this session may read.
          items:
            type: string
          maxItems: 10
          type: array
          x-recursion-omission:
            strategy: absent
        resources:
          description: Files to mount in the session.
          items:
            $ref: '#/components/schemas/StandaloneV2SessionResourceRequest'
          maxItems: 500
          type: array
          x-recursion-omission:
            strategy: absent
        skipDefaultOutcome:
          default: false
          description: Start ungraded when the agent version defines a default outcome.
          type: boolean
        team:
          allOf:
            - $ref: '#/components/schemas/TeamRequest'
          description: Per-session team setting.
          x-recursion-omission:
            strategy: absent
        vaultIds:
          description: Vault grants for this session.
          items:
            type: string
          type: array
          x-recursion-omission:
            strategy: absent
      required:
        - agentId
      type: object
    StandaloneV2SessionCreatedResponse:
      properties:
        sessionId:
          description: Server-assigned session identifier.
          type: string
        statusUrl:
          description: Path to poll for provisioning and execution status.
          type: string
      required:
        - sessionId
        - statusUrl
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorInvalidJson:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - invalid_json
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorInvalidRequest:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - invalid_request
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorUnauthorized:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unauthorized
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorForbidden:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - forbidden
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorSessionStartNotAdmitted:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - session_start_not_admitted
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorWorkspaceBoundaryDenied:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - workspace_boundary_denied
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorNotFound:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - not_found
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorConflict:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - conflict
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorIdempotencyConflict:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - idempotency_conflict
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorIdempotencyInProgress:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - idempotency_in_progress
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorRevisionConflict:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - revision_conflict
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorPayloadTooLarge:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - payload_too_large
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorUnsupportedMediaType:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unsupported_media_type
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorEnvironmentNotVerified:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - environment_not_verified
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorSandboxProviderDisabled:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - sandbox_provider_disabled
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorRateLimitExceeded:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - rate_limit_exceeded
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorTenantConcurrencyLimit:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - tenant_concurrency_limit
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorInternalError:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - internal_error
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorDependencyFailure:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - bad_gateway
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorContentStoreUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - content_store_unconfigured
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorFileStorageUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - file_storage_unconfigured
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorIdempotencyUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - idempotency_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorManagedAgentsUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - managed_agents_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorMemoryPolicyReadUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - memory_policy_read_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorModelProviderMetadataMissing:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - model_gateway_metadata_missing
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorModelProviderUnconfigured:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - model_gateway_unconfigured
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorModelProviderUnreachable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - model_gateway_unreachable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorPersistenceBusy:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - persistence_busy
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorRunnerImageResolutionFailed:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - runner_image_resolution_failed
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorServiceUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - service_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorSessionStartAdmissionUnavailable:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - session_start_admission_unavailable
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorDependencyTimeout:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - gateway_timeout
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          $ref: '#/components/schemas/ManagedAgentsApiErrorDetails'
          description: >-
            Optional structured error details. Reserved transport fields are
            typed; code-specific fields remain forward compatible.
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    SessionBudget:
      description: >-
        The spend at which a session and its threads pause, in US dollars at the
        billed price, counting model requests, tools and sandbox compute. On
        Recursion, linked outcome grading sessions count toward the writer's
        budget when they share that budget. Reaching it pauses the session with
        stop_reason budget_reached before its next paid request, but requests
        already running finish and can pass it. Raising or removing it continues
        the session, except one bound to a Slack thread, which continues on its
        next reply there.
      properties:
        maxCostUsd:
          description: >-
            The budget in US dollars, as a decimal string with at most two
            decimals, such as "10" or "12.50". Between 0.01 and 100000.
          examples:
            - '10.00'
          pattern: ^(0|[1-9][0-9]{0,5})(\.[0-9]{1,2})?$
          type: string
      required:
        - maxCostUsd
      type: object
      additionalProperties: false
    StandaloneV2VaultCredentialRef:
      properties:
        credentialId:
          description: Credential to select inside vault_id.
          type: string
        vaultId:
          description: >-
            Vault holding the credential. Required, because credential ids are
            unique only within a vault.
          type: string
      required:
        - vaultId
        - credentialId
      type: object
      additionalProperties: false
    StandaloneV2DefineOutcomeRequest:
      additionalProperties: false
      anyOf:
        - required:
            - criteria
        - required:
            - rubric
        - required:
            - rubricFile
      description: >-
        A definition of done for a session, with criteria, a rubric, or a rubric
        file.
      properties:
        criteria:
          description: Grading criteria in rubric order.
          items:
            $ref: '#/components/schemas/StandaloneV2CriterionConfig'
          maxItems: 200
          minItems: 1
          type: array
          x-recursion-omission:
            strategy: absent
        description:
          description: Objective the agent works toward.
          minLength: 1
          type: string
        evaluatorAgentId:
          description: Agent selected to evaluate the outcome.
          type: string
          x-recursion-omission:
            source: writer agent's default evaluator
            strategy: derive
        maxIterations:
          default: 5
          description: Maximum evaluator passes; zero means unbounded.
          minimum: 0
          type:
            - 'null'
            - integer
          maximum: 9007199254740991
        rubric:
          description: Markdown rubric; prefer criteria.
          type: string
          x-recursion-omission:
            strategy: absent
        rubricFile:
          allOf:
            - $ref: '#/components/schemas/StandaloneV2OutcomeRubricRef'
          description: File holding the rubric.
          x-recursion-omission:
            strategy: absent
      required:
        - description
      type: object
    StandaloneV2SessionResourceRequest:
      additionalProperties: false
      properties:
        fileId:
          description: File to mount.
          format: uuid
          type: string
        mountPath:
          description: Absolute path beneath the session's files directory.
          type: string
          x-recursion-omission:
            strategy: absent
        relativePath:
          description: Path relative to the session's files directory.
          type: string
          x-recursion-omission:
            strategy: absent
        type:
          description: Always file.
          enum:
            - file
          type: string
      required:
        - type
        - fileId
      type: object
    TeamRequest:
      description: >-
        Per-session override of the agent's team setting: whether the tree may
        become a team. Omit the mode to keep the agent's setting. The seats a
        team may fill are the roster's limits.max_concurrent_threads; recruits
        are sized to the claimable work under that cap, and teammates may always
        message each other directly.
      properties:
        mode:
          description: >-
            auto (default): the board tools are offered and the tree becomes a
            team when the agent posts its first task. on: a team from turn one,
            briefed as one before it has posted anything. off: no board; the
            agent delegates and waits as a plain coordinator. Omit to keep the
            agent's setting.
          enum:
            - auto
            - 'on'
            - 'off'
          type: string
          x-recursion-omission:
            strategy: absent
      type: object
      additionalProperties: false
    ManagedAgentsApiErrorDetails:
      type: object
      properties:
        field:
          description: >-
            Request field or header responsible for the error, when one can be
            identified.
          type: string
        issues:
          description: >-
            Boundary-validation failures as path-prefixed human-readable
            messages.
          type: array
          items:
            type: string
        requestId:
          description: Request correlation identifier for support and log lookup.
          type: string
        retryable:
          description: >-
            Server advice about failure transience. `true` means transient,
            `false` means non-transient, and absence gives no advice. Automatic
            replay is allowed only when this field is not `false` and the
            operation-specific retry and idempotency contract permits replay.
          type: boolean
      additionalProperties:
        $ref: '#/components/schemas/PlatformSafeJsonValue'
      description: >-
        Optional structured error details. Reserved transport fields are typed;
        code-specific fields remain forward compatible.
    StandaloneV2CriterionConfig:
      additionalProperties: false
      properties:
        criterionKey:
          description: Stable key of this criterion.
          maxLength: 64
          minLength: 1
          pattern: ^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$
          type: string
        criterionText:
          description: What the evaluator checks.
          maxLength: 4096
          minLength: 1
          type: string
        label:
          description: Optional display name.
          maxLength: 80
          type: string
          x-recursion-omission:
            strategy: absent
        section:
          description: Optional heading.
          maxLength: 4096
          type: string
          x-recursion-omission:
            strategy: absent
      required:
        - criterionKey
        - criterionText
      type: object
    StandaloneV2OutcomeRubricRef:
      properties:
        fileId:
          description: Rubric file to read at definition time.
          format: uuid
          type: string
        type:
          type: string
          const: file
          description: Always file.
      required:
        - type
        - fileId
      type: object
      additionalProperties: false
    PlatformSafeJsonValue:
      description: >-
        A JSON value whose integer members stay within the exact ECMAScript
        safe-integer range at every nesting level.
      oneOf:
        - type: 'null'
        - type: boolean
        - type: string
        - type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        - type: number
          not:
            type: integer
        - type: array
          items:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
        - additionalProperties:
            $ref: '#/components/schemas/PlatformSafeJsonValue'
          type: object
  headers:
    RecursionOrganizationId:
      description: Organization id resolved for this request.
      schema:
        minLength: 1
        type: string
    RecursionTenantId:
      description: Tenant id resolved for this request.
      schema:
        minLength: 1
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Recursion API key, created in the console under API keys.

````