Sessions

Start a session

Starts one agent run in a fresh sandbox and returns it at once with 202; follow it with GET …/events or the key's webhook. It runs in the repository a resources URL names, or in none.

Started with an API key, the run uses the key creator's own accounts, as their console run would: a subscription first, then an API key, or the one account_id names. strategy: platform runs it on Rush's models instead, metered on the creator's plan. A key may have max_concurrent runs in progress (default 4); one more is 429 RATE_LIMITED. When agent is a saved agent's id the run uses that saved agent, and gets exactly the connections it names plus those the run names in connections. A key run's repository is reached through its creator's GitHub App installations, and a Linear issue through its creator's Linear connection.

post/o/{org}/sessions

Request

  • Base URL: https://api.prix.dev
  • URL: https://api.prix.dev/o/{org}/sessions
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

A retried create with the same key and body returns the run the key first started, until that run fails or is cancelled. The same key with another body is 409 IDEMPOTENCY_CONFLICT. Keys are per caller and org.

Request body

agentstring

What runs: a harness (claude, codex or opencode), or a saved agent's id (GET /o/{org}/agents), which brings its harness, model, effort, instructions, skills and connections.

modelstring

A model id that GET /o/{org}/agents/available lists for this harness. Omitted: the harness default.

effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto'

Reasoning effort; must be one the model's row lists.

account_idstring

Run on this one of the caller's own accounts (a Claude or ChatGPT subscription, or an Anthropic or OpenAI API key). Omitted: their subscriptions first, then their API key.

strategy'platform'

Run on Rush's models, metered on the caller's plan, instead of their own accounts.

Example request

{
  "agent": "claude"
}

Response

The session as GET reads it, in its status at admission (queued, allocating or running).

execution_idstring required

The session id.

org_idstring required

The org as the request's path named it.

project_idstring uuid

The Project the console ran the session in.

status'queued' | 'allocating' | 'running' | 'paused' | 'input_required' | 'needs_review' | 'completed' | 'failed' | 'cancelling' | 'cancelled' | 'expired' required

paused is a resumable session parked between turns; needs_review finished without the proof it was asked for; cancelling appears only in the 202 answer to a cancel whose sandbox is still being released; GET reads cancelled once it is.

harnessstring

claude, codex or opencode.

agent_idstring uuid

The saved agent the session was started from, if any.

modelstring
effortstring
resultstring

The agent's final answer for the last finished turn, in full.

repo_ownerstring
repo_namestring
branchstring
pr_urlstring
input_tokensinteger
output_tokensinteger
cache_read_tokensinteger
cache_write_tokensinteger
total_tokensinteger

Uncached input plus cache writes plus output.

reasoning_tokensinteger
total_cost_usdnumber
tool_calls_countinteger
turns_countinteger
created_atstring date-time
completed_atstring date-time

Changes

No recorded changes to this operation across all 3 revisions of this API.