Developers

Start a session.

Point a session at a repository or a pull request, give it a prompt and images, and choose its model.

Start one

Name the repository by its address, or by its id from GET /projects. The call answers 202 at once with the session, "status": "preparing"; its box is set up after, and its prompt is sent once it's ready.

Terminal
curl -X POST -H "Authorization: Bearer $OUTRUNNER_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: deploy-4812" \
  "$OUTRUNNER/api/v1/workspaces" \
  -d '{
    "repo_url": "https://github.com/acme/web",
    "prompt": "Make the header sticky on mobile, matching this mock",
    "images": [{ "url": "https://example.com/mock.png" }],
    "model": "sonnet",
    "auto_create_pr": true
  }'

What it takes

Only a repository and a prompt are needed. Everything else has a default: your own, or your org's.

Field
repo_urlThe repository's address: https://github.com/acme/web, acme/web, an SSH remote, or a GitLab.com project
project_id, environment_idOr the repository's id, or a project's
pr_urlOr a pull request to work on: the checkout starts at its head branch
promptWhat to do
imagesImages it sees with the prompt: { "data": "<base64>", "mime_type": "image/png" } or { "url": "https://…" }
attachment_idsFiles uploaded first with POST /attachments
model, provider, effortA model from GET /models, and how hard it thinks
agentclaude (Claude Code) or codex
nameIts title; one is made from the prompt when left out
auto_create_prOpen a pull request once the work is done
work_on_current_branchPush to the branch it starts on (the pull request's head, or base_branch)
branch, base_branchThe branch to work on, and the one it starts from
plan_modeReply with a plan and wait before changing anything
sizeIts sandbox: x-small, small, medium or large
webhook_urlAn https URL told of its events

Work on a pull request

With pr_url, the session starts at the pull request's head. By default it works on a branch of its own and bases any pull request it opens on that head. With work_on_current_branch, it pushes its commits to the pull request's branch, so they join it.

The pull request has to be open and its branch in the repository itself: one from a fork is refused, since a session can't push there.

Safe retries

Send an Idempotency-Key header (up to 255 characters) when you start a session. A call sent again with the same key answers 200 with the session the first one made, and starts nothing new.

Pick a model

GET /models lists what you can start a session on: your Claude and Codex, providers on your own keys, and Outrunner's models, each with the efforts it takes. default marks the one a session that names none starts on.

Response
{ "data": [{ "id": "opus", "provider": "claude", "label": "Opus", "agents": ["claude"], "efforts": ["low", "medium", "high", "xhigh", "max"], "default_effort": "high", "supports_images": true, "default": true }] }

Statuses

A session is preparing, ready, suspended, archived, failed or deleted, with suspending, resuming, archiving and restoring on the way. While it's ready, GET /workspaces/{id} also says where its turn is: working, needs_input (it asked a question or for secrets) or idle.

GET /workspaces lists your sessions newest first (an org's admins see the org's), filtered by status, source (app, api, automation, …), user_id, project_id, pr_url and include_archived.

Something unclear? Let us know ↗