Skip to main content
POST
Create a session

Authorizations

Authorization
string
header
required

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, knowledge:read, memory:read, memory:write, skills:read, skills: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. network:read and network:write are opt-in, excluded from default keys. 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).

Headers

X-Reason-Agent
string

Optional self-reported caller agent name. If absent, the server uses the User-Agent for external callers.

Maximum string length: 80

Path Parameters

orgId
string
required

Organization id or slug. Resolve it with GET /v3/self.

Body

application/json
prompt
string
required

What the agent should do. Maximum 256 KiB when UTF-8 encoded.

mode
enum<string>
default:standard

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 createEphemeralWorkspace: 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.

Available options:
standard,
ephemeral
workspace_ownership
enum<string>
default:managed

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.

Available options:
managed,
externally-managed,
ara-managed
personal_context
boolean
default:true

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
enum<string>

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.

Available options:
draft_only
sandbox_target_id
string<uuid>

Explicit sandbox target. Requires devices:use. Cannot be combined with target or managed workspace ownership; unavailable targets are refused without falling back to cloud.

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
boolean
default:true

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. 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
enum<string>

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

Available options:
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
experimental_runtime_features
enum<string>[]

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. 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 or runtime/reason-agent-1.3, 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 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 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.

Maximum array length: 21
Available options:
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
project_id
string<uuid>
deprecated

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.

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)$
reason_id
string<uuid>

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.

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)$
target
object

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.

attachments
object[]

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
string

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
boolean

false: with project_id and no repo, start a scratch session instead of checking out the Reason's first default repository.

provider
enum<string>

Source-control provider for the repo. GitHub is the only supported provider.

Available options:
github
model
string

The model the agent runs on, by an id listAgentModels returns. Omit it or send auto for the workspace default.

reasoning_effort
enum<string>

Optional reasoning effort override for the selected model.

Available options:
minimal,
low,
medium,
high,
xhigh,
max
hands_mode
enum<string>

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.

Available options:
adaptive,
brain_only
completion_mode
string

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.

Allowed value: "run_outcome"
long_running
object

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
string[]

At most 50 tags; each tag is at most 100 UTF-8 bytes.

branch
string

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
integer

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.

Required range: x >= 1
ref
string

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
string

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
object

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
string<uuid>

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
string

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
string | null

Optional shared session spending ceiling in credits ($0.04 each), including models, machines and manual desktop time. Decimal string with up to nine fractional digits. Null retains wallet limits. Automatic delegated sessions share their source ceiling.

Pattern: ^(0|[1-9]\d{0,6})(\.\d{1,9})?$
spend_limit_rcu
string | null
deprecated

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.

Pattern: ^(0|[1-9]\d{0,6})(\.\d{1,9})?$
allow_model_rollover
boolean

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 with the same model on the provider's other connected accounts, then on Reason until the workspace's credits run out, instead of failing. 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, which keeps the exact model it named. Ephemeral benchmark Sessions never roll over.

execution_budget
object

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.

require_ready
boolean
default:false

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.

Response

Idempotent replay of the original session.

session_id
string | null
required
project_id
string<uuid> | null
required
deprecated

Deprecated: Projects are retired in favour of Reasons.

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
string | null
required
status
enum<string>
required

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.

Available options:
running,
exit,
error,
suspended
session_policy
object
required

Server-resolved immutable Session policy. Enabled components remain subject to normal permissions and configuration.

reason_id
string<uuid> | null
required

The Reason the Session is filed under, or null for none. The same id as project_id.

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)$
runtime_profile
string | null

runtime/reason-sync-yield-v1 on a retired isolated Session that requested it through the retired runtime_profile field. Null otherwise.

Allowed value: "runtime/reason-sync-yield-v1"
experimental_runtime_profile
enum<string> | null

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 or runtime/reason-agent-1.3 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.

Available options:
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
experimental_runtime_features
enum<string>[] | null

The runtime features the Session's create named (experimental_runtime_features), in canonical order. Null when it named none.

Available options:
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
model
string | null

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.

reasoning_effort
string | null

The reasoning effort the Session runs with; null when none was set.

allow_model_rollover
boolean

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_rolled_over
boolean

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
object[]

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.