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

# Create a session

> Create a Session from a prompt. Optional reason_id files it under a Reason you can access, and repo selects the repository checkout for a cloud Session.

Opens a new Session from a prompt. Optional `reason_id` files it under an accessible Reason (use GET /reasons to discover IDs); `project_id` is the compatible older spelling of the same id. For a cloud Session under an explicitly named Reason, omitting `repo` uses its first default repository unless `default_repositories` is false or the request names a branch, ref or pull request. Provide `repo` to select the checkout explicitly, or send `default_repositories: false` and omit `repo` for a repository-neutral start. A Reason does not supply network hosts or an execution target; select the latter with `target`. If the running Brain later discovers an exact connected repository, Reason attaches it and continues the original task under this Session ID instead of creating another user task. The session starts immediately and runs asynchronously: poll `GET /sessions/{id}` for status and `GET /sessions/{id}/events` for incremental live output.

<sub>Scope: `run`</sub>


## OpenAPI

````yaml /openapi.docs.json post /v3/organizations/{orgId}/sessions
openapi: 3.1.0
info:
  title: Reason API
  version: 3.0.0
  description: >-
    The Reason HTTP API. Drive cloud software-engineering agents: open sessions
    against your repositories, stream their work, and manage the secrets,
    skills, and automations they run with.


    Authenticate with a Reason API key sent as a bearer token. New keys use
    `reason_`; legacy `ara_` keys remain accepted. Every resource is scoped to
    an organization; resolve your `org_id` once with `GET /v3/self`.
servers:
  - url: https://api.reason.bot
security:
  - reasonApiKey: []
tags:
  - name: Account
    description: Verify a key and resolve the organization it belongs to.
  - name: Reasons
    description: >-
      Start here. A Reason is the long-running agent a person keeps: their main
      Reason and named ones, each with its own instructions, default model and
      repositories, conversation, Loops and Sessions. Give a Reason work by
      messaging it (sendReasonMessage) and read its replies with
      listReasonMessages.
  - name: Loops
    description: >-
      Standing work a Reason does, woken by a schedule or an event: a webhook, a
      GitHub event or a Slack message. Each wake opens or continues a Session of
      the Reason; webhook events that share a correlation key continue one
      Session.
  - name: Memory
    description: >-
      What Reasons remember across Sessions. Each Session starts by reading
      MEMORY.md (a short index) and the list of topic notes, and reads a note
      when its topic comes up. `personal` memory belongs to one person (the API
      key's owner) and only their Sessions read it; `team` memory belongs to the
      Workspace and every member's Sessions read it. memory:read lists, reads
      and searches; memory:write writes and deletes, in team memory only for a
      Workspace owner or admin.
  - name: Sessions
    description: >-
      A Session is one run of work inside a Reason: every Reason message and
      Loop wake runs in one, and createSession starts one directly for a single
      unattended task with a pass/fail outcome. Its transcript, events, result
      and pull request are read here.
  - name: Skills
    description: >-
      Reusable instruction bundles Reason selects semantically from their
      descriptions for matching agent tasks.
  - name: Workspace events
    description: >-
      Follow a whole workspace without polling each Session.
      streamWorkspaceChanges is a Server-Sent Events stream of view revisions:
      when a topic's revision moves, re-read that view. streamWorkspaceEvents is
      a resumable Server-Sent Events stream of what happened (a message added, a
      turn finished), replayed from Last-Event-ID for 7 days. Event webhooks
      POST the same events, signed (Standard Webhooks), to endpoints you
      register. sessions:read reads; webhooks also need automations:read /
      automations:write; the devices topic also needs devices:read.
  - name: Pages
    description: >-
      The HTML pages Reasons make: charts, dashboards and reports a person reads
      in the chat, opens full size, shares and finds in a Reason's Library. List
      and read the pages you may see, make one in a Reason's conversation or a
      Session, keep it current with updatePage (same id, link and share link, a
      new revision), share it and delete it. pages:read reads; pages:write
      writes. An Experiments feature (pages_api): elsewhere these return 403
      `pages_api_unavailable`.
  - name: Secrets
    description: >-
      Encrypted credentials injected into the agent's sandbox. Write-only:
      values can be set but never read back.
  - name: Attachments
    description: >-
      Files uploaded to the organization and shared with sessions, downloaded
      via short-lived signed URLs.
  - name: Repositories
    description: Connected repositories, their indexing state, and generated wikis.
  - name: Git Connections
    description: Linked source-control accounts and the repositories they expose.
  - name: Machines
    description: >-
      Named Workspace queues served by headless workers. Sessions target a
      Machine by name and wait for a free worker; more workers serve more
      Sessions concurrently.
  - name: Devices
    description: >-
      Owned Mac and headless Device identity, bounded enrollment and root
      grants.
  - name: Cloud Access
    description: >-
      Keyless cloud sign-in for sessions: Reason's OIDC issuer facts and the
      AWS, Google Cloud and Azure connections a workspace trusts, including
      which run triggers each one signs in.
  - name: MCP Servers
    description: >-
      Org-level Model Context Protocol servers exposed to the agent. Secret
      values are write-only.
  - name: Plugins
    description: >-
      The plugin catalog (catalog connectors, custom MCP servers, native app
      connectors): install, browser OAuth sign-in, bundled skills and per-Reason
      settings. Never returns credentials.
  - name: Change Request Reviews
    description: >-
      Automated senior-engineer reviews posted on pull requests and merge
      requests.
  - name: Consumption
    description: 'Billing-aligned usage: daily consumption and billing cycles.'
  - name: Metrics
    description: Aggregate analytics over sessions, change requests, and usage.
  - name: Audit Logs
    description: An append-only record of changes made within the organization.
  - name: Organizations
    description: The top-level tenant. Create, read, update, and delete organizations.
  - name: Members
    description: People in an organization and their pending invites.
  - name: Roles
    description: Role assignments that govern what each member can do.
  - name: Settings
    description: 'Organization configuration: namespaced settings and the run tag policy.'
  - name: Provider credentials
    description: >-
      Configure Bring-Your-Own-Key (BYOK) API keys and subscription credentials
      for model providers. Secret values are write-only.
  - name: Feedback
    description: Report problems with the API or these docs to the Reason team.
  - name: Projects
    description: >-
      Deprecated: a project is a Reason with the same id. Use the Reasons
      operations; these remain for existing clients.
  - name: Automations
    description: >-
      The older form of Loops. Prefer the Loops under a Reason (listReasonLoops,
      createReasonLoop), which take every wake: schedule, webhook, GitHub,
      Slack. Use these for what Loops do not carry yet: a run's MCP and app
      tools, and automations not filed under a Reason.
paths:
  /v3/organizations/{orgId}/sessions:
    parameters:
      - $ref: '#/components/parameters/orgId'
    post:
      tags:
        - Sessions
      summary: Create a session
      description: >-
        Create a Session from a prompt. Optional reason_id files it under a
        Reason you can access, and repo selects the repository checkout for a
        cloud Session.


        Opens a new Session from a prompt. Optional `reason_id` files it under
        an accessible Reason (use GET /reasons to discover IDs); `project_id` is
        the compatible older spelling of the same id. For a cloud Session under
        an explicitly named Reason, omitting `repo` uses its first default
        repository unless `default_repositories` is false or the request names a
        branch, ref or pull request. Provide `repo` to select the checkout
        explicitly, or send `default_repositories: false` and omit `repo` for a
        repository-neutral start. A Reason does not supply network hosts or an
        execution target; select the latter with `target`. If the running Brain
        later discovers an exact connected repository, Reason attaches it and
        continues the original task under this Session ID instead of creating
        another user task. The session starts immediately and runs
        asynchronously: poll `GET /sessions/{id}` for status and `GET
        /sessions/{id}/events` for incremental live output.


        <sub>Scope: `run`</sub>
      operationId: createSession
      parameters:
        - in: header
          name: X-Reason-Agent
          required: false
          schema:
            type: string
            maxLength: 80
          description: >-
            Optional self-reported caller agent name. If absent, the server uses
            the User-Agent for external callers.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSession'
            example:
              prompt: >-
                Fix the flaky test in src/auth/session.test.ts and add a
                regression case.
              repo: acme/web
              provider: github
              tags:
                - ci
                - tests
      responses:
        '200':
          description: Idempotent replay of the original session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionCreateResponse'
        '201':
          description: Session created and queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionCreateResponse'
              example:
                session_policy:
                  version: 1
                  mode: standard
                  workspaceOwnership: managed
                  components:
                    memoryRead: true
                    memoryWrite: true
                    skills: true
                    inheritedInstructions: true
                    integrations: true
                    secretInjection: true
                session_id: ses_91af3c
                project_id: null
                reason_id: null
                url: https://reasonmachines.com/agents/ses_91af3c
                status: running
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: >-
            Quota exhausted for the billing account. When cloud activation is
            available, an unpaid workspace also receives `activation.path`, a
            relative web path where the user can activate access; confirm
            activation through GET /self?cloud_activation=1 before retrying. A
            trial asking for a model its trial does not include also gets
            `reason: model_payment_required`, `code: trial_model_restricted`,
            `action: start_plan` and the `billing_path` where the plan starts.
          content:
            application/json:
              examples:
                quota_exhausted:
                  value:
                    error: quota_exhausted
                    message: Monthly sandbox minutes exceeded.
                cloud_activation_required:
                  value:
                    error: quota_exhausted
                    reason: model_payment_required
                    message: Sending to Reason needs a plan.
                    activation:
                      path: >-
                        /cli/activate?workspace=11111111-1111-4111-8111-111111111111
                trial_model_restricted:
                  value:
                    error: quota_exhausted
                    reason: model_payment_required
                    message: >-
                      Your trial runs on Reason's default model. Start your plan
                      now to use any model, or connect your own subscription or
                      API key.
                    code: trial_model_restricted
                    action: start_plan
                    billing_path: /customize?tab=billing
        '403':
          description: >-
            The caller is not a Workspace member (`forbidden`; open access
            grants read-only access), Project access is forbidden, or the
            organization may not request the named experimental_runtime_profile
            (`runtime_profile_not_enabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Project not found or not accessible to this principal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The idempotency key was already used with a different prompt
            (`idempotency_key_conflict`) or belongs to another project, target,
            or session policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: idempotency_profile_conflict
        '413':
          description: >-
            Prompt limit: 262144 UTF-8 bytes. Total JSON request limit:
            116042412 bytes.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - max_bytes
                properties:
                  error:
                    type: string
                    enum:
                      - prompt_too_large
                      - request_too_large
                  max_bytes:
                    type: integer
              examples:
                prompt:
                  value:
                    error: prompt_too_large
                    max_bytes: 262144
                request:
                  value:
                    error: request_too_large
                    max_bytes: 116042412
        '422':
          description: >-
            The Session cannot honor `long_running`
            (`long_running_not_supported`): it has no repository, targets a
            non-cloud machine, or the workspace does not have the Loop enabled.
            A `branch` target naming the default branch (main, master, or the
            repository default: `branch_protected`) also answers 422, and so
            does a `require_ready` create that found something missing
            (`session_not_ready`, with `message` and the `warnings` a create
            would have reported; nothing was created).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    properties:
                      warnings:
                        type: array
                        items:
                          $ref: '#/components/schemas/SessionStartWarning'
                        description: >-
                          With `session_not_ready`: what the Session would be
                          missing, each with how to fix it.
              example:
                error: long_running_not_supported
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          description: >-
            Temporarily unable to create the session: model credential preflight
            could not be completed, or `env` was supplied while the deployment's
            secret store is unavailable (`secret_store_unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: secret_store_unavailable
      security:
        - reasonApiKey:
            - run
components:
  parameters:
    orgId:
      name: orgId
      in: path
      required: true
      description: Organization id or slug. Resolve it with `GET /v3/self`.
      schema:
        type: string
  schemas:
    CreateSession:
      type: object
      properties:
        mode:
          type: string
          enum:
            - standard
            - ephemeral
          default: standard
          description: >-
            How the Session runs. standard is for normal work, including API
            sessions targeting a local Mac: it keeps the configured capabilities
            and accepts follow-up messages. ephemeral runs one benchmark trial
            with the standard capabilities inside a single-use workspace from
            REST createEphemeralWorkspace (not an MCP tool, since its response
            holds the workspace's key): it needs that workspace, an
            externally-managed headless project_root and an idempotency_key,
            accepts no follow-up messages, and the workspace admits no other
            Session. The retired isolated mode returns 400 session_mode_retired,
            and the retired benchmark_profile and runtime_profile fields return
            400 benchmark_profile_retired and runtime_profile_retired.
        workspace_ownership:
          type: string
          enum:
            - managed
            - externally-managed
            - ara-managed
          x-reason-deprecated-enum:
            - ara-managed
          default: managed
          description: >-
            Who owns the persistence of the Session's filesystem, independently
            of mode: managed leaves it to Reason, externally-managed to the
            caller, which then has to target an explicit headless project_root.
            ara-managed is a deprecated spelling of managed, and responses
            report managed.
        compaction:
          $ref: '#/components/schemas/SessionCompaction'
        personal_context:
          type: boolean
          default: true
          description: >-
            Whether the Session loads its creator's personal context: their
            personal skills, personal memory (profile and notes), personal
            secrets and personal connections. false runs it impersonally, on the
            workspace's and its Reason's own skills, memory, secrets and
            connections, the same for whoever created it; useful for automation
            that creates Sessions with someone's API key. The creator still owns
            the Session for permissions, billing and audit. Follow-ups,
            continuations and subagents keep the setting.
        pull_request_policy:
          type: string
          enum:
            - draft_only
          description: >-
            Restricts how the Session delivers pull requests. draft_only makes
            every pull request it opens a draft and refuses, in the server,
            marking one ready for review, merging, queueing or enabling
            auto-merge, adding labels, and publishing to the base or default
            branch; pr_merge is not granted, and the agent is told so. Omit for
            the normal delivery flow, in which the agent may merge its own pull
            request. Follow-ups, continuations, subagents and Sessions it starts
            keep the setting, and session_policy.pullRequestPolicy reports it:
            check it in the response, since a server that predates the field
            ignores it.
        task_bound_to_device:
          type: boolean
          default: false
          description: >-
            The task's inputs and required outputs exist only on the target
            worker's root (a benchmark trial): when that worker goes offline,
            the Session reports the loss instead of moving to Reason cloud,
            whatever the workspace's auto-move setting. Requires a headless
            target with workspace_mode project_root (400
            task_bound_requires_headless_project_root). A sandbox_target_id is
            always bound, and so is a Session created with completion_mode
            run_outcome and workspace_ownership externally-managed on a headless
            target, with or without this field (not one on a machine target,
            which its Machine places). An explicit move to another placement
            ends the binding. A server that predates the field ignores it.
        sandbox_target_id:
          description: >-
            Explicit sandbox target. Requires devices:use. Cannot be combined
            with target or managed workspace ownership; unavailable targets are
            refused without falling back to cloud.
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        secret_injection:
          type: boolean
          default: true
          description: >-
            Whether stored secrets (workspace, Reason, personal and environment
            secrets) are injected into the Session's machine and tools. false
            runs it with none, for work that handles untrusted input; the
            Session's own `env` is still injected on cloud machines, since it is
            the caller's explicit input, not a stored secret (a connected Device
            gets none); repository access still works through Reason's own
            credential. A Session with false runs on a fresh cloud computer of
            its own that no other Session joins. Follow-ups, continuations and
            subagents keep the setting, and
            session_policy.components.secretInjection reports it. Not available
            in ephemeral mode (400 secret_injection_mode_unsupported).
        experimental_runtime_profile:
          type: string
          enum:
            - runtime/reason-capability-shell-v1
            - runtime/reason-c2-tools-v7
            - runtime/reason-v7-sync-yield-v1
            - runtime/reason-v7-sync-yield-machine-sdk-v1
            - runtime/reason-v7-stock-prompt-v1
            - runtime/reason-v7-docs-v1
            - runtime/reason-v7-stock-shape-v1
            - runtime/reason-v7-bash-clean-v1
            - runtime/reason-v7-bash-reason-v1
            - runtime/reason-v7-2026-10
            - runtime/reason-v7-2026-11
            - runtime/reason-v8-2026-10
            - runtime/reason-v8.1-2026-10
            - runtime/reason-v8.2-2026-10
            - runtime/reason-agent-1.2
            - runtime/reason-agent-1.3
            - runtime/reason-agent-1.3.1
          description: >-
            The agent harness this Session runs; omit it for the default.
            getDeployment lists the profiles this workspace may name.
            runtime/reason-c2-tools-v7 is the default C2 harness (read, bash,
            edit, write and codemode tools) and runs in any mode; naming it
            changes nothing. runtime/reason-v7-2026-10 and
            runtime/reason-v7-2026-11 are frozen dated releases of that harness
            (as it ran in October 2026, and as cut on 2026-10-12), and
            runtime/reason-v8-2026-10 freezes its Bash-only variant (Bash and a
            script tool named `reason`, no read, edit or write, as cut on
            2026-10-19); runtime/reason-v8.1-2026-10 is
            runtime/reason-v8-2026-10 with every Bash call yielding at its
            timeout (a command still running then returns its output so far and
            keeps running in the background), as cut on 2026-10-22;
            runtime/reason-v8.2-2026-10 is runtime/reason-v8.1-2026-10 without
            section zero's guideline to stop exploring after about 25 turns, as
            cut on 2026-10-24; runtime/reason-agent-1.2 (Reason Agent 1.2) is
            runtime/reason-v8.2-2026-10 under a standalone, dateless release
            name, sending and running exactly what it does, and never changes (a
            change ships as the next version); runtime/reason-agent-1.3 (Reason
            Agent 1.3) sends what runtime/reason-agent-1.2 sends and also runs
            output_cap_continue, image_history_append_only and cache_ttl_1h by
            default, as cut on 2026-10-27; runtime/reason-agent-1.3.1 (Reason
            Agent 1.3.1) sends what runtime/reason-agent-1.3 sends, runs those
            three by default without sdk_index (no web tools), and carries a
            response's unfinished thinking forward as text when the output cap
            cuts it, as cut on 2026-11-06; so a result that names one names one
            harness; any organization may name them, in ephemeral mode. The
            dated releases run on a headless project_root or the user's own
            Device without a repository. A mode or target a profile does not
            support returns 400 runtime_profile_mode_unsupported or
            runtime_profile_target_unsupported, and a retired profile (the
            deleted sync-yield harness runtime/reason-v7-sync-yield-v1 and
            runtime/reason-v7-sync-yield-machine-sdk-v1,
            runtime/reason-capability-shell-v1, and v7's deleted evaluation
            profiles runtime/reason-v7-stock-prompt-v1,
            runtime/reason-v7-docs-v1, runtime/reason-v7-stock-shape-v1,
            runtime/reason-v7-bash-clean-v1 and
            runtime/reason-v7-bash-reason-v1) returns 400
            runtime_profile_retired with a detail naming what to request
            instead.
        experimental_runtime_features:
          maxItems: 21
          type: array
          items:
            type: string
            enum:
              - banner
              - sdk_index
              - service_tier
              - output_cap
              - git_metadata
              - serial_reads
              - recovery_defer_idle_hands
              - fewer_tests_low
              - fewer_tests_medium
              - fewer_tests_high
              - fewer_tests_max
              - fewer_tests_max_alone
              - verify_line_alone
              - addendum_placebo
              - bash_yield
              - sync_bash
              - turn_line_removed
              - turn_line_questions
              - output_cap_continue
              - image_history_append_only
              - cache_ttl_1h
          description: >-
            Reason features to run on top of the base harness, for an ephemeral
            Session of the default C2 harness or one of its dated releases;
            getDeployment lists them. Omit the field for the deployment's
            default set; an empty list runs the base harness alone. A standard
            Session accepts only the empty list, and only with completion_mode
            run_outcome and workspace_ownership externally-managed (a benchmark
            trial of an offline task), and refuses anything else with 400
            runtime_features_mode_unsupported. banner adds the untrusted-data
            notice on tool results, sdk_index Reason's tools in codemode,
            service_tier and output_cap the router's defaults, git_metadata Git
            diffs around tool calls, and serial_reads one physical call at a
            time. Experiments run only when named: recovery_defer_idle_hands
            starts the next model request while the machine reattaches after a
            deploy handoff with no tool call in flight. The prompt experiments
            fewer_tests_low, fewer_tests_medium, fewer_tests_high and
            fewer_tests_max are rungs of one ladder that add an addendum asking
            for progressively fewer new tests, each yielding to an instruction
            to write tests and allowing existing tests to run;
            fewer_tests_max_alone (the max rung without its verification line),
            verify_line_alone (that line alone) and addendum_placebo (an
            addendum asking for nothing) split the max rung into its parts.
            Naming two fewer-tests experiments returns 400
            runtime_features_conflict. bash_yield and sync_bash are harness
            experiments that also run only when named: a Bash command still
            running after 60 seconds returns its output so far and keeps running
            in the background, its complete output written to a file; sync_bash
            also declares sync-yield's Bash (no timeout, a max_output_length
            head-and-tail bound). Naming bash_yield or sync_bash for
            runtime/reason-v8.1-2026-10, runtime/reason-v8.2-2026-10,
            runtime/reason-agent-1.2, runtime/reason-agent-1.3 or
            runtime/reason-agent-1.3.1, whose Bash already yields at its
            timeout, returns 400 runtime_features_conflict. turn_line_removed
            and turn_line_questions are prompt experiments for
            runtime/reason-v8-2026-10 and runtime/reason-v8.1-2026-10 only: the
            first drops the release's guideline to stop exploring after about 25
            turns, the second keeps that guideline for questions about the code;
            naming both returns 400 runtime_features_conflict, and naming either
            for another profile (runtime/reason-v8.2-2026-10,
            runtime/reason-agent-1.2 and runtime/reason-agent-1.3 and
            runtime/reason-agent-1.3.1 included, whose section zero has no such
            guideline) 400 runtime_features_profile_unsupported.
            output_cap_continue, image_history_append_only and cache_ttl_1h are
            harness experiments that run only when named (or by default on
            runtime/reason-agent-1.3 and runtime/reason-agent-1.3.1) and change
            no prompt or tool declaration, for any profile that takes features:
            output_cap_continue asks a model request sent straight to Anthropic
            (a connected Anthropic key) for at most 64,000 output tokens, and
            continues a turn whose response the output cap cut without a tool
            call, at most three times in a row; image_history_append_only keeps
            earlier tool-result images in the history instead of only the newest
            five, and removes the oldest in one step only when a request would
            carry more than 20 images or 20 MiB of them; cache_ttl_1h writes the
            prompt cache of a model request sent straight to Anthropic with the
            one-hour TTL. Naming features replaces the release's default set, so
            name sdk_index with any of them to keep it. The Session keeps the
            list across deploy handoffs and continuations. Another mode returns
            400 runtime_features_mode_unsupported, and another runtime profile
            400 runtime_features_profile_unsupported.
        project_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          deprecated: true
          description: >-
            Deprecated: Projects are retired in favour of Reasons. Existing
            Project ID from GET /projects or POST /projects. The session is
            filed under that Project; a Project supplies no repository, machine,
            network hosts or target, which come only from repo and target.
        reason_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: >-
            Files the Session under this Reason (listReasons): one of yours, or
            one shared with you. It is listed under the Reason and, when `repo`
            is omitted, checks out the Reason's first default repository (its
            `default_repositories` on getReason). The same id as project_id:
            send either, or both with the same value (400 otherwise). Messaging
            the Reason (sendReasonMessage) instead lets the Reason decide how to
            do the work.
        target:
          oneOf:
            - type: object
              properties:
                kind:
                  type: string
                  const: cloud
                  description: Run on Reason-managed cloud compute.
                computer_id:
                  description: >-
                    Start on this cloud computer of the Session's Reason
                    (project_id, else your main Reason): an id from REST
                    createReasonComputer or listReasonComputers (neither is an
                    MCP tool; opt-in computers scopes). It keeps its own size.
                    409 computer_unavailable when that Reason's Sessions each
                    keep their own computer, or with secret_injection false
                    (such a Session always gets a fresh computer of its own);
                    404 computer_not_found when it is not one of the Reason's
                    computers you may use.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - kind
              additionalProperties: false
            - type: object
              properties:
                kind:
                  type: string
                  const: mac
                  description: >-
                    Retired: always refused with 410 mac_device_retired. To run
                    on a Mac, connect it with `reason connect` and use kind
                    headless with the device_id listDevices returns for it.
                device_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: >-
                    The Mac app Device the request names; it is still parsed
                    only so the request gets 410 mac_device_retired. Connect the
                    Mac with `reason connect` and send kind headless with the
                    device_id listDevices returns for it.
                root_id:
                  description: >-
                    Folder grant on the retired Mac Device. Accepted for older
                    clients, but the request is refused with 410
                    mac_device_retired; use root_id with kind headless instead.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                cwd:
                  description: >-
                    Folder on the retired Mac Device the Session would work in.
                    Accepted for older clients (not combinable with root_id),
                    but the request is refused with 410 mac_device_retired; use
                    cwd with kind headless instead.
                  type: string
                  minLength: 1
                  maxLength: 4096
                  pattern: ^\/[^\x00-\x1f\x7f]*$
                isolation:
                  description: >-
                    How the retired Mac Device would have held cwd. Accepted for
                    older clients (only with cwd), but the request is refused
                    with 410 mac_device_retired; use isolation with kind
                    headless instead.
                  type: string
                  enum:
                    - worktree
                    - in_place
              required:
                - kind
                - device_id
              additionalProperties: false
            - type: object
              properties:
                kind:
                  type: string
                  const: headless
                  description: >-
                    Run on a CLI-connected computer or externally provisioned
                    worker.
                device_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: Connected computer or worker ID returned by listDevices.
                root_id:
                  description: >-
                    Optional on your own computer (`reason connect`): omit it to
                    run on the deepest granted folder holding the cwd, else on
                    its home grant (the folder you last used for the repository
                    there, else a managed checkout), or on a worker's only
                    folder. Required when the worker holds several folders, none
                    is its home folder and no cwd is named (409
                    local_device_root_ambiguous otherwise).
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                workspace_mode:
                  description: >-
                    Defaults to a stable Session-managed checkout. project_root
                    explicitly operates the selected existing root.
                  type: string
                  enum:
                    - managed
                    - project_root
                workspace_path:
                  description: >-
                    Absolute path of the project_root on the Device, as the
                    client sees it (for example /app). Read only with
                    workspace_mode project_root, as the working directory the
                    default C2 harness names in its model prompt; ignored
                    otherwise, and rejected when the request names
                    experimental_runtime_profile runtime/reason-c2-tools-v7. It
                    grants nothing and never selects a directory.
                  type: string
                  maxLength: 4096
                  pattern: ^\/[^\u0000\r\n]*$
                cwd:
                  description: >-
                    Your own computer (`reason connect`) only: the absolute
                    folder the Session works in, as for a Mac, in a folder the
                    computer granted Reason (root_id when named, else the
                    deepest one holding it; an older `reason connect`: only
                    inside its home folder). Not combinable with workspace_mode
                    or workspace_path.
                  type: string
                  minLength: 1
                  maxLength: 4096
                  pattern: ^\/[^\x00-\x1f\x7f]*$
                isolation:
                  description: >-
                    With cwd: worktree (the default for repository work) gives
                    the Session its own git worktree at
                    ~/.reason/workspace/sessions/<id>/<repository> on branch
                    reason/<id>; in_place works directly in cwd.
                  type: string
                  enum:
                    - worktree
                    - in_place
              required:
                - kind
                - device_id
              additionalProperties: false
            - type: object
              properties:
                kind:
                  type: string
                  const: machine
                  description: Queue this Session on a worker belonging to a named Machine.
                name:
                  description: Machine name (case-insensitive).
                  type: string
                  minLength: 1
                  maxLength: 63
                  pattern: ^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?$
                id:
                  description: Machine id.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - kind
              additionalProperties: false
          description: >-
            Explicit Hands machine target. Device targets require devices:use
            plus an owned, eligible root. Headless targets use externally
            provisioned compute and require the central relay; unavailable
            targets never fall back to cloud. A headless Device runs one Session
            at a time, a person's own computer (`reason connect`) every Session
            started on it, and any other personal headless worker (no Machine)
            as many as it advertises: while it is full, create returns 409
            device_busy. A `machine` target (set exactly one of `name` or `id`)
            also requires devices:use; it runs on any eligible worker of that
            Machine with an externally-managed project_root workspace, and waits
            FIFO for a free worker (up to 30 minutes, or the execution budget)
            instead of failing when every worker is busy. It returns 409
            machine_unavailable when the Machine has no online eligible worker.
        prompt:
          type: string
          description: What the agent should do. Maximum 256 KiB when UTF-8 encoded.
        attachments:
          type: array
          items:
            anyOf:
              - type: object
                properties:
                  id:
                    type: string
                    description: >-
                      Caller-chosen identifier for this file, kept with the
                      stored attachment. Omitted, the file is numbered by its
                      position: att-1, att-2 and so on.
                  name:
                    type: string
                    description: >-
                      File name shown with the attachment, for example
                      screenshot.png. It also supplies the content type when
                      none is given; an empty name becomes attachment-1,
                      attachment-2 and so on.
                  content_type:
                    type: string
                    description: >-
                      MIME type of the file, for example image/png. Omitted, the
                      data URL's media type is used; when that is empty or
                      application/octet-stream, the type is inferred from the
                      name's extension.
                  contentType:
                    description: Legacy alias of content_type.
                    type: string
                  data_url:
                    type: string
                    description: >-
                      Base64 data URL. Stored privately with the Session before
                      dispatch.
                required:
                  - name
                  - data_url
              - type: object
                properties:
                  id:
                    type: string
                    description: >-
                      Caller-chosen identifier for this file, kept with the
                      stored attachment. Omitted, the file is numbered by its
                      position: att-1, att-2 and so on.
                  name:
                    type: string
                    description: >-
                      File name shown with the attachment, for example
                      screenshot.png. It also supplies the content type when
                      none is given; an empty name becomes attachment-1,
                      attachment-2 and so on.
                  content_type:
                    type: string
                    description: >-
                      MIME type of the file, for example image/png. Omitted, the
                      data URL's media type is used; when that is empty or
                      application/octet-stream, the type is inferred from the
                      name's extension.
                  contentType:
                    description: Legacy alias of content_type.
                    type: string
                  dataUrl:
                    type: string
                    description: Legacy alias of data_url.
                required:
                  - name
                  - dataUrl
          description: >-
            Up to 10 attachments; maximum 64 MiB per file and 80 MiB total
            decoded bytes. The endpoint's request-body limit also applies to the
            encoded payload.
        repo:
          type: string
          description: >-
            Optional initial connected GitHub repository path in `owner/name`
            form. Omit it for a scratch session, or, with project_id, for the
            Reason's first default repository when it has default repositories.
        default_repositories:
          type: boolean
          const: false
          description: >-
            false: with project_id and no repo, start a scratch session instead
            of checking out the Reason's first default repository.
        provider:
          type: string
          enum:
            - github
          description: >-
            Source-control provider for the repo. GitHub is the only supported
            provider.
        model:
          type: string
          description: >-
            The model the agent runs on, by an id listAgentModels returns. Omit
            it or send `auto` for the workspace default.
        model_source_id:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            Start the Session on this connected account (a `source_id` from
            listAgentModels' groups[].accounts), for example to spread Sessions
            across several subscriptions of one provider. Requires `model`, an
            id that account serves. An account you cannot select, or one that
            does not serve `model`, returns 400 `model_source_not_selectable`
            with `valid_model_sources`. By default the Session routes from that
            account (model rollover). With `allow_model_rollover: false` (or
            `mode: "ephemeral"`) each turn on `model` runs on exactly that
            account until a later message switches the model or opts back into
            rollover: when it cannot serve (signed out, removed, out of usage)
            the turn fails with that account's error and never moves to another
            account or Reason's credits.
        reasoning_effort:
          type: string
          enum:
            - minimal
            - low
            - medium
            - high
            - xhigh
            - max
          description: Optional reasoning effort override for the selected model.
        speed:
          type: string
          enum:
            - standard
            - fast
            - ultrafast
          description: >-
            Fast mode, as the model picker's: `fast` asks the provider for its
            priority tier, which answers sooner and uses the plan or credits
            faster; `ultrafast` asks a ChatGPT subscription for its Ultrafast
            tier, faster still (Fast on a model whose account does not list
            Ultrafast). They take effect where the provider offers them (today a
            ChatGPT subscription's models); elsewhere the turn runs at standard
            speed. Omit for standard.
        hands_mode:
          type: string
          enum:
            - adaptive
            - brain_only
          description: >-
            Physical execution policy. `adaptive` (default) starts with Brain
            and lazily acquires Hands when work needs a shell, files, browser,
            or sandbox. `brain_only` permanently forbids physical Hands and
            secret materialization for this Session and all of its continuation
            Attempts; independently created Sessions keep their own policy.
        completion_mode:
          type: string
          const: run_outcome
          description: >-
            Requests a durable noninteractive completion envelope. The agent may
            return success, failure, or action_required plus any JSON result; a
            run that stops without recording one reports action_required, never
            success. Executor/runtime failures remain separate lifecycle errors.
        long_running:
          type: object
          properties:
            enabled:
              type: boolean
              description: >-
                `true` keeps the agent working through review rounds; `false`
                runs a single pass even when the repository's agent enables the
                Loop.
            rounds_max:
              type: integer
              minimum: 1
              maximum: 100000
              description: >-
                Most passes over the task, including the first. Defaults to the
                repository agent's setting, else 4.
          required:
            - enabled
          description: >-
            Long-running Loop for this Session's first task: after the agent's
            first pass, extra rounds re-examine and continue the work, a
            reviewer checks it against derived acceptance criteria, and an end
            the reviewer cannot verify reports `needs_review` (with
            `completion_mode: run_outcome`, outcome `failure`). Follow-up
            messages run single passes. Requires a cloud Session with a `repo`
            in a workspace where the Loop is enabled; otherwise create returns
            422 `long_running_not_supported`.
        tags:
          type: array
          items:
            type: string
          description: At most 50 tags; each tag is at most 100 UTF-8 bytes.
        branch:
          type: string
          description: >-
            Existing branch to check out and work on; commits land on this
            branch. Created off the default branch if it does not exist yet.
            Mutually exclusive with `pr_number` and `ref`.
        pr_number:
          type: integer
          minimum: 1
          description: >-
            Continue an existing pull request: the agent checks out its head
            branch and commits back onto it (no new PR). GitHub only. Mutually
            exclusive with `branch` and `ref`.
        ref:
          type: string
          description: >-
            Commit SHA, tag, or branch to snapshot: the agent starts a fresh
            working branch from this ref and opens a new PR. Mutually exclusive
            with `branch` and `pr_number`.
        base_branch:
          type: string
          description: >-
            Branch the Session's pull request targets. Alone, the Session starts
            from this branch's tip (`ref` defaults to it) and opens its PR
            against it. With `ref`, the Session starts from that ref, which
            stays the immutable checkout and publication base, and the PR
            targets this branch. Not combinable with `branch` or `pr_number`.
        env:
          type: object
          additionalProperties:
            type: string
          description: >-
            Session-scoped environment variables, injected into the agent's
            shell for this session only (and its follow-up turns). Names must
            match `^[A-Za-z_][A-Za-z0-9_]*$` and may not use reserved inference
            names; at most 64 keys, 32 KB per value, 256 KB total. Values
            override personal or workspace secrets of the same name, and are
            write-only (never returned by any read endpoint). On cloud machines
            they are injected with secret_injection false too, which turns off
            only stored secrets, so a Session can get one credential while
            inherited secrets stay off. A connected Device receives a session
            value only under a name whose stored secret allows Devices, so with
            secret_injection false it receives none. A value of 8 or more
            characters is masked in logs and transcripts where it appears
            verbatim or in a common encoding (reversed, base64, hex,
            URL-encoded, JSON-escaped); a value the agent transforms any other
            way is not masked, so do not rely on masking to keep a value from a
            Session that can read it.
        client_session_id:
          type: string
          format: uuid
          description: >-
            A Session id the caller chose (UUID v4), typically the one passed to
            `POST /sessions/prestart` (predictive start): the new Session takes
            this id, and the machine prestarted under it when this same caller
            made that prestart. Without `idempotency_key`, a retried create with
            the same id returns the original session; an id already taken
            otherwise is 409 `client_session_id_conflict`.
        idempotency_key:
          type: string
          description: >-
            Idempotent create: a retried POST with the same key and the same
            prompt returns the original session (HTTP 200) instead of creating a
            duplicate. Reusing the key with a different prompt returns 409
            `idempotency_key_conflict`; use a new key for a new task.
        spend_limit_credits:
          description: >-
            Optional shared session spending ceiling in credits ($0.04 each),
            including models, machines and manual desktop time. Null retains
            wallet limits. Automatic delegated sessions share their source
            ceiling.
          type:
            - string
            - 'null'
          pattern: ^(0|[1-9]\d{0,6})(\.\d{1,9})?$
        spend_limit_rcu:
          deprecated: true
          description: >-
            Deprecated: use `spend_limit_credits`. The same ceiling in the
            ledger's former unit (1 = $1/3, 8.33 credits). Sending both is
            refused unless they are equal.
          type:
            - string
            - 'null'
          pattern: ^(0|[1-9]\d{0,6})(\.\d{1,9})?$
        allow_model_rollover:
          type: boolean
          description: >-
            When the Session's subscription or key runs out (a plan's usage
            limit, no credits left, a refused sign-in), the turn goes on instead
            of failing on the next source in the Session's routing order:
            another of the workspace's connected accounts, which may serve
            another model (including another provider's), or Reason until the
            workspace's credits run out. To keep a Session on one account and
            model, pass `model_source_id` with `allow_model_rollover: false`.
            Defaults to true when you are signed in as yourself (Reason CLI, TUI
            or an MCP sign-in) and to false with an API key that names a model,
            which keeps that exact model; an API key that names none (or `auto`)
            routes too. Ephemeral benchmark Sessions never roll over.
        delegation:
          description: >-
            Opt-in deeper delegation. Without it the Session's tree is
            unchanged: two levels deep (the Session's subagents may start their
            own, which cannot), and subagents never create Sessions. The whole
            tree inherits these limits and its agents can only lower them for
            what they start. Every tree keeps one cap of 100 live agents,
            whatever its depth. An omitted field takes the default. A dated
            runtime release (`experimental_runtime_profile` naming one) keeps
            the rules it was published with and returns 400
            `delegation_runtime_unsupported`.
          type: object
          properties:
            max_depth:
              type: integer
              minimum: 1
              maximum: 5
              description: >-
                How deep the Session's subagent tree may nest below it: 1 lets
                only its own subagents run, 2 (the default without this field)
                lets them start one more level, and each higher value one level
                more. Counted from the root Session.
            children_can_create_sessions:
              type: boolean
              description: >-
                Let subagents above the last level create Sessions with
                sessions_create. Those Sessions join this tree: they sit one
                level below their creator and count toward the tree's cap of 100
                live agents. Default false.
        execution_budget:
          description: >-
            Optional task authorization shared by automatic continuations and
            delegated sessions. New tasks have no deadline by default; zero
            explicitly selects no deadline. Positive durations range from one
            minute to 1,000 hours. Wall clock starts at execution admission and
            includes recovery waits. Spending reserves concurrent inference
            costs before dispatch; omitted/null spending retains account limits.
          type: object
          properties:
            wall_clock_max_ms:
              description: >-
                Execution deadline in milliseconds from admission, including
                recovery waits and automatic continuations. Zero or omission
                selects no deadline for a new task.
              type: integer
              minimum: 0
              maximum: 3600000000
            spend_limit_usd:
              description: >-
                Shared task spending ceiling in US dollars. Omit or set null to
                retain account limits; concurrent inference costs are reserved
                before dispatch. Requires a Reason-hosted model: a session whose
                model runs on the workspace's own provider credential is refused
                with execution_budget_provider_unsupported.
              type:
                - number
                - 'null'
              minimum: 0
              maximum: 1000000
        require_ready:
          type: boolean
          default: false
          description: >-
            Before starting, Reason checks what the Session will be missing from
            what it already knows: connections (MCP servers and plugins) that
            are signed out, failed their last check or name a secret with no
            value, and, with `require_ready: true` only, secrets Sessions under
            its Reason asked for that still have none. The checks run beside the
            create and never delay it: by default the Session starts anyway and
            the response lists in `warnings` what the checks found by the time
            it was created, leaving out a check still running. true waits for
            the checks (at most 1.5 seconds) and refuses with 422
            `session_not_ready` and the `warnings` when something is missing,
            creating nothing, so a headless caller fails fast; a check that
            cannot complete in that time never blocks the create. A repository
            the workspace cannot reach always fails with 400
            `repo_not_connected`.
      required:
        - prompt
    SessionCreateResponse:
      type: object
      properties:
        session_id:
          type:
            - string
            - 'null'
        project_id:
          deprecated: true
          description: 'Deprecated: Projects are retired in favour of Reasons.'
          type:
            - string
            - 'null'
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        url:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - running
            - exit
            - error
            - suspended
          description: >-
            Lifecycle state, not task success: running, exit (execution
            completed), error (execution failed), or suspended (cancelled/quota;
            suspended_reason says which). An exit can have outcome failure or
            action_required. The task succeeded if and only if outcome is
            success; check outcome, result, and diagnostics before treating work
            as successful.
        session_policy:
          type: object
          properties:
            version:
              type: number
              const: 1
              description: Version of this policy shape.
            mode:
              type: string
              enum:
                - standard
                - isolated
                - ephemeral
              description: >-
                How the Session runs: standard for normal work, ephemeral for a
                single benchmark trial. isolated is retired: only Sessions
                created before its retirement report it, and a retry, follow-up,
                wake or move of one returns 409 session_mode_retired.
            components:
              type: object
              properties:
                memoryRead:
                  type: boolean
                  description: Whether memory reads are enabled.
                memoryWrite:
                  type: boolean
                  description: Whether memory writes are enabled.
                skills:
                  type: boolean
                  description: Whether skills are enabled.
                inheritedInstructions:
                  type: boolean
                  description: Whether inherited instructions are enabled.
                integrations:
                  type: boolean
                  description: Whether integrations are enabled.
                secretInjection:
                  type: boolean
                  description: Whether secret injection is enabled.
              required:
                - memoryRead
                - memoryWrite
                - skills
                - inheritedInstructions
                - integrations
                - secretInjection
              description: >-
                The optional capability families, each enabled (true) or
                disabled (false) for this Session.
            workspaceOwnership:
              type: string
              enum:
                - managed
                - externally-managed
              description: >-
                Filesystem persistence owner. Sessions created with the
                deprecated ara-managed spelling report managed.
            personalContext:
              description: >-
                Present and false when the Session was created with
                personal_context: false: it runs without its creator's personal
                skills, memory, secrets and connections. Absent when the
                creator's personal context loads.
              type: boolean
              const: false
            pullRequestPolicy:
              description: >-
                Present as draft_only when the Session was created with
                pull_request_policy: draft_only: its pull requests stay drafts
                and it cannot merge, queue, auto-merge or mark one ready. Absent
                for the normal delivery flow.
              type: string
              const: draft_only
          required:
            - version
            - mode
            - components
            - workspaceOwnership
          description: >-
            Server-resolved immutable Session policy. Enabled components remain
            subject to normal permissions and configuration.
        runtime_profile:
          description: >-
            runtime/reason-sync-yield-v1 on a retired isolated Session that
            requested it through the retired runtime_profile field. Null
            otherwise.
          oneOf:
            - type: string
              const: runtime/reason-sync-yield-v1
            - type: 'null'
        experimental_runtime_profile:
          description: >-
            The runtime profile the Session's latest Attempt runs: the default
            C2 harness on every Session that runs it, whether or not its request
            named it (a Session of the retired
            runtime/reason-capability-shell-v1 continues on it) — reported as
            runtime/reason-c2-tools-v7; runtime/reason-v7-sync-yield-v1 or
            runtime/reason-v7-sync-yield-machine-sdk-v1 on a stored Session of
            that retired harness; runtime/reason-v7-2026-10,
            runtime/reason-v7-2026-11, runtime/reason-v8-2026-10,
            runtime/reason-v8.1-2026-10, runtime/reason-v8.2-2026-10,
            runtime/reason-agent-1.2, runtime/reason-agent-1.3 or
            runtime/reason-agent-1.3.1 on a Session that runs it; a Session of a
            deleted v7 evaluation profile reports the default C2 harness, which
            it re-admits to. Null otherwise.
          oneOf:
            - type: string
              enum:
                - runtime/reason-c2-tools-v7
                - runtime/reason-v7-sync-yield-v1
                - runtime/reason-v7-sync-yield-machine-sdk-v1
                - runtime/reason-v7-2026-10
                - runtime/reason-v7-2026-11
                - runtime/reason-v8-2026-10
                - runtime/reason-v8.1-2026-10
                - runtime/reason-v8.2-2026-10
                - runtime/reason-agent-1.2
                - runtime/reason-agent-1.3
                - runtime/reason-agent-1.3.1
            - type: 'null'
        experimental_runtime_features:
          description: >-
            The runtime features the Session's create named
            (experimental_runtime_features), in canonical order. Null when it
            named none.
          type:
            - array
            - 'null'
          items:
            type: string
            enum:
              - banner
              - sdk_index
              - service_tier
              - output_cap
              - git_metadata
              - serial_reads
              - recovery_defer_idle_hands
              - fewer_tests_low
              - fewer_tests_medium
              - fewer_tests_high
              - fewer_tests_max
              - fewer_tests_max_alone
              - verify_line_alone
              - addendum_placebo
              - bash_yield
              - sync_bash
              - turn_line_removed
              - turn_line_questions
              - output_cap_continue
              - image_history_append_only
              - cache_ttl_1h
        placement_receipt:
          $ref: '#/components/schemas/PlacementReceipt'
        delegation:
          type: object
          properties:
            max_depth:
              type: integer
              minimum: 1
              maximum: 5
              description: How deep the tree may nest below its root Session.
            children_can_create_sessions:
              type: boolean
              description: >-
                Whether subagents above the last level may create Sessions that
                join the tree.
          required:
            - max_depth
            - children_can_create_sessions
          description: >-
            The delegation limits a caller set for this Session's tree (see
            `delegation` on createSession); absent when none were set, which is
            the default tree.
        reason_id:
          description: >-
            The Reason the Session is filed under, or null for none. The same id
            as project_id.
          type:
            - string
            - 'null'
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        model:
          description: >-
            The concrete model the Session was admitted with, after Auto and any
            model rollover resolved it; the same value Retrieve a session
            reports as model. Null when no session was created.
          type:
            - string
            - 'null'
        reasoning_effort:
          description: The reasoning effort the Session runs with; null when none was set.
          type:
            - string
            - 'null'
        allow_model_rollover:
          type: boolean
          description: >-
            Whether model rollover is in effect for this Session: true when a
            run-out subscription or key may continue the turn on another
            connected account or on Reason (see allow_model_rollover on the
            request), false when the Session keeps the exact model it named.
        model_source_id:
          description: >-
            The connected account the Session runs on: where its model routing
            starts, or the account `model_source_id` pinned with
            `allow_model_rollover: false`. Null when neither applies.
          type:
            - string
            - 'null'
        model_rolled_over:
          type: boolean
          description: >-
            True when a usage limit or outage already moved this first turn off
            the account it would otherwise use, onto another connected account
            or Reason credits, for the same model. It reports admission only;
            later rollovers are not reflected here.
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/SessionStartWarning'
          description: >-
            What the new Session will be missing, found by the checks that
            finished before it was created (see `require_ready`); the Session
            started anyway. Absent when nothing is known to be missing; send
            `require_ready: true` for the complete check. A replay of an earlier
            create reports none.
      required:
        - session_id
        - project_id
        - url
        - status
        - session_policy
        - reason_id
    Error:
      type: object
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              required:
                - type
                - message
              properties:
                type:
                  type: string
                message:
                  type: string
                request_id:
                  type:
                    - string
                    - 'null'
        message:
          type: string
        required_scope:
          type: string
          description: >-
            The capability required when the request was denied for a missing
            scope.
    SessionStartWarning:
      type: object
      properties:
        code:
          type: string
          enum:
            - integration_needs_auth
            - integration_offline
            - integration_error
            - integration_secret_missing
            - reason_secret_missing
          description: >-
            integration_needs_auth: a connection is signed out or has no token.
            integration_offline / integration_error: it failed its last
            connection check. integration_secret_missing: its configuration
            names a secret with no value. reason_secret_missing: Sessions under
            the Reason asked for a secret that still has no value this Session
            gets.
        integration:
          type: string
          description: The connection's slug, for an integration warning.
        secret_name:
          type: string
          description: The secret's name (never its value), for a secret warning.
        message:
          type: string
          description: 'One plain sentence: what is missing and how to fix it.'
      required:
        - code
        - message
    SessionCompaction:
      type: object
      properties:
        threshold_tokens:
          description: >-
            The context size, in tokens, at which the Session folds its earlier
            turns into a summary (automatic compaction). A value past what the
            model can hold (its window less its output room) compacts there
            instead; getSession reports the effective
            `context.compaction_threshold_tokens` and its
            `context.compaction_threshold_source`. null clears the Session's own
            value, leaving the workspace's `compaction` setting (updateSetting)
            or else Reason's recommendation. Reason's recommendation for a
            Reason-paid model with a long-context price tier (GPT-6 Luna: input
            past 272k costs double) compacts about 32k below that tier; a higher
            threshold pays the long-context price for every request past it.
          type:
            - integer
            - 'null'
          minimum: 64000
          maximum: 10000000
      required:
        - threshold_tokens
      additionalProperties: false
      description: >-
        Sets the Session's context compaction policy from now on, for this and
        later turns (and the Sessions it starts afterwards). A turn already
        running keeps the threshold it started with; the next turn uses the new
        one.
    PlacementReceipt:
      type: object
      properties:
        execution:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
            target:
              type: object
              properties:
                kind:
                  type: string
                  enum:
                    - cloud
                    - mac
                    - headless
                    - cli
                    - worker
                computer_id:
                  type: string
                device_id:
                  type: string
                root_id:
                  type: string
              required:
                - kind
            basis:
              type: string
              enum:
                - applied_placement
                - transition_source
                - retained_placement
          required:
            - status
            - reason
          description: >-
            Observed Session placement, not launch intent, desktop origin or a
            requested destination. Known identifies a placement, not permission
            or a guarantee that a command can run.
        physical_control:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
            target:
              type: object
              properties:
                kind:
                  type: string
                  enum:
                    - cloud
                    - mac
                    - headless
                    - cli
                    - worker
                computer_id:
                  type: string
                device_id:
                  type: string
                root_id:
                  type: string
              required:
                - kind
          required:
            - status
            - reason
          description: >-
            Physical control can target a different computer for each operation.
            No default target is inferred from execution or desktop provenance.
        root_grant:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
            root_id:
              type: string
          required:
            - status
            - reason
          description: >-
            A known root id is not proof of a current grant. Operations
            reauthorize their exact root and actor.
        browser:
          type: object
          properties:
            status:
              type: string
              enum:
                - known
                - unknown
                - unavailable
            reason:
              type: string
          required:
            - status
            - reason
          description: >-
            Browser profile and signed-in identity are operation-specific.
            Unknown does not mean signed out or unavailable.
        computer:
          description: >-
            Authorized inventory observation only; ready or live does not assert
            this Session is executing there.
          type: object
          properties:
            id:
              type: string
            kind:
              type: string
              enum:
                - cloud
                - mac
                - cli
                - worker
            state:
              type: string
            live:
              type: boolean
          required:
            - id
            - kind
            - state
            - live
      required:
        - execution
        - physical_control
        - root_grant
        - browser
      description: >-
        Additive observational receipt. Unknown means this response cannot
        establish the fact; unavailable means there is affirmative evidence it
        is not currently usable. Never authorizes an operation. Absent on older
        servers and on list responses.
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: prompt_required
    Unauthorized:
      description: Missing, invalid, or expired key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: missing_bearer
            message: Authorization required
    RateLimited:
      description: >-
        Too many requests. Retry after the number of seconds in the
        `Retry-After` response header.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
            minimum: 1
          required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: rate_limited
              message: This API key exceeded its request-rate limit
  securitySchemes:
    reasonApiKey:
      type: http
      scheme: bearer
      bearerFormat: 'reason_<hex> (legacy: ara_<hex>)'
      description: >-
        Your Reason API key from Settings › API keys. New keys use `reason_`;
        legacy `ara_` keys remain accepted. Keys are capability-scoped: run,
        mcp:read, mcp:write, secrets:read, secrets:write, sessions:read,
        sessions:debug, devices:read, devices:write, devices:use,
        computers:read, computers:write, ssh:write, knowledge:read, memory:read,
        memory:write, skills:read, skills:write, pages:read, pages:write,
        repos:read, repos:write, reviews:read, reviews:write, deployment:read,
        analytics:read, org:read, org:write, attachments:read,
        attachments:write, guardrails:read, guardrails:write, network:read,
        network:write, automations:read, automations:write, agent_auth:read.
        devices:write, devices:use, computers:read, computers:write, ssh:write,
        network:read and network:write are opt-in, excluded from default keys.
        computers:read lists visible cloud and connected computers without
        waking them or granting execution access. devices:read discovers local
        Device targets; devices:use separately consents to local execution, so a
        discover-and-run local workflow needs both. devices:write manages
        enrollment and device grants; computers:write creates or deletes cloud
        computers; ssh:write manages retained SSH access. network:read reads the
        saved workspace network policy; network:write replaces custom allowed
        hosts and requires a current organization owner/admin. Legacy project
        PATCH requests containing network_allowed_hosts also require
        network:write plus their existing run scope and project management
        permission; saved project hosts do not affect current session egress.
        Only owners/admins can mint or manage keys with network:write; keys
        cannot grant themselves more authority. See /docs/network-policies for
        replacement semantics and runtime applicability. mcp:write manages MCP
        server configuration only; it does not authorize remote MCP-tool
        execution. sessions:read reads sessions, including the assistant,
        reasoning and tool activity in their events. sessions:debug is
        privileged: only for organization owners/admins, it expands session
        events to the full diagnostic projection (diagnostic event kinds, status
        text and raw event metadata).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.