Skip to content
arvm
Docs menu

API conventions

Everything the dashboard and the CLI do, they do through this API. An example first:

Terminal
$ curl -s -X POST "https://api.arvm.dev/v1/machines?wait=running" \
    -H "Authorization: Bearer $ARVM_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{"size": "default"}'
JSON
{
  "id": "m_01jcz3k8x0e5v9w2r4t6y8a0bq",
  "name": "calm-river-otter",
  "dns_label": "calm-river-otter-x7k2",
  "size": "default",
  "region": "us-east",
  "desired": "running",
  "phase": "running",
  "idle_timeout_seconds": 3600,
  "ssh": "ssh calm-river-otter@ssh.arvm.dev",
  "created_at": "2026-11-10T20:31:07Z"
}

The response is shortened. The API reference has every operation and every field, and is generated from the OpenAPI document.

Authenticate

Send an API key in the Authorization header:

Text
Authorization: Bearer arvm_7Qm2vX9pL4kR8sT1wY6zB3nH5jF0aGdE2cU7iO4yN

A key belongs to one org; a full key can call every API-key operation in that org, while a read_only key can only read (Read-only keys). No path contains an org.

Create a key in the dashboard, or with a key you already have. The response is the only time the secret is shown. arvm stores a hash of it and cannot show it again.

Terminal
$ curl -s -X POST "https://api.arvm.dev/v1/api-keys" \
    -H "Authorization: Bearer $ARVM_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{"name": "ci", "expires_in_seconds": 7776000}'

expires_in_seconds is optional. A key without it never expires. Revoke a key by its ID, and it stops working at once:

Terminal
$ curl -s -X DELETE "https://api.arvm.dev/v1/api-keys/key_01jcz3k8x0e5v9w2r4t6y8a0bq" \
    -H "Authorization: Bearer $ARVM_API_KEY"

Read-only keys

A key has a scope: full or read_only. You choose it when you create the key, and it never changes. A key created without a scope is full.

Terminal
$ arvm keys create grafana --read-only
Terminal
$ curl -s -X POST "https://api.arvm.dev/v1/api-keys" \
    -H "Authorization: Bearer $ARVM_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{"name": "grafana", "scope": "read_only"}'

Give a read-only key to a program that watches and must not act: a dashboard, a cost report, a monitor.

A read-only key can A read-only key cannot
List and show machines, with their events, metrics and usage Create, change, start, stop, restart or delete a machine
See the names of a machine’s environment variables See their values
List and show snapshots, SSH keys and API keys Run a command in a machine, open its terminal, or read, list, write or delete its files
Show the org, the plan, the balance, the ledger and usage List or change a machine’s endpoints: the list holds signed links into private endpoints
Read the catalog: sizes, regions and images Create or delete a snapshot, an SSH key or an API key, a read-only one included
Start a checkout or a top-up, open the billing portal, or change the org

An operation a read-only key cannot call answers 403 with the code read_only_key, and changes nothing. The reference says for each operation which scope it needs.

Three things to know before you hand one out:

  • A read-only key is served the names of a machine’s environment variables and not their values. env then holds each name with an empty value, and the machine has "env_values_withheld": true, so a program can tell a value that was withheld from one that is empty. A full key and the dashboard are served the values.
  • A read-only API key limits the API. It does not limit SSH. SSH does not use API keys: arvm ssh, arvm cp and arvm forward sign in with the computer’s SSH key, and the org’s SSH keys decide who gets a shell. With a read-only key those commands work only on a computer whose SSH key the org already has, and they cannot register one: on any other computer they fail with read_only_key. So to give someone look-only access, give them a read-only API key and do not register their SSH key.
  • There are no keys limited to one machine. Give a program a key with an expiry, and revoke the key when the program no longer needs it.

Two groups of operations need no key: the catalog (/v1/sizes, /v1/regions, /v1/images) and the sign-in operations.

Versions

The base path is /v1. Within a version, fields and enum values are only added. A change that would break a client gets /v2.

Write clients that ignore fields they do not know and accept enum values they do not know.

IDs and names

An ID is a type prefix, an underscore and 26 lowercase characters: m_01jcz3k8x0e5v9w2r4t6y8a0bq. An ID never changes and is never reused.

Prefix Thing
m_ Machine
snap_ Snapshot
key_ API key
sshkey_ SSH key
org_ Org
usr_ User
evt_ Machine event
grant_ Grant
le_ Ledger entry

Sizes, regions, images and plans are named by a short word: default, us-east, ubuntu-24.04, standard.

A machine also has a name. Every path that takes a machine’s ID also takes its name. An ID contains an underscore and a name cannot, so the two never collide. A name is unique in your org among machines that are not deleted, and it is free again the moment its machine is deleted. Snapshots work the same way.

Store the ID if you need a reference that survives a rename.

Desired and phase

A machine reports desired, which is what was asked for, and phase, which is where it is. An action such as stop returns as soon as desired is set.

To wait for the result, pass wait and timeout:

Terminal
$ curl -s -X POST "https://api.arvm.dev/v1/machines/calm-river-otter/stop?wait=stopped&timeout=120" \
    -H "Authorization: Bearer $ARVM_API_KEY"

The request is held until the machine reaches the phase, for at most timeout seconds. The default is 60 and the most is 300. On a timeout the response is still a success, with the phase the machine is in. Always read phase from the response.

Actions are safe to repeat

start, stop and restart are POST requests on the machine. Stopping a stopped machine returns 200. PUT on an endpoint with the same body returns 200 and changes nothing.

Deleting a machine or a snapshot takes time. DELETE returns 202 with the resource, which shows desired: deleted or state: deleting. Deleting a key, an endpoint or a file is complete when the response arrives and returns 204. Deleting what is already deleted returns 404.

Idempotency keys

Send an Idempotency-Key header with every POST that creates something: a machine, a snapshot, an SSH key, an API key, a checkout, a top-up. Use a new random value for each thing you mean to create, such as a UUID.

  • For 24 hours, a request with the same key and the same body returns the first request’s response. Nothing is created twice.
  • A request that failed leaves its key free, so the same request with the same key is tried again. One failure is remembered for a short time: a machine create refused with no_capacity returns the same response until its Retry-After has passed, and is tried again after that.
  • The same key with a different body fails with idempotency_key_reused and status 409.

If a create request times out or the connection drops, send it again with the same key.

Lists

A list returns data and next_cursor:

JSON
{
  "data": [],
  "next_cursor": null
}

Pass limit to set the page size. The default is 50 and the most is 200. To get the next page, pass the previous page’s next_cursor as cursor. next_cursor is null on the last page.

Terminal
$ curl -s "https://api.arvm.dev/v1/machines?limit=100&cursor=bV8wMWpjejNrOHgwZTV2OXcycjR0Nnk4YTBicQ" \
    -H "Authorization: Bearer $ARVM_API_KEY"

Fields without a value

A response field that has no value is left out. null appears only where it means something: idle_timeout_seconds: null means never, and next_cursor: null means the last page. In a PATCH body, a field you leave out is not changed.

Errors

An error response has the content type application/problem+json and this shape:

JSON
{
  "type": "https://arvm.dev/problems/insufficient_balance",
  "title": "The balance is empty.",
  "status": 402,
  "code": "insufficient_balance",
  "detail": "Subscribe or top up to start machines. Stopped machines keep their disks."
}

Switch on code. It is a stable string. title and detail are for people and can change. A request with invalid fields also has errors, a list of field and message pairs.

Every string you send is UTF-8 text without the NUL character, except the stdin of exec, which may hold a NUL. A path that names a machine or snapshot by anything else is not_found, as a path that names nothing is. Any other value that is not text, a machine named in a body or a query included, is invalid_request, and errors names it: the field, or body for a JSON body that is not UTF-8.

The codes a program most often has to handle:

Code Status What to do
invalid_request 400 Fix the request. errors names each field.
unauthenticated 401 The key is missing, revoked or expired.
insufficient_balance 402 The balance is zero. A person has to subscribe or top up.
limit_exceeded 403 A plan limit is reached. Stop or delete something.
org_suspended 403 The org is suspended: nothing starts, and it can only read its records, sign in and out (the CLI too), delete keys, turn auto top-up off and open the billing portal. detail says why. Write to ben@advancedruntime.com.
not_found 404 The resource does not exist in this org.
name_taken 409 Choose another name.
machine_not_running 409 Start the machine first.
machine_not_stopped 409 Stop the machine first.
idempotency_key_reused 409 Use a new key for a new request.
rate_limited 429 Wait for the seconds in the Retry-After header.
no_capacity 503 No server has room. Wait for Retry-After, then try again.
machine_unreachable 503 The machine’s server does not answer. Try again.
exec_outcome_unknown 502 For exec: whether the command ran is unknown. It may not have started, may have run, or may still be running. Not safe to retry as it is: check what the command changes first.
internal 500 Our fault. Safe to retry with the same Idempotency-Key.

The list of codes grows. Treat a code you do not know as its HTTP status. The reference has every code.

Money, time and enums

  • Money is an integer number of millionths of a dollar, in a field that ends in _micros. 20000000 is $20.00.
  • Time is RFC 3339 in UTC: 2026-11-10T20:31:07Z. A duration is an integer with its unit in the field name: idle_timeout_seconds.
  • Enums are lowercase strings with underscores. New values are added over time.

Streams

Two operations can stream with server-sent events:

  • GET /v1/machines/{machine}/events?follow=true streams a machine’s events. Each message carries the event’s ID, so a client that reconnects with a Last-Event-ID header continues where it stopped.
  • POST /v1/machines/{machine}/exec with "stream": true streams a command’s output. This stream cannot be resumed. When the connection drops, the command is killed.

Rate limits

Limits are counted per API key. A request over the limit gets status 429, the code rate_limited, and a Retry-After header with the seconds to wait.

Request IDs

Every response has an X-Request-Id header. Quote it when you write to ben@advancedruntime.com. The request ID is the ID of the platform’s trace of the request, and the platform always chooses it. A request can carry a W3C traceparent header: the platform’s trace then links to your span, so a trace of your own client can lead to the platform’s, but the request ID is still the platform’s. A 502 that the platform’s front door answers itself, because the API did not answer, has a request ID too.

Sign in from a program without a key

The CLI gets its first key through a browser. A program of your own can do the same:

  1. POST /v1/auth/device/start returns a user_code, a verification_uri_complete and a device_code.
  2. Show the person the code and open the URL. They sign in and approve the code.
  3. POST /v1/auth/device/token with the device_code, every interval_seconds. It returns 202 until the code is approved, then 200 with a new API key.

The auth reference has the request and response of each step.