Rush API
API quickstart
Start an agent in its own cloud computer from your server, follow it live, steer it, and read what it did. Claude Code, Codex and OpenCode run behind one HTTP API at api.prix.dev.
https://api.prix.devView .mdQuickstart
Get a key
An org admin creates a key in the console under Settings → API keys, or with the request beside this step from a signed-in session (rush http sends one for you). The rk_live_… secret is shown once; store it on your server as RUSH_API_KEY.
A key acts as the admin who created it, in its own org, on the session routes. Its runs use that admin's own Claude or Codex subscription or API key; with none connected, the first $1 of models is on us. Set expires_at up to a year out, or leave it out for a key that never expires.
curl -X POST "https://api.prix.dev/o/$RUSH_ORG/api-keys" \
-H "Authorization: Bearer $RUSH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "ci-runner",
"expires_at": "2027-01-01T00:00:00Z"
}'
Start a session
A session is one agent run. POST it with a harness and an input; the response is the session, already queued or running.
p/_ runs without a repository. Use a Project's handle instead to run in its repository with its connectors. A run started with a key is resumable: the sandbox parks with its disk and memory when a turn ends, costs nothing while parked, and a follow-up wakes it where it left off.
curl -X POST "https://api.prix.dev/o/$RUSH_ORG/sessions" \
-H "Authorization: Bearer $RUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"harness": "claude",
"input": "Summarize the open issues labelled bug in three bullet points."
}'
Stream its events
Hold the event stream to watch the agent work. Each frame is an event: line and a JSON data: line. The stream closes after done, whose data carries the turn's status and answer. Reconnect with Last-Event-ID to resume where you left off.
curl -N "https://api.prix.dev/o/$RUSH_ORG/sessions/$SESSION_ID/events" \
-H "Authorization: Bearer $RUSH_API_KEY" \
-H "Accept: text/event-stream"
Send a follow-up
A follow-up continues the same session and wakes a parked sandbox. Send it once the turn has ended: while a turn is still running it is refused with 409 TURN_ACTIVE, so wait for the session's status to leave running.
curl -X POST "https://api.prix.dev/o/$RUSH_ORG/sessions/$SESSION_ID/messages" \
-H "Authorization: Bearer $RUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Also add a regression test for the timezone case."
}'
Read the result
The session carries the agent's last answer in result, beside its status and the branch and pull request when it opened one.
curl "https://api.prix.dev/o/$RUSH_ORG/sessions/$SESSION_ID" \
-H "Authorization: Bearer $RUSH_API_KEY"
Get a webhook when a turn ends
Instead of holding the stream, give the key a public https endpoint. The response carries the whsec_… signing secret once. Every run the key starts then posts run.completed, run.failed or run.cancelled to it within about 30 seconds of a turn ending, signed per Standard Webhooks.
curl -X PATCH "https://api.prix.dev/o/$RUSH_ORG/api-keys/$KEY_ID" \
-H "Authorization: Bearer $RUSH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"webhook_url": "https://hooks.acme.dev/rush"
}'
Session lifecycle
A session's status moves left to right. The stream's status events and GET on the session report it; a turn's end also reaches your webhook.
running.Authentication
Send Authorization: Bearer <token> on every request. The session routes take an org API key or a signed-in session ($RUSH_API_KEY in the samples); every other route takes a signed-in session token (an API key cannot call this route) ($RUSH_TOKEN, as rush http sends it). A missing, revoked or expired token is 401. Another org's resource answers 404, the same as one that does not exist.
| Scheme | What it is |
|---|---|
bearerAuth | An org API key ( |
Errors
Every error is JSON with a stable code and a readable message. Every code, its status and the operations that send it.
Limits and concurrency
A key runs at most max_concurrent sessions at once (4 unless you set it when creating the key, up to 100). Starting one more answers 429; wait for a run to end or cancel one.
A running session queues at most 20 follow-ups; one more answers 429 with QUEUE_FULL.
Model usage past what the plan includes continues at the metered rate up to the spend limit an admin sets in Billing; without one it stops with 402.
Pagination
List operations return at most limit rows. When there are more, the response carries next_cursor; pass it back as cursor for the next page, until next_cursor is null. List sessions, Follow a session live, List your saved agents, newest first. page this way.
Max rows to return.
50min 1max 500Opaque pagination cursor from a previous response's next_cursor.
API reference
Start, list, read and steer sessions. A session is one agent run in its own sandbox.
6 operations
Follow a session live over server-sent events, or read its log.
1 operation
Read a session's transcript and tool calls, and send it follow-ups.
2 operations
The answer, changed files, captured transcript and files a session produced.
3 operations
Values a session uses without them appearing in a response. Every secret belongs to one Project and reaches every session in it.
4 operations
Org API keys for server-to-server calls, and the webhook each key delivers to.
5 operations
The harnesses, models, MCP servers and plugin marketplaces an org can run.
1 operation
Requests Rush sends to your server.
1 operation
Projects tie a repository to its runs and connectors.
2 operations
The GitHub App installations and repositories runs can use.
1 operation
Reusable agent setups (harness, model, tools and connections), revisioned.
5 operations
Files uploaded to attach to a run.
2 operations