GPU rental reference
A rental is two objects:
- A workload describes what to run: the image, the hardware, SSH keys, ports and disk. You can reuse it.
- A deployment is one running instance of a workload. It is billed per minute while it is
ready. Pulling the image and starting up are free, and so is a deployment that fails.
All endpoints live under https://api.green-compute.com and take Authorization: Bearer <key>, except where marked public.
Hardware
| GPU id | VRAM | Price per GPU-hour | Available |
|---|---|---|---|
rtx4090 | 24 GB | $0.40 | yes |
rtx5090 | 32 GB | $0.70 | paused for now |
These are the current figures. The authoritative live source is GET /platform/pricing (public): it is what billing actually uses, and each GPU there carries available_gpus, the number free to rent this instant (the scheduler's own count, net of everything already placed or reserved), with available_now as available_gpus > 0. The rentals page shows the same number.
GET /platform/nodes/supported (public) is the list of GPU ids that have a machine online. A GPU we price but have no machine for is left out, and asking for it fails with a 400. A GPU that is listed but has available_gpus: 0 is merely full: asking for it fails with a 503 no_capacity and a Retry-After, and nothing is created. GPU ids are matched without regard to case or separators, so rtx4090, RTX 4090 and rtx-4090 are the same.
A multi-GPU rental needs its GPUs free on one machine, so 4 free in total does not guarantee a 4-GPU rental: check max_gpus_per_deployment, the most free together on one machine. The 503 says so when that is the reason. Two requests racing for the last GPU can both pass the check; the loser is then retried by the scheduler for about two minutes and fails only if nothing frees up.
RTX 5090 needs a CUDA 12.8+ image. The 5090 is Blackwell (
sm_120). Images built for older CUDA, such aspytorch/pytorch:2.2.0-cuda12.1-*, start fine but fail the moment you use the GPU.pytorch/pytorch:2.7.0-cuda12.8-cudnn9-runtimeworks on both cards.
Create a workload — POST /platform/workloads
{
"name": "my-gpu-box",
"kind": "pod",
"image": "pytorch/pytorch:2.7.0-cuda12.8-cudnn9-runtime",
"requirements": {
"gpu_count": 1,
"supported_gpu_models": ["rtx4090"],
"min_vram_gb_per_gpu": 24,
"cpu_cores": 8,
"memory_gb": 32
},
"metadata": {
"ssh_public_keys": ["ssh-ed25519 AAAA... you@laptop"],
"requested_ports": [8888],
"volume_size_gb": 50,
"command": "python train.py --epochs 3",
"env": { "HF_HOME": "/workspace/hf", "WANDB_API_KEY": "…" }
}
}
| Field | Meaning |
|---|---|
kind | Must be "pod" for a rental. Always send it: when it is missing, the workload is created as a model deployment ("inference"). |
image | Any public Docker image. SSH is injected at start-up, so the image does not need its own SSH server. |
requirements.gpu_count | 1 to 8 GPUs on a single machine. The API schema accepts up to 16, for model deployments that span machines; a rental is always one machine. |
requirements.supported_gpu_models | GPU ids you accept. Leave it empty to accept any; the quoted rate is then the highest. |
requirements.cpu_cores, memory_gb | Capped at the machine's fair share for the number of GPUs you take. |
metadata.ssh_public_keys | Your public keys. They are authorised for root. Recommended: no private key ever has to leave your machine. New to SSH keys? See Create an SSH key. |
metadata.requested_ports | Up to 10 container ports to expose (for example Jupyter on 8888). Their public host ports appear in the deployment's port_mappings. |
metadata.volume_size_gb | Disk for /workspace, 10 to 2000 GB. Default 50. |
metadata.command | Optional. A shell command (or a list of arguments) to run when the pod starts, so a job needs no SSH session. It runs in the background from /workspace once SSH is up, with its output appended to /workspace/greencompute-command.log. The pod keeps running after the command finishes, so set max_runtime_minutes on the deployment, or DELETE it when you're done, to stop paying. Up to 8192 characters. |
metadata.restart_policy | Optional. What happens when metadata.command exits: never (the default) leaves it stopped, on-failure runs it again if it exited with an error, always runs it again whenever it exits. Best run your job in the foreground. If the command starts it with & and returns, use always: the command is run again once everything it started has ended, and nothing it started is ever killed, so two copies never run side by side. Jobs moved away with screen, tmux or setsid can't be followed, so don't combine those with a restart policy. The wait between runs starts at 5 seconds and doubles up to 5 minutes while runs keep ending within a minute. While /workspace/greencompute-command.pause exists the command isn't started or restarted, also after the pod is suspended and resumed; delete the file to start it. Each exit (with its exit code) and restart is written to /workspace/greencompute-command.log, which is cut once it passes 50 MB, keeping the previous part in greencompute-command.log.1. If the container itself stops (out of memory, say), it is restarted and the command starts again, whatever the policy. |
metadata.env | Optional. Environment variables for the pod, as {"NAME": "value"}, up to 64. They are set for the start command and for SSH sessions. Values never appear in API responses, so tokens are safe here. |
The response contains workload_id.
Other workload fields in the API schema (runtime, lifecycle, tags, security_tier, pricing_class) are for model deployments and have no effect on a pod. In particular, lifecycle.shutdown_after_seconds does not stop a pod; use max_runtime_minutes on the deployment instead.
Start it — POST /platform/deployments
{ "workload_id": "…", "max_runtime_minutes": 120 }
| Field | Meaning |
|---|---|
workload_id | The workload to run. |
save_on_exhaustion | Optional. true keeps the pod and its disk if your balance runs out, at $1 per day for up to 30 days, so you can resume it; see Running out of balance. Default false: the pod and its disk are deleted 15 minutes after it stops. |
resume_on_topup | Optional, default false. With save_on_exhaustion, a pod paused for an empty balance is resumed by itself, within a minute of a top-up that covers an hour of everything you would then have running. You get an email when it comes back. Change it later with PATCH /platform/deployments/{id} {"resume_on_topup": true}. |
max_runtime_minutes | Optional. Stops the deployment automatically this many minutes after it became ready, so a crashed or forgotten client can't keep paying. 1 to 43200 (30 days). No limit when omitted. |
name | Optional. Your name for this rental, e.g. rig-07: letters, digits, ., _ and -, up to 48, starting with a letter or digit. The pod sees it as GC_DEPLOYMENT_NAME (and its id as GC_DEPLOYMENT_ID), so a start command can use it as a pool's worker name. Without one, GC_DEPLOYMENT_NAME is the first 8 characters of the id. Use a different name per rental if a pool should tell them apart. Rename with PATCH /platform/deployments/{id} {"name": "…"} ("" removes it): the API shows the new name at once, and the pod gets it the next time it starts (a resume, or a move to another machine); a pod that is running keeps the name it started with. |
The response is the deployment. Fields worth reading:
| Field | Meaning |
|---|---|
deployment_id | Use this for every later call. |
state | See the lifecycle below. |
hourly_rate_cents | Price per GPU-hour, in cents. At creation it is the most this deployment can cost; once a GPU is assigned, it becomes that card's exact rate, which is never higher. |
deployment_fee_usd | Always 0. There is no deployment fee. |
port_mappings | {container_port: public_host_port} once running. |
ready_at | When it first became ready, which is when billing started. |
max_runtime_minutes | The automatic stop you asked for, if any. |
last_error | Set if placement or start-up failed, or why it stopped. |
Starting requires at least one hour of the quoted rate times gpu_count in your balance. Otherwise you get 402 (see Errors).
Retrying a create safely
If a create times out, you can't tell whether it went through. Send an Idempotency-Key header (any unique string up to 255 characters, such as a UUID) on POST /platform/workloads and POST /platform/deployments. Resending the same request with the same key within 24 hours returns the first result, with the response header Idempotent-Replayed: true, instead of renting a second machine. A request that failed (for example with 402) isn't remembered, so you can fix the problem and retry with the same key. Reusing a key with a different body returns 422; a retry that arrives while the first attempt is still running returns 409 with Retry-After.
Lifecycle
pending → scheduled → pulling → starting → ready
│
suspended ◄── (balance ran out)
│
terminated ◄── DELETE, or max_runtime_minutes reached
failed means it could not be placed or started. Read last_error. Poll GET /platform/deployments/{id} every 5–10 seconds; most rentals are ready within one to three minutes.
Fleets
POST /platform/fleets keeps a number of rentals of one workload going, so you don't need a watchdog of your own:
{ "workload_id": "…", "target": 8, "replace": true, "name_prefix": "rig" }
| Field | What it does |
|---|---|
target | How many rentals, 1 to 64. Each is an ordinary deployment, billed as usual. |
replace | true (default): keep target running. Any that stops or fails is replaced, under the same name. false: start target as GPUs free up, then stop; members that end aren't replaced. |
name_prefix | Members are named rig-01, rig-02, …, which the pod sees as GC_DEPLOYMENT_NAME. A replacement takes the name of the one it replaces. Default: from the workload's name. |
max_runtime_minutes, save_on_exhaustion, resume_on_topup | Applied to every member, as on a deployment. |
The fleet checks every 30 seconds. When it can't start one, it waits and says why in status: no GPU free, not enough credit (it starts only as many as your balance covers an hour of, counting what is already running), or the API key's limits. It never replaces a member that is paused because the balance ran out. If three in a row fail before they are ready (a broken image, say), the fleet pauses with the reason; fix the workload, then resume it.
| Call | What it does |
|---|---|
GET /platform/fleets, GET /platform/fleets/{id} | The fleet: running/target, state (active, paused, completed, stopped), status in plain English, and its members. |
PATCH /platform/fleets/{id} {"target": 12} | More starts more; fewer stops the extras, not-yet-ready ones first, then the highest numbers. |
PATCH /platform/fleets/{id} {"paused": true} / false | Pause or resume starting and replacing. Members keep running while paused. |
DELETE /platform/fleets/{id} | Stop the fleet and its rentals; ?keep_running=true stops only the fleet. |
Creating a fleet accepts an Idempotency-Key header, like creating a deployment. On the website, set How many rentals and Keep this many running on the rental form; fleets show at the top of My Rentals.
Running out of balance
When your balance reaches zero, a running pod is suspended: the container stops and its GPU is released, and GPU billing stops. What happens next depends on save_on_exhaustion:
save_on_exhaustion | After suspension |
|---|---|
true | The disk is kept for up to 30 days, billed at $1 per day. Storage keeps being charged even though the balance is empty, so the balance can go negative. Top up and POST /platform/deployments/{id}/resume to restart the pod with its disk intact; resuming needs one hour of balance. After 30 days the pod and its disk are deleted. |
false (default) | The pod and its disk are deleted 15 minutes after suspension. |
While a pod is suspended, its deployment shows storage_cents_per_day (what keeping it costs, 0 if it isn't saved) and deletes_at (when it and its disk will be deleted unless you resume it). Suspended pods are also listed under Paused rentals on the My Rentals page, with Resume and Delete buttons.
Resuming by itself. A saved pod created with resume_on_topup: true (or ticked "Resume it automatically when I add credit" on My Rentals) is resumed for you within a minute of a top-up, once your balance covers an hour of everything that would then be running, oldest pause first, and you are emailed what came back. A pod paused by hand, or a private model paused for being idle, is never resumed this way.
Before it runs out. GET /platform/billing/forecast says what everything running costs per hour and how long your balance lasts at that rate; you are emailed once when that drops under 24 hours and once more under 2 hours. See Adding credit.
DELETE /platform/deployments/{id} deletes the pod and its disk at any time, including a suspended one, and its storage charge stops. Copy anything you need off /workspace first.
Connect — GET /platform/deployments/{id}/ssh
{
"ssh_host": "…",
"ssh_port": 40123,
"ssh_username": "root",
"ssh_command": "ssh root@… -p 40123",
"private_key": "-----BEGIN OPENSSH PRIVATE KEY-----…",
"host_keys": [
{"type": "ssh-ed25519", "key": "ssh-ed25519 AAAAC3…", "fingerprint": "SHA256:A2j3vFHU…"}
],
"known_hosts": ["[…]:40123 ssh-ed25519 AAAAC3…"]
}
A pod becomes ready only once its SSH server is accepting connections, so you can connect the moment you see that state; until then /ssh answers 404. If SSH can't be brought up in your image at all (no apt-get, apk, yum or dnf, or the container exits on start), the deployment fails instead, unbilled, with the reason in last_error.
If you supplied ssh_public_keys, only your keys can log in and private_key is null. If you didn't, the platform generates a key for the pod and private_key holds it: it is returned only by this endpoint, every retrieval is audit-logged, and it never appears in create, get, list or delete responses.
Check the host key
Host ports are reused from one rental to the next, so a port you have used before can now lead to a new pod with a different host key, and ssh then warns REMOTE HOST IDENTIFICATION HAS CHANGED. Rather than turning host-key checking off, check against the keys we publish. host_keys are the pod's own keys, read from the pod once its SSH server is up, and known_hosts has them as ready-made lines for this host and port. Keep one file per rental:
curl -s "$GC_API/platform/deployments/$DEPLOYMENT_ID/ssh" -H "Authorization: Bearer $GC_KEY" \
| jq -r '.known_hosts[]' > ~/.ssh/gc-$DEPLOYMENT_ID.known_hosts
ssh -o UserKnownHostsFile=~/.ssh/gc-$DEPLOYMENT_ID.known_hosts -o StrictHostKeyChecking=yes root@HOST -p PORT
Connecting by hand, compare the fingerprint ssh prints the first time with the one under Host key on the rental's page, or in host_keys. The keys are also on GET /platform/deployments/{id} as ssh_host_keys. Pods started before 30 October 2026 have none listed.
Inside the pod:
- the image's environment is preserved, so
python,condaandCUDA_HOMEbehave as the image defines them, including for one-off commands likessh … python train.py; /workspaceis your persistent disk;nvidia-smishows only the GPUs you rented.
When GPUs are sold out
A create with no room returns 503 with error.code: "no_capacity" and nothing is created. Rather than retrying, either:
- Be told when they are free.
POST /platform/capacity-alertswith{"gpu_model": "rtx4090", "gpu_count": 1, "count": 2}waits for room forcountrentals ofgpu_countGPUs each (that many free on one machine). When there is, you get one email and acapacity.availableevent, and the alert is done. Alerts expire after 7 days; up to 5 can wait at once.GET /platform/capacity-alertslists them andDELETE /platform/capacity-alerts/{id}cancels one. On the website, a sold-out GPU has an Email me when one is free link. - Rent them as they free up. A fleet with
"replace": falsestarts rentals as GPUs become free and stops at its target.
Other calls
| Call | Does |
|---|---|
GET /platform/deployments | Lists your deployments, including stopped ones. Filter with ?state=ready, or several states such as ?state=terminated,failed. |
GET /platform/deployments/{id} | One deployment. |
DELETE /platform/deployments/{id} | Stops it, stops billing and deletes its disk. Returns the deployment with state: "terminated". |
POST /platform/deployments/{id}/resume | Restarts a suspended pod in place, with its disk intact. Needs one hour of balance. |
GET /platform/events | Every change on your account since the last call: ready, failed, suspended, terminated. Or have them sent to you as webhooks: see Events and webhooks. |
GET /platform/deployments/{id}/stats | Live readings while it runs: CPU, memory, network, disk, and for each GPU in gpus its use, memory, temperature, power (power_w against power_limit_w), clocks and fan. {} while there are none. |
POST /platform/deployments/{id}/exec | Runs a shell command in a running rental, as root, from /workspace, without SSH: {"command": "./update.sh", "timeout_seconds": 60}. Returns exit_code and the last 64 KiB of output. We wait at most 120 seconds; a longer command keeps running in the pod (timed_out: true), so start long jobs in the background. Needs the rentals scope. On the website, select rentals on My Rentals to run a command on all of them, or stop them all. |
GET /platform/deployments/{id}/logs?lines=200 | The last lines (up to 2000) of your start command's log and of the container's own output, while it runs. No SSH needed. |
DELETE /platform/workloads/{id} | Deletes the workload definition and the history of its deployments. Your billing history is kept. |
Stopped deployments stay in the list with state: "terminated" until you delete their workload, which removes the workload's deployment history (your billing history is kept).
Checking what you've been charged
| Call | Returns |
|---|---|
GET /platform/billing/balance | Your current balance (balance_usd). |
GET /platform/billing/ledger?limit=50&offset=0 | Your billing history, newest first: each entry has kind (usage, topup, …), amount_cents (negative for charges), balance_after, description and created_at. |
Rental usage is metered about once a minute while a deployment is ready, in proportion to the seconds elapsed, and posted to the ledger in whole cents with any fraction carried forward. So a rental stopped within its first minute may cost nothing, and a fraction of a cent outstanding when you stop is not charged.
Limits
| What | Limit per API key |
|---|---|
| Workload creates | 30 per minute |
| Deployment creates | 30 per minute |
| Resumes | 30 per minute |
| Chat completions, embeddings | 60 per minute |
| Model listing | 60 per minute |
Going over a limit returns 429 with a Retry-After header (seconds) and retry_after_seconds, limit and window_seconds in the body. Reads such as GET /platform/deployments/{id} aren't rate-limited, but polling every 5–10 seconds is plenty.
One GPU machine per deployment; gpu_count up to the machine size (8).
Green Compute