Skip to main content
POST
Creates a new cloud session backed by a sandbox. The session starts in creating state and transitions to running once the sandbox is provisioned. Use this when you need to set up a sandbox up-front and decide what prompt to send later. If you want to fire a prompt at the same time you create the session, use POST /api/v0/sessions/launch instead. Required scope: sessions:write

Headers

string
required
Bearer token. Example: Bearer runtm_xxx

Body

string
default:"claude-code"
Coding agent: claude-code, codex, opencode, github-copilot, cursor-cli, devin-cli, gemini-cli.
string
Project template to scaffold: web-app, backend-service, static-site.
string
default:"autopilot"
Session mode: autopilot (auto-approve actions) or interactive.
object
GitHub repo metadata for tier selection. Shape: { "full_name": "owner/repo", "size_kb": 1024, "requires_docker": false, "has_docker_compose": false, "is_monorepo": false }.
string
default:"api"
Origin of the session, surfaced in telemetry. Defaults to api for programmatic callers.
string
Lifecycle action when prompts complete: pause (default), destroy, or keep_alive.
integer
Maximum session lifetime in minutes (1–1440). Acts as a safety net for background agents.

Response

Returns 201 with the created session.
string
Session ID - use this for subsequent prompt/git/destroy calls.
string
Initial state (typically creating).
string
Coding agent assigned to the session.
string | null
Template used.
string
ISO 8601 creation timestamp.
string | null
TTL expiry, if ttl_minutes was set.