# Start a session (console, by Project)

`POST /o/{org}/p/{project}/sessions`

The console's form of `POST /o/{org}/sessions`, with the Project in the path
(`_` for none). A signed-in caller reads the console's own session shape.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `project` | path | string | yes | A Project's handle (name) or id, resolved inside `{org}` — OR the reserved sentinel `_` meaning "no Project" (a direct-repo / repo-less dispatch on `POST`; "no Project constraint, resolve by session id alone" everywhere else). A real handle that doesn't match the session's actual Project is `404`.  |
| `idempotency-key` | header | string | no | Send `request_id` in the body instead. Read the same way until it is removed; a `request_id` in the body wins.  |

## Request body

- `agent` (string, optional): What runs: a harness (`claude`, `codex` or `opencode`), or a saved agent's id or exact name (`GET /o/{org}/agents`; a harness name keeps its meaning, and a name two agents share is `422 INVALID_BODY`), which brings its harness, model, effort, instructions, skills and connections; one whose saved setup the catalog no longer supports (such as skills with a tool selection that leaves out `Skill`) is `422 UNSUPPORTED_PROFILE`, with `fields` naming the choice, until it is edited (one added from Community, until its maker lists a new revision). Required on `POST /o/{org}/sessions`; on a Project's route the Project's default harness runs when it is left out.
- `input` (string | array of object | object, required): The task, as a string or as content blocks. Text blocks are joined, with a blank line between them, into the prompt (at most 256 KiB, at least one text block). Every file block is stored before the run starts and downloaded into the sandbox at `/workspace/.rush/attachments/`, where the prompt names it.
- `model` (string, optional): A model `id` that GET /o/{org}/agents/available lists for this harness. Omitted: the harness default.
- `effort` (string, optional, one of `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`, `auto`): Reasoning effort; must be one the model's row lists.
- `speed` (string, optional, one of `standard`, `fast`): How fast the model runs. A run on Rush's models (every API key's, and a person's on the model trial) runs at `standard` only; `fast` is `422 MODEL_UNSUPPORTED` (`400 VALIDATION_ERROR` on `opencode`, `422 SPEED_NOT_QUALIFIED` on a saved agent). Omitted: standard.
- `account_id` (string, optional): Refused `422 ACCOUNT_UNSUPPORTED` with an API key: a developer run always uses Rush's models. Only a person's own run, started in the console, may name one of their connected accounts.
- `strategy` (string, optional, one of `platform`): Rush's models, covered by the account's one-time $1 and then paid from the caller's prepaid credits. Every run started with an API key or an MCP client already uses them, so this changes nothing there; a person's own run that sends it is refused `422 ACCOUNT_UNSUPPORTED`, except on the Free plan past the $1 with credits bought, where their run moves onto credits with or without it.
- `request_id` (string, optional): A UUID you make once for each run you mean to start. A retry with the same `request_id` and body returns the run it first started, until that run fails or is cancelled; the same `request_id` with another body or Project is `409 IDEMPOTENCY_CONFLICT`. Not a UUID is `400 VALIDATION_ERROR`. Optional: without one, every request starts a run.
- `skills` (array of string | object | object, optional): Skills the agent loads for this run, each by public URL, as a string or `{url}`: a GitHub `tree` URL to a directory holding `SKILL.md`, a URL to a `SKILL.md` file (`github.com/…/blob/…`, `raw.githubusercontent.com/…` or any https host), or a `.zip` URL. Fetched when the run is created; a GitHub source is pinned to the commit its branch or tag points at, and the pin is kept with the run. All of a run's skills pack to at most 32 MB unpacked, one file at most 10 MB. An unreachable URL is `422 SKILL_FETCH_FAILED`; no `SKILL.md`, a bad name or too large is `422 SKILL_INVALID`.
  - `url` (string, required)
- `connections` (array of string | object, optional): What this run connects to, each entry in one of three forms: - **An id** of one of the caller's own connections (`GET /me/connections`): an MCP server (connected with a token, by OAuth, or with no auth), a Google or Microsoft product (Gmail, Outlook, OneDrive, ...) of one account, or a GitLab account. Secrets are never named: a session gets every secret of its Project (`/o/{org}/secrets`). - **A name** of one of them, the `name` `GET /me/connections` lists: the name the caller gave an MCP server (`"deepwiki"`, `"EXA_API_KEY"`), or the provider of an account or a built-in connector, which `GET /me/connections` lists as `{type: "app", name: "linear"}` (`"linear"`, `"gmail"`). Only the caller's own rows match, and only user-level ones or ones in this run's Project. A name that matches two of them is `422 CONNECTION_AMBIGUOUS`, whose message lists their ids; send one id instead. - **An inline MCP server** `{url, name?, auth?}`, used by this run and its follow-ups only and never added to `/me/connections`. `url` is a streamable HTTP endpoint on https whose host resolves to public addresses only (else `422 MCP_SERVER_URL_INVALID`). `auth` is the shape `POST /me/connections` takes: `{mode: "bearer", token}` sends the token as `Authorization: Bearer`; `{mode: "none"}` or no `auth` sends none. A `token` beside `url` is `400 FIELD_REMOVED`. The token is stored encrypted on the run and never returned. `name` defaults to a slug of the host (`mcp-deepwiki-com`), and may not be a built-in connection's or share a name with another entry (`422 CONNECTION_AMBIGUOUS` when it matches a named server). Ids and names fit Anthropic's stored-credential model (a vault id per run); the inline form fits OpenAI's inline `authorization` and Cursor's `mcpServers` headers. An id or name that is unknown, still connecting, or waiting on a reconnect is `422 CONNECTION_NOT_READY`. Follow-ups keep all three.
  - `url` (string, required)
  - `name` (string, optional)
  - `auth` (object | object, optional)
- `devices` (array of string, optional): Your own linked computers this run may drive, by `name` from `GET /me/devices`. The agent reaches each one's signed-in browser with `browser start --device NAME`; every step runs on that computer only after you approve the run there, in the Rush menu-bar app. A device that is not yours is `404 NOT_FOUND`; one whose app is not connected is `409 DEVICE_OFFLINE`. Follow-ups keep them. An API key names its creator's devices.
- `resources` (array of object, optional): What Rush puts in front of the agent before it starts, each by URL, with `connection` naming the account that reaches it when more than one could: `https://github.com/<owner>/<repo>` clones the repository at its default branch, `…/tree/<branch>` at that branch, and `…/pull/<n>` on that open pull request's branch; at most one repository per run, reached through a GitHub App installation of the caller (`connection` is an installation id from `GET /o/{org}/github`). `https://gitlab.com/<group>/<project>` (`…/-/tree/<branch>` at a branch) clones a gitlab.com project with the caller's own GitLab sign-in (`connection` is its id). On a Project run it may only name the Project's repository; a Project whose repository is on gitlab.com clones it on every run with the starter's own GitLab sign-in, refused like a gitlab.com resource when they have none (`422 CONNECTION_NOT_READY`). `https://linear.app/<workspace>/issue/<ID>` puts the issue in the prompt, read through the caller's Linear connection. Any other URL is `422 RESOURCE_UNSUPPORTED`; a repository no installation covers, or an issue with no Linear connection, is `422 RESOURCE_NOT_ACCESSIBLE`.
  - `url` (string, required)
  - `connection` (string, optional)

## A run with no repository

```bash
curl -X POST "https://api.phoenix.so/o/$RUSH_ORG/p/_/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."
  }'
```

```typescript
const org = process.env.RUSH_ORG;

const res = await fetch(`https://api.phoenix.so/o/${org}/p/_/sessions`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RUSH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    agent: "claude",
    input: "Write a Python function that parses ISO 8601 durations like P1DT2H30M, with tests. Run the tests and report the result.",
  }),
});

console.log(res.status, await res.text());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]

res = requests.post(
    f"https://api.phoenix.so/o/{org}/p/_/sessions",
    headers={"Authorization": f"Bearer {os.environ['RUSH_API_KEY']}"},
    json={
        "agent": "claude",
        "input": "Write a Python function that parses ISO 8601 durations like P1DT2H30M, with tests. Run the tests and report the result.",
    },
)

print(res.status_code, res.text)
```

## A run with an image, a PDF and an uploaded file

```bash
curl -X POST "https://api.phoenix.so/o/$RUSH_ORG/p/_/sessions" \
  -H "Authorization: Bearer $RUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude",
    "input": [
      {
        "type": "text",
        "text": "Compare the logo with the brand guide and the attached spreadsheet."
      },
      {
        "type": "image",
        "source": {
          "type": "url",
          "url": "https://example.com/logo.png"
        }
      },
      {
        "type": "document",
        "name": "brand-guide.pdf",
        "source": {
          "type": "base64",
          "media_type": "application/pdf",
          "data": "JVBERi0xLjcK…"
        }
      },
      {
        "type": "file",
        "source": {
          "type": "file",
          "file_id": "6f1c0d2e-8a8e-4c55-9d2b-0f6f3f0a1b2c"
        }
      }
    ]
  }'
```

```typescript
const org = process.env.RUSH_ORG;

const res = await fetch(`https://api.phoenix.so/o/${org}/p/_/sessions`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RUSH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    agent: "claude",
    input: [
      {
        type: "text",
        text: "Compare the logo with the brand guide and the attached spreadsheet.",
      },
      {
        type: "image",
        source: {
          type: "url",
          url: "https://example.com/logo.png",
        },
      },
      {
        type: "document",
        name: "brand-guide.pdf",
        source: {
          type: "base64",
          media_type: "application/pdf",
          data: "JVBERi0xLjcK…",
        },
      },
      {
        type: "file",
        source: {
          type: "file",
          file_id: "6f1c0d2e-8a8e-4c55-9d2b-0f6f3f0a1b2c",
        },
      },
    ],
  }),
});

console.log(res.status, await res.text());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]

res = requests.post(
    f"https://api.phoenix.so/o/{org}/p/_/sessions",
    headers={"Authorization": f"Bearer {os.environ['RUSH_API_KEY']}"},
    json={
        "agent": "claude",
        "input": [
            {
                "type": "text",
                "text": "Compare the logo with the brand guide and the attached spreadsheet.",
            },
            {
                "type": "image",
                "source": {
                    "type": "url",
                    "url": "https://example.com/logo.png",
                },
            },
            {
                "type": "document",
                "name": "brand-guide.pdf",
                "source": {
                    "type": "base64",
                    "media_type": "application/pdf",
                    "data": "JVBERi0xLjcK…",
                },
            },
            {
                "type": "file",
                "source": {
                    "type": "file",
                    "file_id": "6f1c0d2e-8a8e-4c55-9d2b-0f6f3f0a1b2c",
                },
            },
        ],
    },
)

print(res.status_code, res.text)
```

## A run with a skill, two connections and a repository branch

```bash
curl -X POST "https://api.phoenix.so/o/$RUSH_ORG/p/_/sessions" \
  -H "Authorization: Bearer $RUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "claude",
    "input": "Add a dark mode toggle to the settings page.",
    "skills": [
      "https://github.com/anthropics/skills/tree/main/skills/frontend-design"
    ],
    "connections": [
      "6f1c2a9e-3b7d-4e0a-9c55-2d8e1f4a7b30",
      {
        "url": "https://mcp.exa.ai/mcp",
        "auth": {
          "mode": "bearer",
          "token": "exa-key"
        }
      }
    ],
    "resources": [
      {
        "url": "https://github.com/acme/web/tree/main"
      },
      {
        "url": "https://linear.app/acme/issue/ENG-42"
      }
    ]
  }'
```

```typescript
const org = process.env.RUSH_ORG;

const res = await fetch(`https://api.phoenix.so/o/${org}/p/_/sessions`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RUSH_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    agent: "claude",
    input: "Add a dark mode toggle to the settings page.",
    skills: [
      "https://github.com/anthropics/skills/tree/main/skills/frontend-design",
    ],
    connections: [
      "6f1c2a9e-3b7d-4e0a-9c55-2d8e1f4a7b30",
      {
        url: "https://mcp.exa.ai/mcp",
        auth: {
          mode: "bearer",
          token: "exa-key",
        },
      },
    ],
    resources: [
      {
        url: "https://github.com/acme/web/tree/main",
      },
      {
        url: "https://linear.app/acme/issue/ENG-42",
      },
    ],
  }),
});

console.log(res.status, await res.text());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]

res = requests.post(
    f"https://api.phoenix.so/o/{org}/p/_/sessions",
    headers={"Authorization": f"Bearer {os.environ['RUSH_API_KEY']}"},
    json={
        "agent": "claude",
        "input": "Add a dark mode toggle to the settings page.",
        "skills": [
            "https://github.com/anthropics/skills/tree/main/skills/frontend-design",
        ],
        "connections": [
            "6f1c2a9e-3b7d-4e0a-9c55-2d8e1f4a7b30",
            {
                "url": "https://mcp.exa.ai/mcp",
                "auth": {
                    "mode": "bearer",
                    "token": "exa-key",
                },
            },
        ],
        "resources": [
            {
                "url": "https://github.com/acme/web/tree/main",
            },
            {
                "url": "https://linear.app/acme/issue/ENG-42",
            },
        ],
    },
)

print(res.status_code, res.text)
```

## Responses

### 202

The console's answer.

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 404

No such resource for the caller, including one in an org the caller is not in or a Project that is private to someone else.

### 429

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.

## Example response (202)

```http
HTTP 202 The console's answer.
```
