Goal
Call the Computers API from any language or tool: authenticate, create, command, connect and clean up.Prerequisites
- A user token or a computers key.
- Your project ID.
Workflow
1
Send
Authorization: Bearer <token> on every call. A computers key works on these routes only.2
Create a computer with
POST /computers and an Idempotency-Key header. It answers 202 with state creating.3
Poll
GET /computers/{id} or stream GET /computers/{id}/events until state is running.4
Call
exec, files, ports, actions or sessions. Delete with DELETE /computers/{id} when done.Endpoints
The base URL ishttps://api.stackshift.cloud/api/v1. The full contract is the OpenAPI file for Computers.
- Computers:
GET|POST /computers,GET|PATCH|DELETE /computers/{id},POST /computers/project(your latest project, or a new one named Computers),GET /computers/templates,GET /computers/regions. - Lifecycle:
POST /computers/{id}/pause,resume,fork,restore, andPUT|DELETE /computers/{id}/activity-leases/{task}to keep one awake. - Snapshots:
POST /computers/{id}/snapshots,GET /computers/snapshots,DELETE /computers/snapshots/{id}, andPOST /computers/images/importto turn a Docker or OCI image into a snapshot. - Work:
POST /computers/{id}/exec(addAccept: text/event-streamto stream),GET|PUT|DELETE /computers/{id}/files,GET /computers/{id}/files/list,POST /computers/{id}/files/mkdir,POST /computers/{id}/ports,DELETE /computers/{id}/ports/{port}. - Commands:
GET /computers/{id}/history,GET /computers/{id}/jobswithlogs,waitandkill, andPOST /computers/{id}/commands/{command_id}/stdin. History and jobs work while the computer is paused and never wake it. - Setup and large files:
GET|POST /computers/{id}/setup, and the fast upload and download routes under/computers/{id}/filesthat move big files in checked parallel parts. - Computer use:
POST /computers/{id}/actions,GET /computers/{id}/screenshot,POST take-over,POST hand-back,GET steps,GET recordings,GET|POST approvals. - Coding agents:
POST /computers/{id}/agent/promptruns Claude Code, Codex, Gemini CLI, OpenCode, Cursor, GitHub Copilot, Amp or Qwen Code inside a computer, with files attached and up to 3 copies of the same task. AlsoGET /agent/providers,GET /agent/models?provider=&secret_binding_id=(models for an agent and key),GET /agent/turns(turn history, works while the computer is paused),GET /agent/conversations,GET /agent/conversations/{cid}/events,POST …/steer,POST …/interrupt,GET …/result,GET /agent/fanouts,GET /agent/fanouts/{id}andPOST /agent/fanouts/{id}/keep. - Connections:
POST /computers/{id}/sessionsforlive,view_link,cdp,terminalandssh,GET /computers/{id}/events, andPOST|DELETE /computers/{id}/ssh-tokensfor a shareable SSH line. - Look inside:
GET /computers/{id}/system,windows,processes,logs,metricsandlimits. - Money and settings:
GET /computers/usage,GET /computers/pricing,GET /computers/public-pricing(no sign-in needed), andGET|PUT /computers/settings. - CI:
GET /computers/ci,GET /computers/ci/jobsandPOST|DELETE /computers/ci/connections. These need a user token. - Teams:
/computers/teams. See Computer Teams reference. - Keys:
GET|POST /computers/keys,DELETE /computers/keys/{id}. These need a user token.
Create, command, delete
curl
Live connections
POST /computers/{id}/sessions returns a short-lived WebSocket url. live and view_link carry the screen as VNC bytes in binary frames, for noVNC and other VNC clients; view_link ignores keyboard, mouse and clipboard input and is meant to be shared. cdp speaks the Chrome DevTools Protocol. terminal carries terminal bytes and takes {"type":"resize","rows":R,"columns":C} text frames. ssh sessions are for the SSH gateway at ssh.stackshift.cloud port 2222.
Opening a session on a paused computer wakes it, and the connection waits up to 90 seconds.
Errors and events
Every error is{"error": {"code", "message", "retryable"}}. Retry only when retryable is true.
- 400
invalid_request. 401unauthorized. 402spend_cap_reachedandinsufficient_funds. 403forbidden. 404computer_not_found. - 409
computer_invalid_state,idempotency_conflictandapprovals_disabled. 422template_unavailableandsize_unavailable. 423input_locked. 428confirmation_required. 429limit_exceededandcapacity_busy. - 500
internal_errorand 501not_available. 503capacity_unavailableandnode_unavailable: try again shortly, or in another region. capacity_busymeans free computers are busy right now. It is retryable; try again in a few minutes, or upgrade to start now.- Events are server-sent events with
id:set to the sequence number andevent:set to the type. Resume after a drop withLast-Event-IDorafter_seq. Types:state_changed,step,input_lock_changed,approval,forked,snapshot,idle,port_changed,agent.turn(a coding agent turn ended).
Expected result
You can create, drive and delete a computer using plain HTTP, and handle every error code the API returns.
Common failures
Related guides
Computers CLI reference
Every
stackshift computers command: open a shell, create, list, run commands, move files, publish ports, fork, pause, snapshot and manage keys.Computers MCP tools
One MCP address gives any MCP client 18 tools to create computers, see and use their screens, run commands, fork, pause and ask you first.
Computers keys and limits
A computers key lets an agent or tool drive computers and nothing else. Set how many it may run, how large, from which templates and how much it may spend.
Usage, prices and spending limit
What computers cost, what the free plan includes, how to read this month’s usage and how to stop spending at a limit you choose.
Use StackShift Computers from n8n
Create and drive computers from an n8n workflow with the HTTP Request node, or give an n8n AI agent the Computers tools through the MCP Client Tool node.