# 0x.cloud: full API and MCP reference Base URL: https://0x.cloud/v1. JSON. Time in UTC, ISO 8601. Money in US dollars; `*_micro` fields are millionths of a dollar. Machine-readable description: https://0x.cloud/v1/openapi.json (`?lang=ru` for Russian descriptions). Short version: https://0x.cloud/llms.txt. 0x.cloud sells cloud VPS (KVM, NVMe) in Frankfurt, Germany. Seller: Altiva Networks Limited, Hong Kong. ## Before you start - Network. Check `has_public_ip` of the server. When it is false, `ip`, `ipv4`, `ipv6` are empty and SSH from the internet does not reach the server: work with it through the root shell of this API (section "Inside the server") or the web console in the account area (https://0x.cloud/cabinet). `extra_ips_count` above 0 answers 409 `ipv4_unavailable` while public IPv4 is off. `GET /v1/servers/{id}/ips` tells the current state. - Payments. `GET /v1/payment-methods` (no key needed) lists the ways to pay that are on. With none on, `POST /v1/topups` answers 409 `payments_unavailable` with `agent_hint: "do_not_retry"` (the old code `payments_disabled` is in `legacy_code`): do not retry, the balance is then topped up by support through a ticket (`POST /v1/tickets`, department `billing`). - Methods that answer `not_available` (409 or 501): Telegram linking, card payment of an invoice. Invoices are not issued (`GET /v1/invoices/{id}` is always 404), ticket attachments are not supported. ## Identifiers Everything the API names has a string identifier like `srv_8f3k2m9x4qpz7w1c`: the first three letters are the kind (`srv` server, `snp` snapshot, `ssh` SSH key, `key` API key, `tkt` ticket, `msg` message, `ntf` notification, `apr` approval request, `whk` webhook, `txn` balance transaction, `alr` alert, `evt` event, `act` server action, `usr` account, `req` server request, `wdr` withdrawal), the other 16 are random. Take the identifier from an API answer and pass it as it is; numbers are not accepted. An unknown identifier in a field: 422 `unknown_identifier`; in the address: 404. The `cursor` of the event feed is an event identifier too. OS image numbers (`os_template_id`, `template_id`) are numbers from `GET /v1/images`. ## Getting an account and a key Three ways, pick the first one that fits: 1. OAuth (MCP clients that support MCP authorization: Claude, ChatGPT, Cursor and others). Point the client at `https://0x.cloud/v1/mcp`. Authorization code with PKCE (S256), dynamic client registration (`POST /v1/oauth/register`), metadata at `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`. Redirect URI: `https://`, `http://` on localhost, or the own scheme of a native program (`cursor://...`). The person signs in and chooses on `https://0x.cloud/oauth/authorize` the scopes, spend limit, expiry and "own servers only". `POST /v1/oauth/token` gives `access_token` (an ordinary API key, visible and revocable in the account area), `refresh_token` and `expires_in`. `grant_type=refresh_token` with `refresh_token` and `client_id` gives a new pair; each refresh token works once and the previous access token stops working at that moment. A refresh token used twice answers `invalid_grant` and revokes the whole grant. A refresh cannot widen the scopes (`invalid_scope`). Revoke: `POST /v1/oauth/revoke` with the access or the refresh token. 2. A key from the person: the account area, section "API and MCP", or `POST /v1/api-keys` by another key (below). 3. No account yet: `POST /v1/signup` `{"email": "", "name", "client": "", "ref" or "referral_code", "language", "utm_*"}`, no key needed. The account belongs to the person whose email is given; they get a letter and confirm with a button on the page it links to. Answer 201: `account_id`, `api_key` (shown once: store it), `api_key_id`, `trust_level: 0`, `email_confirmed: false`, `limits`, `referral`, `next_steps`, `docs`. The key has the scopes `servers.*`, `billing.read`, `billing.topup`, `account.read`, `support.*` and a spend limit of $20 a month. Until the email is confirmed: one s1-1 or s1-2 server without extra disk, top-ups up to $50 in all; beyond that 403 `email_not_confirmed` with a `hint`. Errors: 422 `disposable_email`, 409 `email_taken` (with a `hint`: ask the person for a key or use OAuth), 429 `rate_limited` with `retry_after` (3 sign-ups an hour and 10 a day per IP address), 451 `region_unavailable`. ## Authorization and scopes Header `Authorization: Bearer 0x_live_...`. Scopes: `servers.read`, `servers.create`, `servers.update`, `servers.power`, `servers.install`, `servers.credentials`, `servers.console`, `servers.exec`, `servers.delete`, `billing.read`, `billing.topup`, `billing.withdraw`, `account.read`, `account.update`, `account.delete`, `tokens.read`, `tokens.write`, `tokens.revoke`, `support.read`, `support.write`, `notifications.read`, `notifications.write`, `webhooks.read`, `webhooks.write`. Masks: `servers.*`, `*`. `billing.withdraw` is never part of `*` or `billing.*`: a person grants it by name. Default key: `servers.*`, `billing.read`, `account.read`. Rate limit per key, 120 requests a minute by default. Over it: 429 `rate_limited`. Key spending. Each key has one rule: `"spend_mode": "unlimited"` (only the balance limits it), `"limited"` (at most `spend_limit_usd` per `spend_period`: `day`, `month` = calendar month, `total` = the whole life of the key), `"none"` (no spending at all). The counter is net spend: everything the key's requests charged (server creation and restore, snapshots, backups, plan change, unfreeze) minus refunds of its own requests, plus hourly billing and renewals of servers the key created. A paid action over the limit: 402 `key_spend_limit_reached` (fields `limit_usd`, `spent_usd`, `remaining_usd`, `required_usd`, `resets_at`); spending forbidden: 403 `key_spend_forbidden`. Nothing is charged and nothing changes; do not repeat the request, see "Owner approvals". Running servers are not stopped by the limit. `GET /v1/account/key`: what the calling key may do, its spend rule, spent and remaining. Only a person in the account area (an API key gets 403 `human_only`): password change, two-factor protection (setup, confirm, disable, backup code), linking and unlinking sign-in services, account deletion, granting `billing.withdraw`. ## Errors `{"error": {"code": "...", "message": "..."}}`. Validation errors: 422 `{"message": "...", "errors": {"field": ["..."]}}`. Many refusals carry `agent_hint` (`wait`, `ask_human`, `retry`, `do_not_retry`) and `hint`. Common codes: `unauthenticated` (401), `insufficient_scope` (403), `insufficient_balance` (402), `plan_not_found` (404), `server_busy`, `server_deleted`, `server_not_running`, `not_available` (409), `template_unavailable`, `os_not_orderable` (422), `provider_error`, `provisioning_failed` (502: no money charged). Language of messages: English with `?lang=en`, `X-Language: en` or `Accept-Language: en`, or the saved choice `PATCH /v1/profile {"language": "en"}`; without any of them the source language (Russian) is used. `error.code` never depends on the language: programs must rely on it. ## Safe retry Any POST, PATCH and DELETE accepts `Idempotency-Key` (8–128 characters: Latin letters, digits, `.`, `_`, `:`, `-`). The same key with the same body within 24 hours returns the stored answer with `Idempotent-Replay: true`. The same key with another body: 409 `idempotency_key_reused`. A repeat while the first request still runs: 409 `request_in_progress`. ## Catalogue - `GET /v1/public/pricing`: plans, prices per period, add-ons and what is included, no authorization. `has_capacity` says whether a plan has room; `on_request: true` marks plans a person issues. - `GET /v1/plans`: `slug`, `vcpu`, `ram_mb`, `disk_gb`, `price_monthly_usd`, `price_hourly_usd`, `is_auto_provision`. - `GET /v1/images?plan=s1-2`: operating systems to order: Ubuntu 24.04, Debian 12, AlmaLinux 9 (`id`, `name`, `default`). Another image answers 422 `os_not_orderable`. - `GET /v1/locations`: one location, Frankfurt. - `GET /v1/apps`: ready-made Ubuntu 24.04 servers: `agents` (Claude Code, Codex, Node.js, Python, Git, tmux, Docker) and `bots` (Python with Telegram and Discord libraries, Node.js with pm2, a service for the bot). Create one with `POST /v1/servers` and `"app": "agents"` instead of `os_template`; `"available": false` answers 409 `app_unavailable`. No model keys or tokens are on the server: the owner sets them. Start with `/root/README-0x.md` on the server. ## Plans issued on request Plans with `"is_auto_provision": false` are issued by a person after the room is confirmed. `POST /v1/servers` for them answers 409 `plan_on_request` (old name `plan_by_request` in `legacy_code`, request address in `request_url`), but `dry_run: true` gives the exact quote. Get that dry run for the same `plan` and `billing_cycle` and show the price to the person. Then send the request: `POST /v1/server-requests` `{"plan", "os_template_id" or "os_template", "billing_cycle", "hostname", "ssh_key_id", "note", "accept_manual_issue": true, "pricing_fingerprint": "..."}` → 202 with a request in status `pending`. `accept_manual_issue: true` (consent to the manual issue) and the unchanged `pricing_fingerprint` from the quote (valid 10 minutes, fixes price and specs) are required: ask the person before setting `true`. A missing, wrong or expired fingerprint, or a catalogue change, answers 409 `price_changed` with `error.quote`: show the new price, get new consent, never send the request automatically. Money is charged when the server is issued, but it must be on the balance when the request is made (402 `insufficient_balance`). No lead time is promised. List: `GET /v1/server-requests`; cancel a pending one: `DELETE /v1/server-requests/{id}`. After approval the request has `server_id`, after a refusal `reason`. A key with a spend limit cannot send such a request: the owner does it in the account area. Extra disk and snapshots are not carried (`extra_disk_gb` or `from_snapshot`: 422 `not_in_request`). ## Servers - `GET /v1/servers`: list. `?status=deleted`: deleted ones. - `POST /v1/servers`: create. Fields: `plan` (required), `os_template_id` or `os_template` (default Ubuntu 24.04), `app`, `from_snapshot`, `hostname`, `billing_cycle` (`hourly`, `monthly`, `quarterly`, `semiannual`, `annual`; default `monthly`), `ssh_key_id`, `extra_disk_gb`, `ttl_hours` (1–720) or `ttl_minutes` (from 10), `startup_script`, `dry_run`, `pricing_fingerprint`. - `"dry_run": true` → 200 with the price: `currency: "USD"`, `monthly_usd`, `hourly_usd`, `total_usd`, exact micro amounts, `resources`, `pricing_expires_at` and the opaque `pricing_fingerprint`. Nothing is created. The fingerprint is valid 10 minutes and bound to the account, the plan and its specs, the period, the extra disk and the amounts; never decode, change or build it yourself. The answer also has `within_key_limit`, `key_remaining_usd` and `balance_enough`. - Without `dry_run` send the unchanged `pricing_fingerprint` from the quote the person saw, with the same `plan`, `billing_cycle`, `extra_disk_gb`. Only after explicit consent to the amount. Success → 201 `{"data": {server}, "username": "root", "password": "..."}`. The password is shown once. - Missing, wrong or expired fingerprint, or a change of the priced product → 409 `price_changed` with `error.quote` (new amount, expiry and fingerprint). No charge and no provisioning happen before this error. Show the new price, get new consent; if the body changes, use a new `Idempotency-Key`. Never do this repeat automatically. After an unknown network outcome repeat only exactly the same body with the same fingerprint and key while the fingerprint is valid. - A period is charged from the balance at once. `hourly` needs at least $5.00 on the balance. - At most 10 active servers. Plans with `is_auto_provision: false`: `POST /v1/server-requests` (above). - `GET /v1/servers/{id}`: the server from the database. `GET /v1/servers/{id}/state`: with live status from the hypervisor. - `GET /v1/servers/{id}/wait?timeout=25`: wait until the server can be used. `ready: true`: the operation ended and the system inside answers (commands will run). `ready: false`: repeat; the reason is in `operation` (`installing`, `starting`, `restarting`, `freezing`, `backup_restore`, `snapshot_restore` ...) and `agent` (`starting`: the system boots, `off`: the server is off, `unavailable`: no guest agent in the system). - Price in advance: `dry_run: true` on `POST /v1/servers`, `/resize`, `/backups/enable`. - `POST /v1/servers/{id}/power` `{"action": "boot" | "shutdown" | "reboot" | "poweroff"}`. - `POST /v1/servers/{id}/install` `{"template_id": 5}` or `{"os_template": "Debian 12"}`: reinstall, the disk is erased, the new password is in the answer. Free. - `POST /v1/servers/{id}/password-reset`: new root password, running servers only. `POST /v1/servers/{id}/password`: the password the console knows (scope `servers.credentials`). - `POST /v1/servers/{id}/resize` `{"plan": "s2-4"}`: move to a larger plan, the difference for the rest of the period is charged; `"dry_run": true` shows the sum. A smaller plan is not possible: make a new server from a snapshot. - `GET /v1/servers/{id}/iso`: is an own ISO attached. `POST /v1/servers/{id}/iso` `{"url": "https://example.com/image.iso"}`: attach an image by a direct https link (a domain name, no port and no query, ending in `.iso`) and boot from it; installation goes on in the web console. `DELETE /v1/servers/{id}/iso`: eject. - Backups (paid, +20% of the plan price a month): `GET /v1/servers/{id}/backups`: state, price, copies. `POST /v1/servers/{id}/backups/enable` (`{"dry_run": true}` shows the price; for a paid period the share for its rest is charged at once). `PUT /v1/servers/{id}/backups/schedule` `{"frequency": "manual|6h|12h|daily|2d|weekly", "hour_utc": 0-23, "weekday": 1-7}`. `POST /v1/servers/{id}/backups`: a copy now (at most once an hour). `POST /v1/servers/{id}/backups/restore` `{"backup_id": "...", "confirm": true}`: back to a copy, the disk is overwritten. `POST /v1/servers/{id}/backups/disable`: time already paid is not refunded. If backup storage cannot be reached, enabling answers 503 `backups_unavailable` and charges nothing. - Snapshots (paid, a fixed monthly price each, see `meta.price_monthly_usd`): a copy of the server disk that belongs to the account and stays after the server is deleted. `GET /v1/snapshots`: all snapshots and `meta.available`; `POST /v1/servers/{id}/snapshots` `{"name": "..."}`: take one (the server keeps running, status `creating` → `ready`); `POST /v1/servers` with `from_snapshot`: a new server from it; `POST /v1/servers/{id}/snapshots/{snapshot}/restore` `{"confirm": true}`: replace the server disk with it; `PATCH`/`DELETE /v1/snapshots/{id}`. With `meta.available` false, creation answers 503 `snapshots_unavailable` and charges nothing. `consistent: false`: taken from a running server without a guest agent, writes were not paused; for databases switch the server off and take it again. - `PATCH /v1/servers/{id}` `{"hostname": "...", "note": "...", "ttl_minutes": 120}`: rename, note, timer. - `DELETE /v1/servers/{id}` → `{"ok": true, "refund_usd": "...", "restorable_until": "..."}`. - `POST /v1/servers/{id}/restore`: back within 24 hours; the refund is charged again. - `POST /v1/servers/{id}/freeze`: the server is switched off and its disk goes to storage; status `frozen`, while moving `"operation": "freezing"`. The rest of the paid period returns to the balance (`refund_usd`), storage costs `freeze_price_monthly` (20% of the plan) charged hourly. `POST /v1/servers/{id}/unfreeze` rebuilds the server from the copy in 2–5 minutes (wait with `GET /servers/{id}/wait`); data, root password and SSH keys stay; a server paid per period is charged a new period (`freeze.unfreeze_charge`). A frozen server answers `server_frozen` to other actions. - `GET /v1/servers/{id}/metrics`, `/metrics/history?range=hour|day|week|month`, `/capabilities`, `/ips`, `/templates`, `/history`, `/cancellation`. - `POST /v1/servers/{id}/cancellation`: do not renew after the paid period; `DELETE`: renew again. Server statuses: `provisioning`, `running`, `stopped`, `paused`, `suspended`, `frozen`, `deleted_pending`, `deleted`, `error`. Balance runs out: servers stop (status `paused`) and their data is kept for 7 days; a top-up returns them. ## Balance and money - `GET /v1/balance` → `balance_usd`, `balance_micro`, `referral_balance_usd`. - `GET /v1/transactions`: transactions, 30 a page. `GET /v1/balance/entries.csv`: export. - `GET /v1/payment-methods`: ways to pay that are on, each with `code`, `min_usd`, `max_usd`, `requires_human`. - `POST /v1/topups` `{"amount_usd": "20", "method": ""}` (`gateway` is the old name of `method`) → an invoice with a payment link that a person opens. The money is credited once after the provider confirms it; event `balance.topped_up`. `GET /v1/topups`, `GET /v1/topups/{id}`, `POST /v1/topups/{id}/refresh` (check now). - Withdrawal of money paid in (not bonuses or promo credit), scope `billing.withdraw`: - `GET /v1/withdrawals`: last requests and `available_usd`, `min_usd` (10.00), `networks` (`usdt_trc20`, `usdt_ton`, each with its network fee note), `processing_hours` (72). - `POST /v1/withdrawals` `{"amount_usd": "25.00", "network": "usdt_trc20", "address": "..."}` → 202, status `pending_email_confirmation`: the account owner confirms by the link in the email within 24 hours. The network fee is on the customer. - Statuses: `pending_email_confirmation` → `email_confirmed` → `aml_check` → `sent` (with `tx_hash`) | `rejected` | `cancelled` | `expired`. - `GET /v1/withdrawals/{id}`, `POST /v1/withdrawals/{id}/cancel` (while it can still be cancelled; otherwise 409 `withdrawal_not_cancellable`). - Errors: 422 `invalid_address`, `unknown_network`, `invalid_amount`; 409 `withdrawal_in_progress` (one request at a time), `withdrawal_exceeds_available` (only money paid in can be withdrawn, and not more than the balance). - Events: `withdrawal.requested`, `withdrawal.confirmed`, `withdrawal.sent`, `withdrawal.rejected`, `withdrawal.cancelled`, `withdrawal.expired`. ## Inside the server Commands run on the server as root through its guest agent (QEMU guest agent): no SSH, password, key or network address needed; scope `servers.exec` (part of `servers.*`). The server must be `running`. - `POST /v1/servers/{id}/exec` `{"command": "apt-get update && apt-get install -y nginx", "stdin": "...", "timeout": 30, "wait": 30}` → `{"data": {"status": "finished", "command_id", "exit_code": 0, "stdout", "stderr", "duration_ms"}}`. `command` is a script for `sh`, may be multi-line. No interactive input (`-y`, `DEBIAN_FRONTEND=noninteractive`). `timeout` up to 3600 seconds, then the command is stopped (`"timed_out": true`). `wait`: how long to wait in this request, up to 45 seconds. - Not done within `wait`: `{"status": "running", "command_id"}`; then `GET /v1/servers/{id}/exec/{command_id}?wait=45`. The result is kept 15 minutes. Output comes whole at the end, up to 256 KB per stream (longer: start and end, `"truncated": true`). - Sessions: `"session": "main"`: commands of one session keep the directory (`cd`) and exported variables between calls; a new session starts in `/root`. `"cwd": "/srv/app"`: run in that directory. `"env": {"DB_PASSWORD": "..."}`: variables for this command only, never written to any log: pass secrets this way, not in the command text. - Background jobs for anything longer than a minute: `"background": true` → 202 `{"status": "started", "job_id", "log"}`. `GET /v1/servers/{id}/jobs/{job_id}?offset=0&wait=25` → `{"status": "running" | "finished" | "stopped" | "lost", "exit_code", "output", "next_offset", "more"}`; the next call uses `offset=next_offset` and returns as soon as there is new output. `GET /v1/servers/{id}/jobs`: jobs of the last 7 days; `DELETE /v1/servers/{id}/jobs/{job_id}`: stop a job with everything it started. - Files: `GET /v1/servers/{id}/files?path=/etc/hosts&offset=0&max_bytes=200000` (up to 200 KB a request: `content`, `encoding` text or base64, `size`, `truncated`, `next_offset`); `PUT /v1/servers/{id}/files` `{"path", "content", "encoding", "mode": "0644", "append": false}` (atomic write or append, up to 500 KB a request); `POST /v1/servers/{id}/files/edit` `{"path", "old_string", "new_string", "replace_all": false}` (exact replacement; 422 `string_not_unique` / `string_not_found`; files up to 250 KB); `GET /v1/servers/{id}/dir?path=/etc/nginx` (up to 1000 entries); `GET /v1/servers/{id}/search?path=/etc&pattern=listen®ex=0&max=100`. - `POST /v1/servers/{id}/authorized-keys` `{"ssh_key_id" | "public_key", "user": "root"}`: add a public SSH key to a user of the running server. - `GET /v1/servers/{id}/health` (scope `servers.read`): load, memory, disks, heaviest processes, failed services and `advice`. - Startup script: `POST /v1/servers` with `"startup_script": "#!/bin/sh\n..."` (up to 64 KB) runs once as root when the server is ready, as a background job; state in the `startup` field of the server, event `server.startup_finished`. The script is not kept after it ran. - Timer: `ttl_hours` or `ttl_minutes` at creation, `PATCH /v1/servers/{id}` `{"ttl_minutes": 120}` to set or move it, `0` to remove it. Checked every 5 minutes; the server is deleted as usual (remainder refunded, 24 hours to restore). - Errors: 409 `server_not_running`; 409 `guest_agent_unavailable` (the system is booting: repeat after `retry_after` seconds); 409 `guest_exec_disabled`; 409 `server_busy` (more than 4 commands at once); 429 `rate_limited` (more than 120 commands a minute per server); 503 `exec_unavailable`. - The first 200 characters of each command and the path of each written file go to the server history `GET /v1/servers/{id}/history`; input and output are not stored anywhere. ## Firewall The firewall of a server is not inside the system but in front of it, on the hypervisor, at the network interface of the machine. It cannot be switched off from inside and a mistake in the rules does not lock you out: API commands and the web console do not go through the server network. - `GET /v1/servers/{id}/firewall` → `{"enabled", "rules": [...], "status": "applied" | "pending" | "error", "outgoing_mail": {"allowed", "requested_at"}}`. - `PUT /v1/servers/{id}/firewall` `{"enabled": true, "rules": [{"direction": "in" | "out", "protocol": "tcp" | "udp" | "icmp" | "any", "ports": "22" | "80,443" | "8000-8100", "cidrs": ["203.0.113.7", "198.51.100.0/24"], "description": "..."}]}`: the rule list is replaced as a whole (up to 50 rules). Without `rules` only `enabled` changes. - Enabled: incoming is closed except what `in` rules allow; answers to connections the server opened pass. Outgoing is open until there is an `out` rule. Empty `cidrs`: any address; `icmp` allows ping; ports only for tcp and udp. - Errors: 422 `bad_rule` (the message names the rule), 502 `firewall_not_applied` (the previous rules stay), 503 `firewall_unavailable`. - Outgoing port 25 is closed on every server. `POST /v1/servers/{id}/port25-request` `{"reason": "..."}` asks support to open it; a person decides. Ports 587 and 465 are open. ## Monitoring - `GET /v1/servers/{id}/monitoring`: settings, current load (`current`), what is supported, alerts firing now (`firing`) and the last 20. - `PUT /v1/servers/{id}/monitoring` `{"enabled": true, "cpu_percent": 90, "memory_percent": null, "disk_percent": 85, "offline": true, "for_minutes": 10, "notify_email": true}`: only the fields sent change; `null` switches a check off; thresholds 50–99, `for_minutes` 5–60. 422 `monitoring_nothing_to_watch` when nothing is watched. - An alert opens when a value stays at or above its threshold longer than `for_minutes` (samples every 5 minutes) and closes when it is back to normal. On open and close: a notification in the account area, an email (if `notify_email`), webhooks and events `monitoring.alert`, `monitoring.resolved`. - `GET /v1/alerts?status=firing|resolved&server_id=srv_...`: alerts of all servers, newest first, kept 90 days. ## Overview and agent memory - `GET /v1/overview`: everything to start or continue work in one answer: the key (scopes, limit and remainder, restrictions), balance, daily spend and days left, servers with state and notes, requests waiting for the owner, `events_cursor` and `good_to_know`. - `PATCH /v1/servers/{id}` `{"note": "..."}`: a note up to 2000 characters: what the server is for, what is deployed, what is unfinished. Shown in `GET /v1/servers/{id}` and the overview. Never put secrets there. - `GET /v1/account/key/activity?page=1`: the activity log of the calling key. ## Events - `GET /v1/events?after=&types=server.*,snapshot.ready&server_id=srv_...&wait=25` → `{"data": [{"id", "type", "server_id", "data", "created_at"}], "cursor", "timed_out"}`. The request stays open up to `wait` seconds (at most 25) until a matching event appears. Pass `cursor` as `after` next time. A key hears what it may read: `balance.*` with `billing.read`, `withdrawal.*` with `billing.read`, `ticket.*` with `support.read`, `approval.*` only answers to its own requests. - Types: the webhook events plus `server.startup_finished`, `approval.approved`, `approval.denied`. Events are kept 30 days. ## Owner approvals A key that may not do something does not just get a refusal: the account owner is asked, and after their yes the same call goes through once. - A paid call over the key limit: 402 `key_spend_limit_reached` or 403 `key_spend_forbidden` with `"approval": {"id", "status": "pending", "expires_at"}` and `next_step`. - A key marked "ask before deleting and overwriting": server deletion and freeze, reinstall, restore from a snapshot or backup, snapshot deletion answer 403 `approval_required` with the same `approval` field. - A key creating a wider key: 403 `scope_escalation` (old code `scope_not_granted` in `legacy_code`) or 403 `spend_limit_escalation`, with `approval`. - `GET /v1/approvals/{id}?wait=25`: wait for the answer: `pending`, `approved`, `denied`, `used`, `expired`. After `approved` repeat the same call with the same arguments (within 24 hours, once). After `denied` do not repeat. - `POST /v1/approvals` `{"amount_usd": "15", "reason": "..."}`: ask in advance for a one-time permission to spend; once approved it covers one paid action up to that amount. - `GET /v1/approvals`: requests of the key. Only the owner answers, in the account area (`POST /v1/approvals/{id}/approve|deny` from a session; a key gets 403 `cabinet_only`). ## Key restrictions and keys made by keys Besides scopes and spend the owner may set: `"own_servers_only": true` (the key sees and touches only servers it created, their snapshots and events; others are 404), `"require_confirmation": true` (dangerous actions only after the owner's approval), `"max_server_ttl_hours": 24` (servers the key creates delete themselves within that time). `GET /v1/account/key` shows them. - `GET /v1/api-keys`, `POST /v1/api-keys` `{"name", "scopes", "rate_limit", "spend_mode", "spend_limit_usd", "spend_period", "allowed_ips", "expires_days", "own_servers_only"}`, `PATCH /v1/api-keys/{id}`, `DELETE /v1/api-keys/{id}`. - A key may create keys no wider than itself and within its own remaining limit; wider asks go through an approval (above). A child key inherits the restrictions of its parent, spends from the parent's limit and dies with it. - Scopes, limits and expiry of an existing key change only in the account area; a key may change the name only (otherwise 403 `cabinet_only`). - `GET /v1/api-keys/{id}/activity?page=1` (scope `tokens.read`): every request of the key that changed something, and file reads on servers: time, MCP tool or method and path, server, summary, result, error code, amount. Kept 90 days, also after the key is deleted. ## Account - `GET /v1/account`, `GET /v1/account/limits`, `GET /v1/account/audit`, `GET /v1/profile`, `PATCH /v1/profile` (`name`, `language`). - `GET /v1/account/sessions-list`: open sessions (closing them: account area only). - `GET /v1/account/2fa`, `GET /v1/account/login-methods`: state of two-factor protection and sign-in services (changes: a person only). - `GET /v1/notifications`, `POST /v1/notifications/read-all`, `POST /v1/notifications/{id}/read`. - `GET /v1/ssh-keys`, `POST /v1/ssh-keys` `{"name", "public_key"}`, `DELETE /v1/ssh-keys/{id}`. - Referral program: `GET /v1/referrals` (code, link, `rate_percent`, `terms`, `manual_code_until`): the invited person gets 15% off their first period payment; the inviter gets 10% of what the invited person pays in, for life, as credit on the referral balance (not withdrawn). `POST /v1/referrals/code` `{"code"}`: enter the inviter's code within 7 days after sign-up and before the first top-up (409 `referral_locked`, `referral_already_set`; 422 `referral_code_unknown`, `self_referral`). `POST /v1/referrals/transfer`: move the referral balance to the main one. ## Support - `GET /v1/support/departments`, `GET /v1/tickets`, `POST /v1/tickets` `{"subject", "department": "tech" | "billing" | "general", "message", "server_id"}`. - `GET /v1/tickets/{id}`, `POST /v1/tickets/{id}/messages` `{"message"}`, `POST /v1/tickets/{id}/close`. ## Webhooks - `GET /v1/webhooks`, `POST /v1/webhooks` `{"url": "https://...", "events": ["server.created"]}` → secret `whsec_...` once. - `DELETE /v1/webhooks/{id}`, `POST /v1/webhooks/{id}/test` (event `ping`), `GET /v1/webhooks/{id}/deliveries` (last 50). - At most 10 webhooks. https only, public addresses only. - Events: `server.created`, `server.running`, `server.stopped`, `server.deleted`, `server.restored`, `server.frozen`, `server.unfrozen`, `server.reinstalled`, `server.error`, `server.startup_finished`, `snapshot.ready`, `balance.credited`, `balance.topped_up`, `balance.low`, `withdrawal.*`, `ticket.answered`, `approval.approved`, `approval.denied`, `monitoring.alert`, `monitoring.resolved`, `ping`; `*` for all. The list in force: `available_events` of `GET /v1/webhooks`. - Request: POST, body `{"id": "evt_...", "event": "...", "created_at": "...", "data": {...}}`, headers `X-0x-Event`, `X-0x-Delivery` (`whd_...`), `X-0x-Signature: t=,v1=`. - Signature: `hex(hmac_sha256(secret, t + "." + body))` must equal `v1`. Reject requests with an old `t`. - Success: a 2xx answer within 8 seconds. Redirects are not followed. Retries: after 1 minute, 5 minutes, 30 minutes, 2 hours, 12 hours: 6 attempts in all. ## MCP `POST https://0x.cloud/v1/mcp`: Streamable HTTP without sessions, JSON-RPC 2.0, plain JSON answers. Authorization: an API key or OAuth access token in `Authorization: Bearer`. Without it: 401 with `WWW-Authenticate: Bearer realm="0x.cloud API", resource_metadata="https://0x.cloud/.well-known/oauth-protected-resource"`. GET: 405. Discovery: `https://0x.cloud/.well-known/mcp.json`; registry entry: `https://0x.cloud/server.json`. Methods: `initialize`, `notifications/initialized`, `ping`, `tools/list`, `tools/call`, `resources/list`, `resources/read` (`0x://docs/rules`, `0x://docs/api`, `0x://docs/first-server`). The `instructions` of `initialize` state the spend rule of the key. Tools (`tools/list` returns only those the key's scopes allow): - Start: `get_overview` (call it first), `get_my_activity`, `get_key_info`, `set_server_note`. - Account and money: `get_account`, `update_profile`, `list_sessions`, `get_balance`, `list_transactions`, `list_topups`, `list_payment_methods`, `create_topup`, `list_withdrawals`, `get_withdrawal`, `request_withdrawal`, `list_notifications`, `mark_notifications_read`, `get_referrals`, `transfer_referral_balance`. - Keys: `list_api_keys`, `create_api_key`, `update_api_key` (name only), `revoke_api_key`. - Catalogue: `list_plans`, `list_images`, `list_locations`. - Servers: `list_servers`, `get_server`, `get_server_capabilities`, `get_server_network`, `get_server_metrics`, `get_server_history`, `wait_server`, `create_server`, `request_manual_server`, `rename_server`, `server_power`, `resize_server`, `get_password`, `reset_password`, `reinstall_server`, `mount_iso`, `eject_iso`, `freeze_server`, `unfreeze_server`, `cancel_at_period_end`, `delete_server`, `restore_server`, `set_server_ttl`, `get_console_url`. - Firewall and monitoring: `get_firewall`, `set_firewall`, `request_port25`, `get_monitoring`, `set_monitoring`, `list_alerts`. - Inside the server (root, no SSH): `run_command` (with `session`, `cwd`, `background`, `env`), `get_command`, `get_job`, `list_jobs`, `stop_job`, `read_file`, `write_file`, `edit_file`, `list_directory`, `search_files`, `authorize_ssh_key`, `get_server_health`. - Waiting and approvals: `wait_for_event`, `request_approval`, `get_approval`, `list_approvals`. - Backups: `list_backups`, `enable_backups`, `disable_backups`, `set_backup_schedule`, `create_backup`, `restore_backup`. - Snapshots: `list_snapshots`, `create_snapshot`, `rename_snapshot`, `delete_snapshot`, `restore_snapshot`. - SSH keys: `list_ssh_keys`, `add_ssh_key`, `delete_ssh_key`. - Support: `list_tickets`, `get_ticket`, `create_ticket`, `reply_ticket`, `close_ticket`. - Webhooks: `list_webhooks`, `create_webhook`, `delete_webhook`, `test_webhook`, `list_webhook_deliveries`. Each tool runs the matching API method with the key's scopes and spend limit. `create_server`, `resize_server` and `enable_backups` take `"dry_run": true`: the exact price without a charge. For `create_server` the dry run also returns the `pricing_fingerprint` required for 10 minutes: after explicit consent pass it unchanged in the call without `dry_run`. For `is_auto_provision: false` use `request_manual_server` with `accept_manual_issue: true` and the fingerprint after the same quote and consent. On `409 price_changed` stop, show `error.quote`, get new consent, never create automatically; after an unknown outcome only the exact same call with the same fingerprint and `idempotency_key` may be repeated. `delete_server`, `reinstall_server`, `freeze_server`, `restore_backup`, `restore_snapshot` and `delete_snapshot` need `"confirm": true`. Every tool is annotated (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`). Refusals carry `agent_hint`. Result: `{"content": [{"type": "text", "text": ""}], "isError": false}` and the same object in `structuredContent`; on an API error `isError` is true and the text has `http_status` and `error`. ## Status `GET /v1/public/status` (no key): overall `status`, `components` (site, account area, API, MCP, Frankfurt), `services`, `sales.enabled`, `incidents` (open and recent, UTC). Page: https://0x.cloud/status, RSS: https://0x.cloud/status/rss. ## Vote for the next location `GET /v1/public/votes`: options, totals and your vote. `POST /v1/public/votes` `{"country": "NL"}`: vote or change your vote; authorization needed.