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.
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_url | The repository's address: https://github.com/acme/web, acme/web, an SSH remote, or a GitLab.com project |
project_id, environment_id | Or the repository's id, or a project's |
pr_url | Or a pull request to work on: the checkout starts at its head branch |
prompt | What to do |
images | Images it sees with the prompt: { "data": "<base64>", "mime_type": "image/png" } or { "url": "https://…" } |
attachment_ids | Files uploaded first with POST /attachments |
model, provider, effort | A model from GET /models, and how hard it thinks |
agent | claude (Claude Code) or codex |
name | Its title; one is made from the prompt when left out |
auto_create_pr | Open a pull request once the work is done |
work_on_current_branch | Push to the branch it starts on (the pull request's head, or base_branch) |
branch, base_branch | The branch to work on, and the one it starts from |
plan_mode | Reply with a plan and wait before changing anything |
size | Its sandbox: x-small, small, medium or large |
webhook_url | An 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.
{ "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 ↗