Rush API

API quickstart

Run your first agent in about five minutes: one request starts it in its own cloud sandbox, you watch it work, and you read its answer. Claude Code, Codex and OpenCode run behind one HTTP API at api.phoenix.so.

Base URLhttps://api.phoenix.soView .md

You need a Rush account and an API key. Signing up gives you your own org, and any member of an org creates a key on the console's Developers page, where it is shown once. The example request on that page already names your org in its path, /o/<your-org>/sessions. Runs use Rush's models: your account's one-time $1 free credit pays first, then prepaid credits you buy in the console's Billing.

Working in Claude Code, Codex or Cursor? Hand the task to Rush from there instead: add the MCP server with claude mcp add --transport http rush https://api.phoenix.so/mcp --header "Authorization: Bearer $RUSH_API_KEY", or tell the agent to read getrush.ai/SKILL.md and follow it.

Run your first agent

01

Set your key

Put the key and your org (the <your-org> in the Developers page's example path) in your shell. Every sample on these pages reads them from there.

Shell
export RUSH_API_KEY=rk_live_...
export RUSH_ORG=your-org
02

Start a session

Send the task with an agent: claude, codex or opencode. Rush answers 202 at once with the session, before its sandbox is ready. Keep its execution_id (export SESSION_ID=<execution_id>); every other call names it. This task needs no repository.

Start a session

curl -X POST "https://api.phoenix.so/o/$RUSH_ORG/sessions" \
  -H "Authorization: Bearer $RUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude",
    "input": "Write a Python function that parses ISO 8601 durations like P1DT2H30M, with tests. Run the tests and report the result."
  }'
Nothing is sent: the button shows the 202 Accepted this request returns.
03

Watch it work

Hold the event stream to watch the agent think, run its tools and finish, in its own sandbox. The stream closes after done. If your connection drops, reconnect with Last-Event-ID and it picks up where it left off.

Follow a session live

curl -N "https://api.phoenix.so/o/$RUSH_ORG/sessions/$SESSION_ID/events" \
  -H "Authorization: Bearer $RUSH_API_KEY" \
  -H "Accept: text/event-stream"
Nothing is sent: the button shows the 200 OK this request returns.
04

Read the answer

The session carries the agent's answer in result. When the task touches a repository, it also carries the branch and the pull request it opened in pr_url.

Get one session

curl "https://api.phoenix.so/o/$RUSH_ORG/sessions/$SESSION_ID" \
  -H "Authorization: Bearer $RUSH_API_KEY"
Nothing is sent: the button shows the 200 OK this request returns.
What a real run of this task returned (shortened)
{
  "status": "completed",
  "result": "I wrote `parse_duration` and its tests, and all 4 tests pass: `python3 -m unittest -v test_iso_duration` printed \"Ran 4 tests ... OK\"."
}

You ran an agent in the cloud

It wrote code, ran the tests and told you the result, in a sandbox of its own. Here is what the session went through:

  • queued, then allocating: Rush gave the run its own sandbox, a microVM no other run shares.
  • running: the agent wrote the code, ran the tests and read the output, each step an event on the stream.
  • completed: the turn ended with its answer in result and every step in the session's record.
  • Then the sandbox parked with its disk and memory. It costs nothing parked, and a follow-up wakes it where it left off.

Next

05

Send a follow-up

Continue the same session in the same sandbox, with everything the agent did still on its disk. Sent while a turn is running, it waits in line and runs next; the answer names its turn to wait on.

Send a follow-up

curl -X POST "https://api.phoenix.so/o/$RUSH_ORG/sessions/$SESSION_ID/messages" \
  -H "Authorization: Bearer $RUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Add support for week durations like P2W and rerun the tests."
  }'
Nothing is sent: the button shows the 202 Accepted this request returns.
06

Get a webhook when a turn ends

Give the key a public https endpoint on the console's Developers page, and every run it starts posts run.completed, run.failed or run.cancelled there, signed per Standard Webhooks. No stream to hold, no polling. The request beside this step is the call that page makes with an admin's session; an API key cannot set its own webhook.

Set, change or remove the key's webhook

curl -X PATCH "https://api.phoenix.so/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"
  }'
Nothing is sent: the button shows the 200 OK this request returns.