{"openapi":"3.1.0","info":{"title":"Rush Cloud API","version":"1.0.0"},"servers":[{"url":"https://api.prix.dev","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Sessions","description":"Start, list, read and steer sessions. A session is one agent run in its own sandbox."},{"name":"Events","description":"Follow a session live over server-sent events, or read its log."},{"name":"Messages","description":"Read a session's transcript and tool calls, and send it follow-ups."},{"name":"Results & artifacts","description":"The answer, changed files, captured transcript and files a session produced."},{"name":"API keys","description":"Org API keys for server-to-server calls, and the webhook each key delivers to."},{"name":"Agents & models","description":"The harnesses, models, MCP servers and plugin marketplaces an org can run."},{"name":"Webhooks","description":"Requests Rush Cloud sends to your server."}],"paths":{"/o/{org}/sessions":{"parameters":[{"$ref":"#/components/parameters/Org"}],"get":{"tags":["Sessions"],"x-audience":"public","summary":"Search the org's sessions, or resolve one by selector","description":"Without `selector`, lists sessions across every Project in the org (and\nthose with no Project), newest first, filtered by the query parameters.\nWith `selector`, resolves exactly one session by full id, unique id\nprefix, or title; when it matches more than one, the answer is `409` with\nthe `candidates`. A caller that already has the id should read\n`GET /o/{org}/p/_/sessions/{session}` instead.\n\nThis route's errors use `{code, message}`.\n","operationId":"listOrResolveSessions","parameters":[{"name":"selector","in":"query","schema":{"type":"string"},"description":"Exact id, a unique id prefix, or a title. Switches the route into resolution mode."},{"name":"q","in":"query","description":"Full-text match across title, prompt and content. Repeatable. Ignored with `selector`.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true},{"name":"project","in":"query","schema":{"type":"string"},"description":"Only this Project (handle or id). A handle from another org returns no rows."},{"name":"agent","in":"query","schema":{"type":"string"},"description":"Harness as dispatched, e.g. `claude` or `codex`."},{"name":"kind","in":"query","schema":{"type":"string","enum":["cloud","local"]},"description":"Every session today is `cloud`; `local` returns an empty list."},{"name":"harness","in":"query","schema":{"$ref":"#/components/schemas/Harness"}},{"name":"mode","in":"query","schema":{"type":"string","enum":["headless","interactive"]}},{"name":"model","in":"query","schema":{"type":"string"}},{"name":"repo","in":"query","schema":{"type":"string"},"description":"`owner/name`."},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/SessionStatus"}},{"$ref":"#/components/parameters/Since"},{"$ref":"#/components/parameters/Until"},{"name":"sort","in":"query","schema":{"type":"string","enum":["recent","cost","duration"],"default":"recent"}},{"name":"count","in":"query","description":"When `true`, return only `count` and an empty `sessions`.","schema":{"type":"boolean","default":false}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"The matching sessions, or the one session a selector resolved to.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SessionList"},{"$ref":"#/components/schemas/Session"}]},"examples":{"list":{"summary":"A page of sessions","value":{"sessions":[{"id":"3f9c2a71d04b8e65","kind":"cloud","short_id":"3f9c2a71","title":"Fix the flaky checkout test","project":"web","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","agent":"claude","harness":"claude","harness_version_requested":null,"harness_version_resolved":"2.1.291","model":"claude-opus-5-5","mode":"headless","status":"completed","prompt":"Fix the flaky checkout test and open a PR.","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","error":null,"session_capture":"complete","message_count":24,"input_tokens":182340,"output_tokens":9120,"cache_read_tokens":1204500,"cache_write_tokens":40210,"cost_usd":1.84,"duration_ms":412000,"tool_call_count":37,"started_by":{"name":"Dana Lee","avatar_url":null},"summary":"Pinned the clock in checkout.spec.ts and opened PR","artifacts":[],"artifact_count":0,"agent_profile":null,"created_at":"2026-10-06T15:02:11.000Z","updated_at":"2026-10-06T15:09:03.000Z"}],"next_cursor":"NTA="}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The selector matched more than one session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmbiguousSelector"}}}}}}},"/o/{org}/p/{project}/sessions":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"}],"get":{"tags":["Sessions"],"x-audience":"public","summary":"List sessions in one Project","description":"Newest first, at most 100. With `{project}` = `_`, every session in the\norg the caller can read. Rows are `CloudRunSession`, the same shape a\ncreate or a single read returns, unlike `GET /o/{org}/sessions`.\n","operationId":"listSessions","parameters":[{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/SessionStatus"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Sessions in this Project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudRunSessionList"},"examples":{"page":{"$ref":"#/components/examples/CloudRunSessionList"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Sessions"],"x-audience":"public","summary":"Start a session","description":"Starts one agent run in a fresh sandbox and returns it at once with\n`202`; follow it with `GET …/events` or the key's webhook. `{project}` =\n`_` runs without a repository; a Project handle runs in that Project's\nrepository with its connectors.\n\nStarted with an API key, the run uses Rush's models, metered on the key\ncreator's plan, unless `account_id` names one of the creator's own\nAnthropic or OpenAI API-key accounts. A key may have `max_concurrent` runs\nin progress (default 4); one more is `429 RATE_LIMITED`.\n","operationId":"createSession","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCreate"},"examples":{"repoless":{"summary":"A run with no repository","value":{"agent":"claude","prompt":"Summarize the open issues labelled bug in three bullet points.","persistence":"ephemeral"}},"structured":{"summary":"A run that must answer in a JSON shape","value":{"agent":"codex","model":"gpt-5.5","effort":"high","prompt":"Read package.json and report the test command.","output_schema":{"type":"object","properties":{"test_command":{"type":"string"}},"required":["test_command"],"additionalProperties":false}}}}}}},"responses":{"202":{"description":"The session, as created. `status` is `queued`, `allocating` or `running` depending on admission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudRunSession"},"example":{"execution_id":"3f9c2a71d04b8e65","kind":"cloud","project_id":null,"agent":"claude","status":"queued","persistence_mode":"ephemeral","prompt":"Summarize the open issues labelled bug in three bullet points.","created_at":"2026-10-06T15:02:11.000Z"}}}},"400":{"description":"The body is invalid: no `prompt`, no `agent` on a `_` run, an unknown\n`effort`, `speed` or `persistence`, a malformed repository, or an\n`output_schema` outside the accepted subset (`code`\n`OUTPUT_SCHEMA_INVALID`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing required field: prompt"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The plan does not cover this run: `PLAN_REQUIRED` (Rush's models need\na paid plan), `TOKEN_LIMIT_REACHED`, `COMPUTE_LIMIT_REACHED`,\n`WEEKLY_COMPUTE_LIMIT_REACHED`, `SPEND_CAP_REACHED` or\n`PAYMENT_METHOD_REQUIRED`.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Rush's models need a paid plan. Choose a plan in Billing to run on them, metered on your plan.","code":"PLAN_REQUIRED"}}}},"403":{"description":"The repository is not in a GitHub App installation linked to the caller (`INSTALLATION_NOT_LINKED`, `REPO_NOT_IN_INSTALLATION`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The Project's GitHub App installation is suspended, `on_pr` names a pull request that is not open, or a saved agent's catalog changed since it was reviewed (`CATALOG_REFRESH_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"An attached payload is over its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A field the run cannot honor: an agent outside `claude`, `codex`,\n`opencode` (`UNSUPPORTED_AGENT`); a `model` the harness does not list\nin `GET /o/{org}/agents/available` (`error_code` `MODEL_UNSUPPORTED`);\n`output_schema` on `opencode` (`FIELD_UNSUPPORTED_FOR_HARNESS`); or a\nsaved agent or sources on a key run (`API_KEY_FIELD_UNSUPPORTED`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"claude-opus-9 is not a model the claude harness lists.","error_code":"MODEL_UNSUPPORTED"}}}},"429":{"description":"The API key already has `max_concurrent` runs in progress (`RATE_LIMITED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This API key already has 4 runs in progress.","code":"RATE_LIMITED"}}}}}}},"/o/{org}/p/{project}/sessions/{session}":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Sessions"],"x-audience":"public","summary":"Get one session","operationId":"getSession","responses":{"200":{"description":"The session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudRunSession"},"examples":{"completed":{"$ref":"#/components/examples/CloudRunSession"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"patch":{"tags":["Sessions"],"x-audience":"public","summary":"Cancel, pause, resume, or stop the current turn","description":"One status change per request. `cancelled` ends the run. `paused` parks\na resumable sandbox with its disk and memory; `running` wakes it. Both\nanswer `202` with an `operation_id`. `stop_turn` interrupts the turn in\nprogress and keeps the session. Any other field, or another `status`, is\n`400`.\n","operationId":"updateSessionStatus","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"additionalProperties":false,"properties":{"status":{"type":"string","enum":["cancelled","paused","running","stop_turn"]}}},"example":{"status":"cancelled"}}}},"responses":{"200":{"description":"The change took effect.","content":{"application/json":{"schema":{"type":"object","required":["ok","status"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","enum":["cancelled","stop_turn_confirmed"]}}},"example":{"ok":true,"status":"cancelled"}}}},"202":{"description":"A pause or resume was accepted and runs in the background.","content":{"application/json":{"schema":{"type":"object","required":["operation_id"],"properties":{"operation_id":{"type":"string"}}},"example":{"operation_id":"op_5c1d9e0f2a7b"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The session cannot make this change now: it already finished, has no\nsandbox to pause or resume, has no turn to stop (`NO_ACTIVE_TURN`), or\nwaking it would exceed the plan's concurrent runs\n(`CONCURRENCY_LIMIT_REACHED`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Cannot cancel: already completed"}}}},"422":{"description":"`stop_turn` only: the runtime could not confirm the stop (`STOP_TURN_UNCONFIRMED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/p/{project}/sessions/{session}/events":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Events"],"x-audience":"public","summary":"Follow a session live","description":"A server-sent event stream of the run as it happens. Before the sandbox\nstarts you get `status` events (`{status}`); then the harness's own\nevents, each with an `id`. The stream ends with `done`, whose data is\n`{status, output, result}`: `result` is the `SessionAnswer`, or null when\nthe run produced none. `error` (`{message}`) ends it early. Reconnect\nwith `Last-Event-ID` (or `?cursor=`) to resume after the last event you\nsaw. Comment lines (`: keepalive`) keep idle connections open.\n","operationId":"streamSession","parameters":[{"name":"Last-Event-ID","in":"header","schema":{"type":"string"},"description":"Resume after this event id."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Same as `Last-Event-ID`, for clients that cannot set headers."}],"responses":{"200":{"description":"The event stream.","content":{"text/event-stream":{"schema":{"type":"string"},"example":"event: status\ndata: {\"status\":\"allocating\",\"id\":\"3f9c2a71d04b8e65\"}\n\nevent: done\ndata: {\"status\":\"completed\",\"output\":\"runtime: guest harness completed\",\"result\":{\"text\":\"Pinned the clock in checkout.spec.ts.\",\"structured\":null,\"schema_valid\":null}}\n"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/messages":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Messages"],"x-audience":"public","summary":"Read a session's transcript","description":"The captured transcript as normalized events, filtered and sliced on the\nserver. A turn starts at each user message; `first`/`last` keep that many\nturns, then `include`/`exclude` filter by role. Available once the run\nhas captured its transcript; before that the answer is `404`.\n","operationId":"getSessionMessages","parameters":[{"name":"include","in":"query","description":"Comma-separated roles to keep.","schema":{"type":"string","example":"user,assistant"}},{"name":"exclude","in":"query","description":"Comma-separated roles to drop. Not with `include`.","schema":{"type":"string","example":"thinking"}},{"name":"first","in":"query","schema":{"type":"integer","minimum":1},"description":"Keep the first N turns. Not with `last`."},{"name":"last","in":"query","schema":{"type":"integer","minimum":1},"description":"Keep the last N turns. Not with `first`."}],"responses":{"200":{"description":"The transcript slice.","content":{"application/json":{"schema":{"type":"object","required":["execution_id","agent","format","event_count","events"],"properties":{"execution_id":{"type":"string"},"agent":{"type":["string","null"]},"format":{"type":"string","description":"The transcript format: `claude`, `codex`, `opencode`, `rush` or `opaque`."},"event_count":{"type":"integer"},"events":{"type":"array","items":{"$ref":"#/components/schemas/SessionEvent"}}}},"example":{"execution_id":"3f9c2a71d04b8e65","agent":"claude","format":"claude","event_count":2,"events":[{"type":"message","agent":"claude","timestamp":"2026-10-06T15:02:14.120Z","role":"user","content":"Fix the flaky checkout test and open a PR."},{"type":"message","agent":"claude","timestamp":"2026-10-06T15:08:58.402Z","role":"assistant","content":"Pinned the clock in checkout.spec.ts and opened PR 412."}]}}}},"400":{"description":"A bad filter (an unknown role, `include` with `exclude`, or `first` with `last`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"invalid role \"system\"; valid: user, assistant, thinking, tools"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["Messages"],"x-audience":"public","summary":"Send a follow-up","description":"Delivers a message to the session's agent. A parked resumable sandbox\nis woken first. When a turn is still running, the message is queued and\ndelivered when the turn ends: the answer is then `202` with its place in\nthe queue. Ephemeral sessions take no queued messages.\n","operationId":"postSessionMessage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string","minLength":1,"description":"The message. At most 256 KiB."}}},"example":{"content":"Also add a regression test for the timezone case."}}}},"responses":{"200":{"description":"Delivered to the agent.","content":{"application/json":{"schema":{"type":"object","required":["ok","status"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","const":"message_sent"}}},"example":{"ok":true,"status":"message_sent"}}}},"202":{"description":"Queued behind the running turn.","content":{"application/json":{"schema":{"type":"object","required":["ok","status","message_id","position"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","const":"queued"},"message_id":{"type":"string","format":"uuid"},"position":{"type":"integer","minimum":1,"description":"1-based place in the queue."}}},"example":{"ok":true,"status":"queued","message_id":"6a1e2b3c-4d5e-4f60-8a71-b2c3d4e5f607","position":1}}}},"400":{"description":"No `content`, or `content` over its size limit (`CONTENT_TOO_LARGE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Missing required field: content"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The plan does not cover more usage (same codes as starting a session).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"The session cannot take a message: it is closed (`TASK_TERMINAL`), not\nstarted yet, ephemeral with a turn running (`PERSISTENCE_MODE_CONFLICT`),\nor its run cannot be continued (`CONTINUATION_UNSUPPORTED`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"This Task is closed and its computer is gone. Start a new Task.","code":"TASK_TERMINAL"}}}},"429":{"description":"The queue already holds 20 messages (`QUEUE_FULL`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/o/{org}/p/{project}/sessions/{session}/tool-calls":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Messages"],"x-audience":"public","summary":"List a session's tool calls","description":"Indexed from the captured transcript, in call order. `program` is the command a shell call ran (`git`, `bun`), so it can be filtered without reading inputs.","operationId":"getSessionToolCalls","parameters":[{"name":"tool","in":"query","schema":{"type":"string"},"description":"Only this tool."},{"name":"program","in":"query","schema":{"type":"string"},"description":"Only calls that ran this program, e.g. `git`."},{"name":"outcome","in":"query","schema":{"type":"string","enum":["success","error","cancelled"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"responses":{"200":{"description":"The tool calls.","content":{"application/json":{"schema":{"type":"object","required":["tool_calls"],"properties":{"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"}}}},"example":{"tool_calls":[{"call_key":"toolu_01HkQx7","ordinal":0,"tool":"Bash","program":"bun","programs":["bun"],"input":"{\"command\":\"bun test checkout.spec.ts\"}","outcome":"error","exit_code":1,"error_code":"v1:Bash:exit-1","end_timestamp":"2026-10-06T15:03:40.511Z"}]}}}},"400":{"description":"An unknown `outcome`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/trajectory":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Results & artifacts"],"x-audience":"public","summary":"Download the captured transcript, or its metadata","description":"With `Accept: application/x-ndjson`, the raw transcript exactly as the\nharness wrote it (its format is in the `X-Session-Format` header).\nOtherwise a small JSON description of it. `404` until a transcript is\ncaptured.\n","operationId":"getSessionTrajectory","responses":{"200":{"description":"The metadata, or the raw transcript.","content":{"application/json":{"schema":{"type":"object","required":["execution_id","format","bytes","key","agent","captured_at"],"properties":{"execution_id":{"type":"string"},"format":{"type":["string","null"]},"bytes":{"type":["integer","null"]},"key":{"type":"string","description":"Storage key of the transcript."},"agent":{"type":["string","null"]},"captured_at":{"type":["string","null"],"format":"date-time"}}},"example":{"execution_id":"3f9c2a71d04b8e65","format":"claude","bytes":482113,"key":"cloud-runs/3f9c2a71d04b8e65/session.claude.jsonl","agent":"claude","captured_at":"2026-10-06T15:09:03.000Z"}},"application/x-ndjson":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/changes":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Results & artifacts"],"x-audience":"public","summary":"List the files the session's pull request changed","description":"Read from the run's GitHub pull request, so it works after the sandbox\nis gone. A run with no pull request returns an empty list. When GitHub\ncannot be read, the answer is still `200`, with the PR link, no files,\nand `error_code` `CHANGES_NO_INSTALLATION` or `CHANGES_LIST_FAILED`.\n","operationId":"getSessionChanges","responses":{"200":{"description":"The changed files.","content":{"application/json":{"schema":{"type":"object","required":["pr_url","pr_number","files","totals"],"properties":{"pr_url":{"type":["string","null"]},"pr_number":{"type":["integer","null"]},"files":{"type":"array","items":{"type":"object","required":["filename","status","additions","deletions","changes"],"properties":{"filename":{"type":"string"},"status":{"type":"string","description":"GitHub's file status: added, modified, removed, renamed…"},"additions":{"type":"integer"},"deletions":{"type":"integer"},"changes":{"type":"integer"},"patch":{"type":"string","description":"The unified diff, when GitHub returns one."}}}},"totals":{"type":"object","required":["files","additions","deletions","changes"],"properties":{"files":{"type":"integer"},"additions":{"type":"integer"},"deletions":{"type":"integer"},"changes":{"type":"integer"}}},"error":{"type":"string","description":"Present only when the file list could not be read."},"error_code":{"type":"string","enum":["CHANGES_NO_INSTALLATION","CHANGES_LIST_FAILED"]}}},"example":{"pr_url":"https://github.com/acme/web/pull/412","pr_number":412,"files":[{"filename":"tests/checkout.spec.ts","status":"modified","additions":6,"deletions":2,"changes":8}],"totals":{"files":1,"additions":6,"deletions":2,"changes":8}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/logs":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Events"],"x-audience":"public","summary":"Read the session's runtime log","description":"The sandbox's log lines for the run's time window. When none are stored, `logs` is the run's status line and `source` is `stored`.","operationId":"getSessionLogs","responses":{"200":{"description":"The log.","content":{"application/json":{"schema":{"type":"object","required":["logs","source","status","truncated"],"properties":{"logs":{"type":"string"},"source":{"type":"string","enum":["loki","stored"]},"status":{"type":"string","description":"The stored run status."},"truncated":{"type":"boolean"}}},"example":{"logs":"2026-10-06T15:02:20Z harness started\n2026-10-06T15:09:01Z harness exited 0\n","source":"loki","status":"completed","truncated":false}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/result":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Results & artifacts"],"x-audience":"public","summary":"Get the session's answer","description":"`result` is the last finished turn's answer; it is null until a turn finishes. Poll this, follow `…/events`, or take the webhook.","operationId":"getSessionResult","responses":{"200":{"description":"The answer beside the run's status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResult"},"example":{"execution_id":"3f9c2a71d04b8e65","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","result":{"text":"Pinned the clock in checkout.spec.ts and opened PR 412.","structured":null,"schema_valid":null},"status":"completed","output":"runtime: guest harness completed","completed_at":"2026-10-06T15:09:03.000Z"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/artifacts":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"}],"get":{"tags":["Results & artifacts"],"x-audience":"public","summary":"List the files a session produced","description":"Files the agent saved as artifacts, in upload order. Download one with `GET …/artifacts/{name}`.","operationId":"listSessionArtifacts","responses":{"200":{"description":"The artifact manifest.","content":{"application/json":{"schema":{"type":"object","required":["execution_id","artifacts"],"properties":{"execution_id":{"type":"string"},"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/ArtifactFile"}}}},"example":{"execution_id":"3f9c2a71d04b8e65","artifacts":[{"name":"coverage-report.html","size":48213,"content_type":"text/html"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/p/{project}/sessions/{session}/artifacts/{name}":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ProjectHandle"},{"$ref":"#/components/parameters/SessionId"},{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"A `name` from the artifact list.","example":"coverage-report.html"}],"get":{"tags":["Results & artifacts"],"x-audience":"public","summary":"Download one artifact","description":"The file's bytes, with the `Content-Type` it was saved with.","operationId":"getSessionArtifact","responses":{"200":{"description":"The file.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/api-keys":{"parameters":[{"$ref":"#/components/parameters/Org"}],"get":{"tags":["API keys"],"x-audience":"public","summary":"List the org's API keys","description":"Every live key, without its secret. Org admins only, signed in; an API key cannot call this.","operationId":"listApiKeys","responses":{"200":{"description":"The keys.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}},"example":{"data":[{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_Q7f2","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":"https://hooks.acme.dev/rush","expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":"dana@acme.dev"},"last_used_at":"2026-10-06T15:20:41.000Z","created_at":"2026-10-06T15:00:00.000Z"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"post":{"tags":["API keys"],"x-audience":"public","summary":"Create an API key","description":"Mints a key that acts as the caller (an org admin) on the session\nroutes. The `secret` is in this response only; it is never stored or\nshown again. Without `expires_at` the key never expires.\n","operationId":"createApiKey","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ApiKeyScope"},"description":"Defaults to both scopes."},"max_concurrent":{"type":"integer","minimum":1,"maximum":100,"default":4,"description":"Runs this key may have in progress at once."},"expires_at":{"type":["string","null"],"format":"date-time","description":"In the future and at most one year away."}}},"example":{"name":"ci-runner","expires_at":"2027-01-01T00:00:00Z"}}}},"responses":{"201":{"description":"The key, with its secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"},"example":{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_Q7f2","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":null,"expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":"dana@acme.dev"},"last_used_at":null,"created_at":"2026-10-06T15:00:00.000Z","secret":"rk_live_Q7f2…"}}}},"400":{"description":"An invalid field (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"expires_at must be an ISO date in the future, at most one year away","code":"VALIDATION_ERROR"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/api-keys/{key}":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ApiKeyId"}],"patch":{"tags":["API keys"],"x-audience":"public","summary":"Set, change or remove the key's webhook","description":"Points the `runFinished` webhook of every run this key starts at a\npublic https URL, or clears it with `null`. The signing secret\n(`webhook_secret`, `whsec_…`) is returned once, when the key first gets\na URL and again on `rotate_secret: true`; changing the URL keeps it.\nOnly the key's creator may call this.\n","operationId":"updateApiKeyWebhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"webhook_url":{"type":["string","null"],"format":"uri","maxLength":2048},"rotate_secret":{"type":"boolean","default":false}}},"examples":{"set":{"value":{"webhook_url":"https://hooks.acme.dev/rush"}},"rotate":{"value":{"rotate_secret":true}},"clear":{"value":{"webhook_url":null}}}}}},"responses":{"200":{"description":"The key; `webhook_secret` only when a secret was minted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"},"example":{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_Q7f2","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":"https://hooks.acme.dev/rush","expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":null},"last_used_at":"2026-10-06T15:20:41.000Z","created_at":"2026-10-06T15:00:00.000Z","webhook_secret":"whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"}}}},"400":{"description":"An unknown field, a URL that is not public https, or `rotate_secret` with no URL (`VALIDATION_ERROR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["API keys"],"x-audience":"public","summary":"Revoke an API key","description":"The next request with the key is refused, and its pending webhook retries are dropped. Any org admin may revoke.","operationId":"revokeApiKey","responses":{"204":{"description":"Revoked."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/api-keys/{key}/rotate":{"parameters":[{"$ref":"#/components/parameters/Org"},{"$ref":"#/components/parameters/ApiKeyId"}],"post":{"tags":["API keys"],"x-audience":"public","summary":"Rotate an API key's secret","description":"A new secret for the same key; the old one stops working at once. The expiry is kept. Only the key's creator may rotate it; an expired key is `404`.","operationId":"rotateApiKey","responses":{"200":{"description":"The key, with its new secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyWithSecret"},"example":{"id":"key_Zq3T9vB1mN4pX8cR2wYe","name":"ci-runner","prefix":"rk_live_M3k8","scopes":["runs:read","runs:write"],"max_concurrent":4,"webhook_url":null,"expires_at":"2027-01-01T00:00:00.000Z","created_by":{"id":"5b8e2c1d-3f4a-4b6c-9d7e-8f9a0b1c2d3e","email":null},"last_used_at":"2026-10-06T15:20:41.000Z","created_at":"2026-10-06T15:00:00.000Z","secret":"rk_live_M3k8…"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/o/{org}/agents/available":{"parameters":[{"$ref":"#/components/parameters/Org"}],"get":{"tags":["Agents & models"],"x-audience":"public","summary":"List the harnesses, models and connectors the org can run","description":"One discovery read. `models` has one row per harness and model: a\nsession's `model` must be an `id` listed for its `agent`, with an\n`effort` from that row. `harnesses` adds each harness's runtime,\nsuggested setups, tools and plugins. `mcp_servers` are the remote MCP\nservers that can be connected; `plugins` the plugin marketplaces.\nOrg members, signed in; an API key cannot call this.\n","operationId":"getAgentsAvailable","parameters":[{"name":"harness","in":"query","schema":{"$ref":"#/components/schemas/Harness"},"description":"Only this harness in `harnesses`."}],"responses":{"200":{"description":"The catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentsAvailable"},"example":{"catalog_revision":"edd837ea88ebb5b4c0c78d66aff6f1fbb94347d75a97a0e70a4b286a665f8b21","checked_at":"2026-10-06T17:24:17.300Z","harnesses":[{"id":"claude","display_name":"Claude Code","runtime":{"latest_verified":{"id":"2.1.291","checked_at":"2026-10-06T17:24:17.300Z","pin_guarantee":true,"image_digest":null,"available":true},"pinned":{"available":true}},"models":[{"id":"claude-opus-5-5","display_name":"Opus 5.5","effort":["low","medium","high","xhigh","max"],"speed":[{"id":"standard","available":true},{"id":"fast","available":true}]}],"suggested_setups":[{"id":"workhorse","label":"Workhorse","defaults":{"model":{"selection":"pinned","id":"claude-opus-5-5"},"effort":"medium","speed":"standard"}}],"native_tools":[{"id":"WebSearch","label":"Web search","available":true}],"plugins":[],"capabilities":{"browser":{"available":true},"computer":{"available":true},"tools_selected":{"available":true},"network_allowlist":{"available":false,"disabled_reason":"Not available yet."},"instructions":{"available":true},"configuration":{"available":true}}}],"models":[{"id":"claude-opus-5-5","display_name":"Opus 5.5","provider":"anthropic","type":"text","harnesses":["claude"],"pricing":{"input_per_million":5,"output_per_million":25},"effort":["low","medium","high","xhigh","max"],"modes":["fast"]},{"id":"gpt-5.5","display_name":"GPT-5.5","provider":"openai","type":"text","harnesses":["codex"],"pricing":{"input_per_million":1.25,"output_per_million":10},"effort":["minimal","low","medium","high"],"modes":[]}],"mcp_servers":[{"name":"Stripe","slug":"stripe","title":"Stripe","description":"Manage payments and billing.","category":"Finance","tags":["payments","finance"],"verified":true,"official":true,"author":"Stripe","remotes":[{"type":"streamable-http","url":"https://mcp.stripe.com/"}],"documentationUrl":"https://docs.stripe.com/mcp","oauth":true}],"mcp_categories":[{"name":"Finance","count":7}],"plugins":{"marketplaces":[{"name":"prix-official","source":"github:phnx-labs/.agents-extras"},{"name":"anthropic-official","source":"github:anthropics/claude-plugins-official"}],"catalog":{"url":"https://example-bucket.r2.cloudflarestorage.com/plugins-catalog.json?X-Amz-Signature=3f1c","expires_at":1791306257}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"webhooks":{"runFinished":{"post":{"tags":["Webhooks"],"x-audience":"public","operationId":"runFinished","summary":"A run started with an API key finished a turn","description":"Sent to the `webhook_url` set on the API key that started the run (PATCH /o/{org}/api-keys/{key}), within about 30 seconds of a turn finishing: one per turn of a resumable run. Signed per Standard Webhooks with the key's `whsec_` secret. Any 2xx within 5 seconds acknowledges it; anything else is retried 2, 4 and 6 minutes after the first attempt with the same `webhook-id`, then dropped. Revoking the key or clearing its webhook drops pending retries.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Stable across retries: webhook:{run_id}:{completed_at ms}."},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds of this attempt."},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"v1,<base64 HMAC-SHA256 of \"{webhook-id}.{webhook-timestamp}.{body}\", keyed by the base64 bytes after whsec_>."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","timestamp","data"],"properties":{"type":{"type":"string","enum":["run.completed","run.failed","run.cancelled"]},"timestamp":{"type":"string","format":"date-time","description":"When the turn finished."},"data":{"type":"object","required":["run_id","project_id","status","result","total_cost_usd","result_url","events_url","artifacts_url"],"properties":{"run_id":{"type":"string"},"project_id":{"type":["string","null"],"format":"uuid"},"status":{"type":"string","description":"completed, needs_review, failed or cancelled."},"result":{"type":["object","null"],"description":"The turn's answer, as GET …/sessions/{session}/result returns it; null when there is none or it is over 16 KiB (read result_url).","properties":{"text":{"type":["string","null"]},"structured":{"description":"The object output_schema asked for, when one was given."},"schema_valid":{"type":["boolean","null"]}}},"total_cost_usd":{"type":["number","null"]},"result_url":{"type":"string","format":"uri"},"events_url":{"type":"string","format":"uri"},"artifacts_url":{"type":"string","format":"uri"}}}}},"example":{"type":"run.completed","timestamp":"2026-10-06T15:09:03.000Z","data":{"run_id":"3f9c2a71d04b8e65","project_id":null,"status":"completed","result":{"text":"Pinned the clock in checkout.spec.ts and opened PR 412.","structured":null,"schema_valid":null},"total_cost_usd":1.84,"result_url":"https://api.prix.dev/o/acme/p/_/sessions/3f9c2a71d04b8e65/result","events_url":"https://api.prix.dev/o/acme/p/_/sessions/3f9c2a71d04b8e65/events","artifacts_url":"https://api.prix.dev/o/acme/p/_/sessions/3f9c2a71d04b8e65/artifacts"}}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An org API key (`rk_live_…`, from POST /o/{org}/api-keys), which acts as the admin who created it, in its own org, on the session routes only; or a signed-in Phoenix ID session, as the console and the `rush` CLI send."}},"parameters":{"Limit":{"name":"limit","in":"query","description":"Max rows to return.","schema":{"type":"integer","minimum":1,"maximum":500,"default":50}},"Cursor":{"name":"cursor","in":"query","description":"Opaque pagination cursor from a previous response's `next_cursor`.","schema":{"type":"string"}},"Since":{"name":"since","in":"query","description":"Lower time bound. Relative (`2h`, `7d`) or ISO 8601.","schema":{"type":"string"}},"Until":{"name":"until","in":"query","description":"Upper time bound. Relative (`2h`, `7d`) or ISO 8601.","schema":{"type":"string"}},"Org":{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The org's slug or id. A caller with no role in the org gets `404`.","example":"acme"},"ProjectHandle":{"name":"project","in":"path","required":true,"schema":{"type":"string"},"description":"A Project's handle (name) or id, resolved inside `{org}` — OR the\nreserved sentinel `_` meaning \"no Project\" (a direct-repo / repo-less\ndispatch on `POST`; \"no Project constraint, resolve by session id\nalone\" everywhere else). A real handle that doesn't match the\nsession's actual Project is `404`.\n"},"SessionId":{"name":"session","in":"path","required":true,"schema":{"type":"string"},"description":"The session's full id (`execution_id`).","example":"3f9c2a71d04b8e65"},"ApiKeyId":{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The key's `id` (`key_…`), not its secret.","example":"key_Zq3T9vB1mN4pX8cR2wYe"}},"responses":{"Unauthorized":{"description":"No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Invalid or expired token","code":"AUTH_FAILED","requestId":"req_8f3a2c"}}}},"NotFound":{"description":"No such resource for the caller, including one that exists in an org the caller cannot see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Execution not found"}}}},"BadRequest":{"description":"Malformed request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"examples":{"CloudRunSession":{"summary":"A finished session","value":{"execution_id":"3f9c2a71d04b8e65","kind":"cloud","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","agent":"claude","status":"completed","persistence_mode":"resumable","machine_state":"paused","sandbox_generation":1,"prompt":"Fix the flaky checkout test and open a PR.","repo_owner":"acme","repo_name":"web","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","summary":"Pinned the clock in checkout.spec.ts and opened PR 412.","error":null,"started_by":{"name":"Dana Lee","avatar_url":null},"input_tokens":182340,"output_tokens":9120,"cache_read_tokens":1204500,"cache_write_tokens":40210,"total_tokens":231670,"reasoning_tokens":0,"total_cost_usd":1.84,"model":"claude-opus-5-5","tool_calls_count":37,"tool_errors_count":2,"turns_count":1,"files_produced":1,"attachments":[],"artifacts":[{"name":"coverage-report.html","size":48213,"content_type":"text/html"}],"artifact_count":1,"harness_version_requested":null,"harness_version_resolved":"2.1.291","profile_id":null,"profile_revision":null,"profile_digest":null,"requested_overrides":null,"agent_profile":null,"effective":null,"snapshot":null,"effective_config":{"harness_version":"2.1.291"},"session_capture":"complete","created_at":"2026-10-06T15:02:11.000Z","updated_at":"2026-10-06T15:09:03.000Z"}},"CloudRunSessionList":{"summary":"One page","value":{"executions":[{"execution_id":"3f9c2a71d04b8e65","kind":"cloud","org_id":"0b6f3c52-8d1e-4a7b-9c55-2f1e8d7a6b90","project_id":"7d2e9a14-5b3c-4f60-8e21-9a0b1c2d3e4f","agent":"claude","status":"completed","persistence_mode":"resumable","machine_state":"paused","sandbox_generation":1,"prompt":"Fix the flaky checkout test and open a PR.","repo_owner":"acme","repo_name":"web","branch":"rush/fix-flaky-checkout","pr_url":"https://github.com/acme/web/pull/412","summary":"Pinned the clock in checkout.spec.ts and opened PR 412.","error":null,"started_by":{"name":"Dana Lee","avatar_url":null},"input_tokens":182340,"output_tokens":9120,"cache_read_tokens":1204500,"cache_write_tokens":40210,"total_tokens":231670,"reasoning_tokens":0,"total_cost_usd":1.84,"model":"claude-opus-5-5","tool_calls_count":37,"tool_errors_count":2,"turns_count":1,"files_produced":1,"attachments":[],"artifacts":[{"name":"coverage-report.html","size":48213,"content_type":"text/html"}],"artifact_count":1,"harness_version_requested":null,"harness_version_resolved":"2.1.291","profile_id":null,"profile_revision":null,"profile_digest":null,"requested_overrides":null,"agent_profile":null,"effective":null,"snapshot":null,"effective_config":{"harness_version":"2.1.291"},"session_capture":"complete","created_at":"2026-10-06T15:02:11.000Z","updated_at":"2026-10-06T15:09:03.000Z"}]}}},"schemas":{"Error":{"type":"object","description":"Every non-2xx body. Two envelopes are live: most routes send `error`\n(a sentence) with an optional `code` or `error_code`; the org-wide\nsession search sends `code` and `message`. Some refusals add fields\n(`candidates`, `fields`, plan usage). Branch on `code` / `error_code`.\n","anyOf":[{"required":["error"]},{"required":["code","message"]}],"properties":{"error":{"type":"string","description":"A sentence for a person."},"code":{"type":"string","description":"Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, PLAN_REQUIRED."},"error_code":{"type":"string","description":"The machine code on routes that name it this way."},"message":{"type":"string"},"requestId":{"type":"string"}},"additionalProperties":true},"Harness":{"type":"string","enum":["claude","codex","opencode"],"description":"Launch-boundary managed harnesses."},"SessionStatus":{"type":"string","enum":["queued","allocating","running","paused","input_required","needs_review","completed","failed","cancelled","expired"],"description":"`paused` is a resumable session parked between turns; `needs_review` finished without the proof it was asked for."},"SessionCreate":{"type":"object","required":["prompt"],"description":"`{project}` in the path, never in the body, picks the repository. With\n`{project}` = `_`, `agent` is required.\n","properties":{"agent":{"type":"string","description":"`claude`, `codex` or `opencode`, optionally pinned to a CLI version: `claude@2.1.291`.","example":"claude"},"prompt":{"type":"string","maxLength":262144,"description":"The task. At most 256 KiB."},"model":{"type":"string","description":"A model `id` that GET /o/{org}/agents/available lists for this harness. Omitted: the harness default."},"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max","auto"],"description":"Reasoning effort; must be one the model's row lists."},"speed":{"type":"string","enum":["standard","fast"],"description":"`fast` where the model row lists it in `modes`. OpenCode has none."},"mode":{"type":"string","enum":["headless","interactive"],"default":"headless"},"persistence":{"type":"string","enum":["resumable","ephemeral"],"default":"resumable","description":"`resumable` parks the sandbox with its disk and memory between turns, free while parked, for 7 idle days; `ephemeral` tears it down when the turn ends."},"account_id":{"type":"string","description":"Run on one of the caller's own Anthropic or OpenAI API-key accounts instead of Rush's models."},"base_branch":{"type":"string","description":"Branch to start from. Not with `on_pr`."},"on_pr":{"type":"integer","minimum":1,"description":"Continue on this open pull request's branch."},"output_schema":{"type":"object","description":"A JSON Schema the final answer must match; it comes back as\n`result.structured` on `/result`, the `done` event and the webhook.\nclaude and codex only (`422 FIELD_UNSUPPORTED_FOR_HARNESS` otherwise).\nThe root is `type: \"object\"`; every object lists all its `properties`\nin `required` (make one optional with `type: [T, \"null\"]`) and sets\n`additionalProperties: false`; `$ref` stays inside the document; at\nmost 10 levels and 64 KiB. Anything else is `400 OUTPUT_SCHEMA_INVALID`.\n"}},"additionalProperties":true},"SessionAnswer":{"type":"object","description":"The agent's answer for the session's last finished turn.","required":["text","structured","schema_valid"],"properties":{"text":{"type":["string","null"],"description":"The final message as the harness reported it (claude's `result`, codex's last message)."},"structured":{"type":["object","null"],"description":"The answer as the object `output_schema` describes; null when no schema was sent or none came back."},"schema_valid":{"type":["boolean","null"],"description":"null when no schema was sent; true when the harness produced a schema-conforming object; false when a schema was sent and it did not."}}},"SessionResult":{"type":"object","required":["execution_id","branch","pr_url","result","status","output","completed_at"],"properties":{"execution_id":{"type":"string"},"status":{"type":"string","description":"The run status as stored (a `SessionStatus`, or `dispatching` / `deferred` before admission)."},"branch":{"type":["string","null"]},"pr_url":{"type":["string","null"]},"output":{"type":["string","null"],"description":"The run's one-line status, e.g. `runtime: guest harness completed`; at most 50,000 characters."},"completed_at":{"type":["string","null"],"format":"date-time"},"result":{"oneOf":[{"$ref":"#/components/schemas/SessionAnswer"},{"type":"null"}],"description":"Null until a turn finishes."}}},"Session":{"type":"object","description":"A session as the org-wide search (`GET /o/{org}/sessions`) returns it:\nbuilt for browsing, with a short id, a title and usage totals. Once you\nhave an id, `GET …/sessions/{session}` returns the fuller\n`CloudRunSession`. `kind` is always `cloud` today.\n","required":["id","short_id","status","created_at"],"properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["cloud","local"],"default":"cloud"},"short_id":{"type":"string","description":"Indexed short handle for prefix resolution."},"title":{"type":["string","null"]},"project":{"type":["string","null"]},"org_id":{"type":["string","null"],"format":"uuid","description":"Owning org; null for older sessions started outside an org."},"project_id":{"type":["string","null"],"format":"uuid","description":"The Project the session ran in; null for a run without one."},"agent":{"type":["string","null"]},"harness":{"$ref":"#/components/schemas/Harness"},"harness_version_requested":{"type":["string","null"]},"harness_version_resolved":{"type":["string","null"]},"model":{"type":["string","null"]},"mode":{"type":["string","null"],"enum":["headless","interactive",null]},"status":{"$ref":"#/components/schemas/SessionStatus"},"prompt":{"type":["string","null"]},"branch":{"type":["string","null"]},"pr_url":{"type":["string","null"]},"error":{"type":["string","null"]},"session_capture":{"type":["string","null"],"enum":["complete","partial","failed",null]},"message_count":{"type":"integer","default":0},"input_tokens":{"type":"integer","default":0},"output_tokens":{"type":"integer","default":0},"cache_read_tokens":{"type":"integer","default":0},"cache_write_tokens":{"type":"integer","default":0},"cost_usd":{"type":"number","default":0},"duration_ms":{"type":["integer","null"]},"tool_call_count":{"type":"integer","default":0},"started_by":{"type":["object","null"],"description":"The person who started the run; null for older sessions with no recorded starter.","properties":{"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]}}},"summary":{"type":["string","null"],"description":"Stored summary or last assistant text line (max 200 chars); null when there is no capture."},"artifacts":{"type":"array","description":"First 6 artifact previews from the stored manifest, in upload order (no timestamps, so no recency implied).","items":{"type":"object","required":["name","size","content_type"],"properties":{"name":{"type":"string"},"size":{"type":"integer"},"content_type":{"type":"string"}}}},"artifact_count":{"type":"integer","default":0},"agent_profile":{"type":["object","null"],"description":"The saved agent profile this run was dispatched from; null otherwise.","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"SessionList":{"type":"object","required":["sessions"],"properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"count":{"type":["integer","null"],"description":"Present (and rows omitted) when the request set `count=true`."},"next_cursor":{"type":["string","null"]}}},"CloudRunSession":{"type":"object","description":"A session as `POST …/sessions`, `GET …/sessions/{session}` and the\nProject list return it. `execution_id` is the session id.\n","required":["execution_id","kind","status","created_at"],"properties":{"execution_id":{"type":"string"},"kind":{"type":"string","enum":["cloud","local"]},"org_id":{"type":["string","null"],"format":"uuid"},"project_id":{"type":["string","null"],"format":"uuid"},"agent":{"type":["string","null"],"description":"The harness."},"status":{"$ref":"#/components/schemas/SessionStatus"},"persistence_mode":{"type":["string","null"],"enum":["ephemeral","resumable",null]},"machine_state":{"type":["string","null"],"description":"The sandbox's own lifecycle (preparing, running, pausing, paused, resuming…), separate from `status`."},"sandbox_generation":{"type":["integer","null"],"description":"Increments on every resume."},"prompt":{"type":["string","null"]},"repo_owner":{"type":["string","null"]},"repo_name":{"type":["string","null"]},"branch":{"type":["string","null"]},"pr_url":{"type":["string","null"]},"summary":{"type":["string","null"]},"error":{"type":["string","null"]},"started_by":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]}}},"input_tokens":{"type":["integer","null"]},"output_tokens":{"type":["integer","null"]},"cache_read_tokens":{"type":["integer","null"]},"cache_write_tokens":{"type":["integer","null"]},"total_tokens":{"type":["integer","null"],"description":"Uncached input plus cache writes plus output; null when the run reported none."},"reasoning_tokens":{"type":["integer","null"]},"total_cost_usd":{"type":["number","null"]},"model":{"type":["string","null"]},"tool_calls_count":{"type":["integer","null"]},"tool_errors_count":{"type":["integer","null"]},"turns_count":{"type":["integer","null"]},"files_produced":{"type":["integer","null"]},"attachments":{"type":"array","description":"Files the caller attached when starting the run.","items":{"type":"object","required":["id","name","mime","size","expired_at"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"mime":{"type":"string"},"size":{"type":"integer"},"expired_at":{"type":["string","null"],"format":"date-time"}}}},"artifacts":{"type":"array","description":"The first 6 artifacts; `artifact_count` has the total.","items":{"$ref":"#/components/schemas/ArtifactFile"}},"artifact_count":{"type":"integer"},"harness_version_requested":{"type":["string","null"]},"harness_version_resolved":{"type":["string","null"]},"profile_id":{"type":["string","null"],"description":"The saved agent the run started from."},"profile_revision":{"type":["integer","null"]},"profile_digest":{"type":["string","null"]},"requested_overrides":{"type":["object","null"],"properties":{"model":{"type":"string"},"effort":{"type":"string"},"speed":{"type":"string"}}},"agent_profile":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"effective":{"type":["object","null"],"description":"What a saved-agent run actually ran with.","properties":{"model":{"type":["string","null"]},"effort":{"type":["string","null"]},"speed":{"type":["string","null"]},"harness_version":{"type":["string","null"]},"catalog_revision":{"type":["string","null"]},"image_digest":{"type":["string","null"]}}},"snapshot":{"type":["object","null"],"description":"The saved-agent configuration the run was pinned to."},"effective_config":{"type":["object","null"],"description":"What the sandbox loaded (harness version, plugins, hooks, commands), as the runtime reported it."},"session_capture":{"type":["string","null"],"enum":["complete","partial","failed",null]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"CloudRunSessionList":{"type":"object","required":["executions"],"properties":{"executions":{"type":"array","items":{"$ref":"#/components/schemas/CloudRunSession"}}}},"AmbiguousSelector":{"type":"object","required":["code","message","candidates"],"description":"Returned as the 409 body when a selector matched more than one session.","properties":{"code":{"type":"string","enum":["AMBIGUOUS_SELECTOR"]},"message":{"type":"string"},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}},"SessionEvent":{"type":"object","description":"One normalized transcript event. Which optional fields appear depends on `type`.","required":["type","agent","timestamp"],"properties":{"type":{"type":"string","enum":["message","tool_use","tool_result","thinking","error","init","result","usage","attachment","hook"]},"agent":{"type":"string","enum":["claude","codex","rush","opencode","opaque"]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string"},"tool":{"type":"string"},"callId":{"type":"string","description":"Links a tool_use to its tool_result."},"args":{"type":"object"},"path":{"type":"string"},"command":{"type":"string"},"success":{"type":"boolean"},"output":{"type":"string"},"model":{"type":"string"},"inputTokens":{"type":"integer"},"outputTokens":{"type":"integer"},"cacheReadTokens":{"type":"integer"},"cacheCreationTokens":{"type":"integer"},"mediaType":{"type":"string"},"sizeBytes":{"type":"integer"}}},"ToolCall":{"type":"object","description":"One tool call, modeled on agents-cli tool_calls + tool_call_programs.","required":["call_key","tool"],"properties":{"call_key":{"type":"string"},"ordinal":{"type":"integer"},"tool":{"type":"string"},"program":{"type":["string","null"],"description":"The first program a shell call ran."},"programs":{"type":"array","items":{"type":"string"},"description":"Every program a shell call ran."},"input":{"type":["string","null"]},"outcome":{"type":["string","null"],"enum":["success","error","cancelled",null]},"exit_code":{"type":["integer","null"]},"error_code":{"type":["string","null"]},"end_timestamp":{"type":["string","null"],"format":"date-time"}}},"ArtifactFile":{"type":"object","description":"One file a session saved as an artifact.","required":["name","size","content_type"],"properties":{"name":{"type":"string"},"size":{"type":"integer","description":"Bytes."},"content_type":{"type":"string"}}},"ApiKeyScope":{"type":"string","enum":["runs:read","runs:write"],"description":"`runs:read` reads sessions; `runs:write` starts, steers and messages them."},"ApiKey":{"type":"object","required":["id","name","prefix","scopes","max_concurrent","webhook_url","expires_at","created_by","last_used_at","created_at"],"properties":{"id":{"type":"string","description":"`key_…`; use it in the key routes."},"name":{"type":"string"},"prefix":{"type":"string","description":"The secret's first characters, to tell keys apart."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScope"}},"max_concurrent":{"type":"integer"},"webhook_url":{"type":["string","null"]},"expires_at":{"type":["string","null"],"format":"date-time"},"created_by":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"email":{"type":["string","null"]}}},"last_used_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"secret":{"type":"string","pattern":"^rk_live_","description":"The key's secret. Only in the create and rotate responses; never shown again."},"webhook_secret":{"type":"string","pattern":"^whsec_","description":"The webhook signing secret. Only in the update response that minted it."}}},"ApiKeyWithSecret":{"description":"An `ApiKey` with its `secret`, as create and rotate return it. The secret is never shown again.","allOf":[{"$ref":"#/components/schemas/ApiKey"},{"required":["secret"]}]},"CatalogSupport":{"type":"object","required":["available"],"properties":{"available":{"type":"boolean"},"disabled_reason":{"type":"string"}}},"AgentsAvailable":{"type":"object","required":["catalog_revision","checked_at","harnesses","models","mcp_servers","mcp_categories","plugins"],"properties":{"catalog_revision":{"type":"string","description":"Changes whenever anything below changes."},"checked_at":{"type":"string","format":"date-time"},"harnesses":{"type":"array","items":{"type":"object","required":["id","display_name","runtime","models","suggested_setups","native_tools","plugins","capabilities"],"properties":{"id":{"$ref":"#/components/schemas/Harness"},"display_name":{"type":"string"},"runtime":{"type":"object","required":["latest_verified","pinned"],"properties":{"latest_verified":{"type":"object","required":["available","id","checked_at","pin_guarantee","image_digest"],"properties":{"available":{"type":"boolean"},"disabled_reason":{"type":"string"},"id":{"type":["string","null"],"description":"The CLI version sessions run today."},"checked_at":{"type":"string","format":"date-time"},"pin_guarantee":{"type":"boolean"},"image_digest":{"type":["string","null"]}}},"pinned":{"$ref":"#/components/schemas/CatalogSupport"}}},"models":{"type":"array","items":{"type":"object","required":["id","display_name","effort","speed"],"properties":{"id":{"type":"string"},"display_name":{"type":"string"},"effort":{"type":"array","items":{"type":"string"}},"speed":{"type":"array","items":{"type":"object","required":["id","available"],"properties":{"id":{"type":"string","enum":["standard","fast"]},"available":{"type":"boolean"},"disabled_reason":{"type":"string"}}}}}}},"suggested_setups":{"type":"array","items":{"type":"object","required":["id","label","defaults"],"properties":{"id":{"type":"string","enum":["workhorse","deep_work","quick_tasks"]},"label":{"type":"string"},"defaults":{"type":"object","required":["model","effort","speed"],"properties":{"model":{"type":"object","required":["selection","id"],"properties":{"selection":{"type":"string","enum":["pinned"]},"id":{"type":"string"}}},"effort":{"type":["string","null"]},"speed":{"type":"string","enum":["standard","fast"]}}}}}},"native_tools":{"type":"array","items":{"type":"object","required":["id","label","available"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"available":{"type":"boolean"},"disabled_reason":{"type":"string"}}}},"plugins":{"type":"array","items":{"type":"object","required":["catalog_id","name","description","version","digest","harnesses","requires_browser","source"],"properties":{"catalog_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"digest":{"type":"string"},"harnesses":{"type":"array","items":{"$ref":"#/components/schemas/Harness"}},"requires_browser":{"type":"boolean"},"source":{"type":"string"}}}},"capabilities":{"type":"object","required":["browser","computer","tools_selected","network_allowlist","instructions","configuration"],"properties":{"browser":{"$ref":"#/components/schemas/CatalogSupport"},"computer":{"$ref":"#/components/schemas/CatalogSupport"},"tools_selected":{"$ref":"#/components/schemas/CatalogSupport"},"network_allowlist":{"$ref":"#/components/schemas/CatalogSupport"},"instructions":{"$ref":"#/components/schemas/CatalogSupport"},"configuration":{"$ref":"#/components/schemas/CatalogSupport"}}}}}},"models":{"type":"array","description":"One row per harness and model. A session's `model` must be an `id` listed for its harness.","items":{"type":"object","required":["id","provider","type","pricing","harnesses","effort","modes"],"properties":{"id":{"type":"string","description":"What the harness CLI takes after `--model`: bare for claude and codex, `provider/model` for opencode."},"display_name":{"type":"string"},"provider":{"type":"string"},"type":{"type":"string","enum":["text"]},"pricing":{"type":"object","properties":{"input_per_million":{"type":"number","description":"USD per million input tokens."},"output_per_million":{"type":"number"}}},"harnesses":{"type":"array","items":{"$ref":"#/components/schemas/Harness"}},"effort":{"type":"array","items":{"type":"string"},"description":"Effort levels the model takes; empty means none."},"modes":{"type":"array","items":{"type":"string","enum":["fast"]},"description":"`fast` when the model has a fast mode."}}}},"mcp_servers":{"type":"array","description":"Remote MCP servers that can be connected (OAuth).","items":{"type":"object","required":["name","slug","description","category","tags","verified","official","author"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"verified":{"type":"boolean"},"official":{"type":"boolean"},"author":{"type":"string"},"remotes":{"type":"array","items":{"type":"object","required":["type","url"],"properties":{"type":{"type":"string"},"url":{"type":"string","format":"uri"}}}},"repositoryUrl":{"type":"string"},"documentationUrl":{"type":"string"},"oauth":{"type":"boolean"},"version":{"type":"string"},"downloads":{"type":"integer"},"packages":{"type":"array","items":{}}}}},"mcp_categories":{"type":"array","items":{"type":"object","required":["name","count"],"properties":{"name":{"type":"string"},"count":{"type":"integer"}}}},"plugins":{"type":"object","required":["marketplaces","catalog"],"properties":{"marketplaces":{"type":"array","items":{"type":"object","required":["name","source"],"properties":{"name":{"type":"string"},"source":{"type":"string","description":"e.g. `github:owner/repo`."}}}},"catalog":{"type":"object","required":["url","expires_at"],"properties":{"url":{"type":"string","format":"uri","description":"Short-lived signed URL of the plugin catalog JSON."},"expires_at":{"type":"integer","description":"Unix seconds."}}}}}}}}}}