Docs
API reference
The shedix page uses this API, and so can your agents and scripts. Everything is JSON over HTTPS at https://shedix.dev/api.
For a walk-through an agent can follow, see the agents' guide.
Authentication
Send a token in the Authorization header. Get one with a link code (below, and what shedix login does), make one on
your profile, or use Copy prompt on a machine's page, which puts a new one in the prompt.
curl -sS https://shedix.dev/api/machines -H "Authorization: Bearer shedix_..."
A token can do anything you can do with your machines, except make more tokens. It stops working a year after its last use. Every call made with it is listed on your profile, where you can revoke it.
Link codes: a token without pasting
An agent or a script with no token asks for a link code, shows the person the address and the code, and polls until
they approve it on the shedix page, signed in (signing up first if they're new). The same flow gh and Vercel's CLI
use (RFC 8628). Neither call needs a token.
| Method | Path | Does |
|---|---|---|
| POST | /api/link |
{"agent": "Claude Code", "computer": "arnav-mbp"} (both optional, up to 60 characters each; shown to the person and used to name the token, not verified). Answers 201 {"code": "BCDF-2345", "url": "https://shedix.dev/link/BCDF-2345", "poll": "<secret>", "interval": 5, "expiresIn": 600} |
| POST | /api/link/poll |
{"poll": "<secret>"}. Answers {"status": "pending"} until the person acts; then once {"status": "approved", "token": "shedix_…", "name": "Claude Code on arnav-mbp", "email": "a***@gmail.com"} (the account it belongs to, masked), or {"status": "denied"}, {"status": "expired"} or {"status": "used"}. 404 for an unknown secret; 429 {"error", "interval"} when polled before interval seconds have passed, which adds 5 seconds to the interval from then on |
link=$(curl -sS -X POST https://shedix.dev/api/link -H 'content-type: application/json' -d '{"agent":"my script","computer":"'"$(hostname)"'"}')
echo "$link" # show the person url and code, then poll every interval seconds with {"poll": "<poll>"}
The code is 8 characters, read with or without the dash in any case, and lasts 10 minutes; it works once, and only for the first account that opens its page. The token is made at the first poll after the approval, named after the agent and computer, and listed on the profile like any other; the account gets an email about it with a link that revokes it. New codes are limited per address, and polls per code.
Machines
| Method | Path | Does |
|---|---|---|
| GET | /api/machines |
Your machines, newest first, and your projects: {"machines": [...], "projects": [...]}. Add ?project=acme/web for one project's machines |
| POST | /api/machines |
Create one. Body: size, and optionally stack, diskGb, sshKey, project, label, and image for the plain stack. Add ?wait=N to answer once it's ready, or after N seconds (up to 300) |
| GET | /api/machines/:name |
One machine. ?wait=N as above |
| POST | /api/machines/:name/start |
Start a stopped machine. ?wait=N as above |
| POST | /api/machines/:name/stop |
Stop it. Files are kept |
| POST | /api/machines/:name/restart |
Restart a running machine: a clean shutdown, then a start. Files are kept; terminals and agent conversations come back. With {"force": true} it is restarted from outside at once, which works even when nothing on the machine answers; anything not yet saved to disk is lost |
| POST | /api/machines/:name/force-sleep |
When trouble is sleep-stuck: put it to sleep without waiting for its save. Files on disk are kept |
| DELETE | /api/machines/:name |
Delete it and its disk |
| PATCH | /api/machines/:name |
{"keepAwake": true} keeps it from going to sleep; false lets it sleep again. {"project": "acme/web"} names what it's for, {"label": "api box"} gives it a name of your own; null clears either |
| PATCH | /api/machines/:name |
{"sleepIn": 90} sets a sleep timer: it goes to sleep in 90 minutes (0 for now) whatever is running, even kept awake. {"sleepTimer": "2026-11-02T23:30:00Z"} sets it to a time; null for either cancels it. Up to 30 days ahead; a start or stop clears it. On the machine, shedix sleep sets the same timer |
| POST | /api/machines/:name/copy |
New machines from its whole disk as it is now (files, installed tools, and every sign-in kept on it): {"count": 1–5, "label": "…"}, and optionally another size: "size" (s, m, l, xl or custom with "cpus" and "ramGb") and "diskGb", which can't be smaller than the source's disk (the whole disk is copied; a preset's usual sizes above it, or the source's own). Answers within about 30 seconds with {"machines": [...], "flushed": true}. One copy is a disk clone, ready in about a minute; several wait for a snapshot (setup: "copying") and are ready in three to six. flushed is false when a running source didn't confirm it wrote its newest files to disk first |
| POST | /api/machines/:name/ssh-keys |
Add a public key to this machine only: {"key": "ssh-ed25519 AAAA..."} |
Sizes: s, m, l, xl, or custom with cpus (2 to 16), ramGb and diskGb. Stacks: web (the default),
python, systems, and plain: the operating system alone, reached over SSH, Ubuntu 24.04 unless image names another
supported free Linux image as project/family (from ubuntu-os-cloud, debian-cloud, rocky-linux-cloud,
almalinux-cloud, centos-cloud, opensuse-cloud). Prices are on the pricing page.
Create and wait
curl -sS -X POST "https://shedix.dev/api/machines?wait=240" \
-H "Authorization: Bearer $SHEDIX_TOKEN" -H "Content-Type: application/json" \
-d "{\"size\": \"m\", \"stack\": \"web\", \"project\": \"acme/web\", \"sshKey\": \"$(cat ~/.config/shedix/id_ed25519.pub)\"}"
A machine
{
"name": "arnav-3f2a1b",
"status": "running",
"setup": "ready",
"ready": true,
"size": "m",
"stack": "web",
"cpus": 4,
"ramGb": 8,
"diskGb": 45,
"ip": "34.66.118.27",
"pricePerHour": 0.225,
"asleepPerHour": 0,
"awakeHours": 1.25,
"costSoFar": 0.26,
"keepAwake": false,
"project": "acme/web",
"label": "api and web",
"activeAt": "2026-11-01T09:12:30.000Z",
"sleepsAt": "2026-11-01T10:12:30.000Z",
"sleepTimer": null,
"diskUsedGb": 9.7,
"diskUsedAt": "2026-11-02T11:40:12.000Z",
"memoryUsedGb": 1.4,
"access": {
"user": "arnav",
"ssh": "ssh [email protected]",
"terminal": "https://…/<secret>/",
"ide": "https://…",
"box": "https://…/<secret>",
"password": "<the machine's secret>",
"sshKeys": ["ssh-ed25519 AAAA… you@laptop"]
},
"agents": { "claude": "ready", "codex": "off" }
}
| Field | Meaning |
|---|---|
status |
starting, running, stopping, stopped or deleting |
setup |
While it runs, booting then ready; copying for a copy waiting for its snapshot; otherwise null |
ready |
Running, with its terminal up. SSH works from here on |
trouble |
unresponsive: running, but it has reported nothing for five minutes (often out of memory); a forced restart gets it back. sleep-stuck: its sleep has been saving for over two minutes. Otherwise null |
name |
The person's name and a random end (arnav-3f2a1b; machines made before 2026-11-02: shed-3f2a1b). It never changes |
ip |
Public IPv4; it changes every time the machine starts |
access.user, access.ssh |
Who to log in as (the person's name on machines made from 2026-11-02; dev before), and the SSH command, to this start's IP |
activeAt, sleepsAt |
When it was last in use, and when it goes to sleep if it stays unused (null while kept awake) |
sleepTimer |
When its sleep timer puts it to sleep, used or not (null when there's none) |
diskUsedGb, diskUsedAt |
How full its disk is, in GB, as it last said (kept while it sleeps) and when; null on machines that don't report it |
memoryUsedGb |
How much memory is in use, in GB, while it runs; null otherwise |
sleptAt |
When it went to sleep, while it's asleep |
pricePerHour, asleepPerHour |
What it uses an hour while it runs and while it sleeps, in the unit where 0.09 is one hour (so 0.18 is 2 hours per hour). Sleep is free, so asleepPerHour is 0 unless disk was added beyond the size's own |
costSoFar |
What it has used so far, in the same unit (0.09 is one hour), as billing counts it (since 2026-11-03) |
project |
What it's for, as named on create or with PATCH, so an agent can find it again; null if unnamed. Up to 80 letters, digits, dots, dashes, underscores or slashes, stored lower-case |
label |
A name of your own for it, up to 60 characters; the machine's name never changes |
image |
What it runs: shedix's image, or the plain OS |
access.terminal, access.ide |
The web terminal and VS Code in the browser; both carry or need the machine's secret |
access.box |
The machine's files, ports and terminals server, below |
agents |
Claude Code and Codex: off (not signed in), ready, allow (waiting for an answer in its terminal) or on (reachable from the phone app) |
Your profile
| Method | Path | Does |
|---|---|---|
| GET | /api/projects |
Your projects, oldest first, empty ones too: {"projects": [{"name", "createdAt", "machines"}]} |
| POST | /api/projects |
A new, empty project: {"name": "acme/web"}. Creating, copying or labelling a machine with a project's name also makes it |
| PATCH | /api/projects?name=acme/web |
Rename it: {"name": "acme/api"}. Its machines move with it |
| DELETE | /api/projects?name=acme/web |
Remove it. Its machines stay, outside any project |
| GET | /api/me |
Who you are, with handle: the name your machines start with (arnav in arnav-3f2a1b) |
| PATCH | /api/me |
{handle}: change it, for machines you make from now on. 2 to 16 lowercase letters or digits, starting with a letter |
| GET | /api/history |
Every machine you've had, deleted ones too, newest first, 50 at a time, with events, hours and what each used; more: true means older ones: ask again with ?before=<the last one's createdAt>. totals count them all |
| GET, POST | /api/ssh-keys |
Your public keys. Add one with {"key": "..."}, or import your GitHub keys with {"github": "username"}. New keys go on every machine you have |
| DELETE | /api/ssh-keys/:id |
Remove a key from your profile |
| GET | /api/tokens |
Your working tokens; ?all=1 adds revoked and expired ones |
| PATCH | /api/tokens/:id |
Rename one: {"name": "laptop"} |
| GET | /api/tokens/:id/activity |
Calls made with it, newest first, 50 at a time; more and ?before=<the last one's at> as for history |
| DELETE | /api/tokens/:id |
Revoke it at once |
Tokens are made on the shedix page or approved there through a link code, never by another token.
Hours and plans
shedix is sold in hours (see pricing): an hour is an hour of an S running. Hours are numbers of hours; prices are in dollars.
| Method | Path | Does |
|---|---|---|
| GET | /api/billing |
hours (plan: what's left of your plan's hours, extra: hours you bought or were given, total); plan (id, status: active, cancelling, gift or past_due, renewsAt, hours, price) or null; extra (price: what one more hour costs you now, min, max); hoursPerHour (running, asleep): how many hours an hour of what's on now uses; runsOutAt: when the hours run out at that rate; monthHours (used, limit); limits; history (what you bought, plan hours, the free hours, refunds, each with hours); usage: each machine's running and sleeping seconds and hours per UTC day, for 31 days; topUps: purchases started in the last day and whether they're paid. deletesAt is always null (running out of hours never deletes a machine). The older fields balance, perHour, month and topUp are still answered for clients written before hours: they count in a unit where 0.09 is one hour |
| PATCH | /api/billing |
{"monthlyHours": 500}: the most hours your machines may use in a month. When a month's use reaches it, running machines go to sleep |
| POST | /api/billing/hours |
{"hours": 60}: any whole number from 30 to 3,000. Answers {"checkout", "hours", "price", "rate", "url"}: the person pays at url, and the hours arrive when the payment is confirmed. Also at /api/billing/topup |
| POST | /api/billing/plan |
{"plan": "starter"} (or "builder", "pro"): starts that monthly plan, or moves to it. Answers {"checkout", "plan", "price", "hours", "url"}: the person pays at url, and the plan starts when the payment is confirmed. {"keep": true} takes back a cancellation while its month is still running |
| DELETE | /api/billing/plan |
Ends your plan at the end of the month you paid for. Hours you bought stay |
GET /api/machines also answers your credit: hours, hoursPerHour, plan, runsOutAt and deletesAt (and the
older balance and perHour).
Creating, copying or starting a machine answers 402 when you have less than an hour of what it would run, a size
above s needs a first purchase (hours or a plan), or the month's limit is reached; 409 at a limit (12 machines running and 48 in all once you have paid, one S before that; unless raised); 403 while the
account is suspended.
A machine's files, ports and terminals
Each machine runs a small server at access.box. The address carries the machine's secret, so it needs no other
sign-in; keep it private. It works with files under ~/work only, and with the machine's terminals.
| Method | Path | Does |
|---|---|---|
| GET | /list?path=dir |
A folder's contents |
| GET | /file?path=file |
A file; add &download=1 to save it |
| GET | /archive?path=dir |
A folder as .tar.gz, without node_modules and .venv |
| PUT | /file?path=dir/name |
Upload the request body as a file, up to 100 MB. Add &replace=1 to overwrite |
| POST | /folder?path=dir/name |
Make a folder |
| GET | /ports |
What's listening, and any preview links |
| POST | /preview?port=3000 |
Make a public preview link for a port; it appears in /ports within seconds |
| DELETE | /preview?port=3000 |
Stop sharing it |
| GET | /terminals |
Its terminals (tmux sessions): id, kind (claude, codex, shell, or other for one an agent started), the person's name for it, Claude Code's own title for its conversation, state (working, waiting, idle), command, cwd, activity |
| PATCH | /terminals?id=claude-2&name=Fix login |
Name a terminal; an empty name gives it back its usual one |
| DELETE | /terminals?id=claude-2 |
Close a terminal: what runs in it stops |
Errors
Errors come back as {"error": "..."} with a status: 400 (a bad request), 401 (no token, or a revoked or expired
one), 402 (not enough hours, see Hours and plans), 403 (not allowed: the account isn't invited yet, with "code": "not_invited", or it's suspended), 404 (no such machine), 409 (the wrong state, like starting a running machine, or
a limit), 429 (too many requests, such as link codes; wait and try again) or 502 (the cloud failed; try again).