Endpoint reference.
Every /v1 endpoint. Base URL: https://api.demo.gpu.ai/v1. Cross-cutting behaviors (auth, errors, pagination, idempotency, rate limits) live in Conventions.
§ 04.1Catalog¶
Public, no auth required. Use these to discover what GPU types are available and at what price before you provision.
/v1/gpu-typesSCOPE · noneList every GPU type the marketplace knows about. Paginated.
Response item shape
gpu_typestringrequiredh100_sxm).vram_gbintegerrequiredarchitecturestringcurl https://api.demo.gpu.ai/v1/gpu-types{
"data": [
{
"gpu_type": "h100_sxm",
"vram_gb": 80,
"architecture": "Hopper"
},
{
"gpu_type": "a100_80gb",
"vram_gb": 80,
"architecture": "Ampere"
}
],
"next_cursor": null
}/v1/pricingSCOPE · nonePricing per GPU type, region, and tier (on_demand or spot), with live availability counts.
curl https://api.demo.gpu.ai/v1/pricing{
"data": [
{
"gpu_type": "h100_sxm",
"region": "US",
"tier": "on_demand",
"price_per_hour": 2.99,
"available": 14
}
],
"next_cursor": null
}§ 04.2SSH Keys¶
Manage the SSH public keys installed on instances at boot. You need at least one before launching an instance. Scope: ssh_keys: read for reads, ssh_keys: write for writes.
/v1/ssh-keysSCOPE · ssh_keys: readList your registered SSH keys. Paginated.
curl https://api.demo.gpu.ai/v1/ssh-keys \
-H "Authorization: Bearer gpuai_live_..."{
"data": [
{
"id": "sshkey_01HX...",
"name": "laptop",
"fingerprint": "SHA256:abc123...",
"created_at": "2026-05-08T17:41:42Z"
}
],
"next_cursor": null
}/v1/ssh-keysSCOPE · ssh_keys: writeRegister a new SSH public key. Requires Idempotency-Key.
Request body
namestringrequiredpublic_keystringrequiredssh-ed25519 AAAAC3Nz...). Server validates format and rejects malformed keys.curl -X POST https://api.demo.gpu.ai/v1/ssh-keys \
-H "Authorization: Bearer gpuai_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"name": "laptop",
"public_key": "ssh-ed25519 AAAAC3Nz... me@laptop"
}'{
"id": "sshkey_01HX...",
"name": "laptop",
"fingerprint": "SHA256:abc123...",
"created_at": "2026-05-08T17:41:42Z"
}/v1/ssh-keys/{id}SCOPE · ssh_keys: writeDelete an SSH key. Idempotent — deleting an already-gone key returns 404 not_found, not an error.
curl -X DELETE https://api.demo.gpu.ai/v1/ssh-keys/sshkey_01HX... \
-H "Authorization: Bearer gpuai_live_..."§ 04.3Instances¶
Provision and manage GPU instances. Scope: instances: read / write.
/v1/instancesSCOPE · instances: readList your instances. Paginated.
curl "https://api.demo.gpu.ai/v1/instances?limit=25" \
-H "Authorization: Bearer gpuai_live_..."{
"data": [
{
"id": "ins_01HX...",
"name": "training-run-42",
"status": "running",
"gpu_type": "h100_sxm",
"gpu_count": 1,
"region": "US",
"tier": "on_demand",
"price_per_hour": 2.99,
"reservation_id": null,
"connection": {
"hostname": "ssh.gpu.ai",
"port": 10042,
"ssh_command": "ssh -p 10042 user@ssh.gpu.ai"
},
"created_at": "2026-05-08T17:00:00Z",
"ready_at": "2026-05-08T17:01:30Z"
}
],
"next_cursor": null
}reservation_id is null for on_demand and spot instances; for reserved instances it carries the parent contract’s ID — same value as the reservation_id in GET /v1/reservations.
/v1/instancesSCOPE · instances: writeCreate an instance. Returns 202 with Operation-Id. Requires Idempotency-Key.
Request body
gpu_typestringrequired/v1/gpu-types.gpu_countintegerrequiredtierstringrequiredon_demand, spot, or reserved. reserved requires your org to hold an active reservation contract for the requested GPU type and region — see Reservations below. Contact sales to set one up.ssh_key_idsstring[]regionstringnamestringmax_price_per_hournumbercurl -X POST https://api.demo.gpu.ai/v1/instances \
-H "Authorization: Bearer gpuai_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"gpu_type": "h100_sxm",
"gpu_count": 1,
"tier": "on_demand",
"ssh_key_ids": ["sshkey_01HX..."],
"name": "training-run-42"
}'
# 202 Accepted
# Operation-Id: 5f1b8a9c-0d1e-2f3a-4b5c-6d7e8f9a0b1c// Operation-Id: 5f1b8a9c-0d1e-2f3a-4b5c-6d7e8f9a0b1c
{
"operation_id": "5f1b8a9c-0d1e-2f3a-4b5c-6d7e8f9a0b1c",
"kind": "instance.create",
"state": "pending",
"resource_id": null,
"created_at": "2026-05-08T17:00:00Z",
"updated_at": "2026-05-08T17:00:00Z",
"completed_at": null
}Reserved-tier error codes
reservation/no_contract403tier: "on_demand" or contact sales.reservation/contract_inactive403reservation/gpu_type_mismatch400gpu_type (or no slot in the requested region matches it).reservation/no_capacity429tier: "on_demand" for the overage. There is no automatic fallback in v1.ssh_keys/org_mismatch403ssh_key_ids belongs to a different org than the caller. Applies to every tier, not just reserved./v1/instances/{id}SCOPE · instances: readFetch a single instance by ID.
curl https://api.demo.gpu.ai/v1/instances/ins_01HX... \
-H "Authorization: Bearer gpuai_live_..."/v1/instances/{id}SCOPE · instances: writeUpdate an instance. In v1 the only mutable field is name.
curl -X PATCH https://api.demo.gpu.ai/v1/instances/ins_01HX... \
-H "Authorization: Bearer gpuai_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"name": "training-run-43"}'/v1/instances/{id}SCOPE · instances: writeTerminate an instance. Async, returns 202 with an Operation-Id. Idempotent — deleting an already-terminated instance returns 404 not_found.
curl -X DELETE https://api.demo.gpu.ai/v1/instances/ins_01HX... \
-H "Authorization: Bearer gpuai_live_..." \
-H "Idempotency-Key: $(uuidgen)"
# 202 Accepted
# Operation-Id: 5f1b... (poll until terminated)§ 04.4Reservations¶
Surfaces the reserved-capacity contracts your org holds, along with live utilization and the instances currently running under each. Reservations are ops-onboarded — there is no self-serve checkout in v1; sales closes the contract and ops provisions the entitlement. Once a contract exists, provisioning against it uses the standard POST /v1/instances endpoint with tier: "reserved". Scope: instances: read.
/v1/reservationsSCOPE · instances: readList your org’s reservation contracts. Returns an array of contract objects with term, status, utilization, the commitment lines, and the active instances pinned to each. Commercial terms (monthly fee, payment schedule, upstream provider) are intentionally omitted — you already have those from the signed contract.
Response item shape
reservation_idstringrequiredreservation_id on instance responses.titlestringrequiredstarts_atISO 8601requiredends_atISO 8601requiredstatusstringrequiredpending, active, suspended, expired, cancelled. Only active accepts new tier: "reserved" provisioning.renewal.modestringrequiredauto_renew, manual, or none.renewal.days_until_endintegerrequiredends_at.renewal.expiring_soonbooleanrequiredtrue when days_until_end ≤ 14.commitment[]arrayrequiredgpu_type, gpu_count, region.utilization.allocated_gpusintegerrequiredutilization.committed_gpusintegerrequiredutilization.pctnumberrequiredallocated_gpus / committed_gpus (0.0–1.0).instances[]arrayrequiredinstance_id, hostname, gpu_count, status.curl https://api.demo.gpu.ai/v1/reservations \
-H "Authorization: Bearer gpuai_live_..."[
{
"reservation_id": "01HX9ZS6AB1234CONTRACT0001",
"title": "ACME Q3 H100",
"starts_at": "2026-07-01T00:00:00Z",
"ends_at": "2026-10-01T00:00:00Z",
"status": "active",
"renewal": {
"mode": "manual",
"days_until_end": 47,
"expiring_soon": false
},
"commitment": [
{ "gpu_type": "h100_sxm", "gpu_count": 8, "region": "us-west-2" }
],
"utilization": {
"allocated_gpus": 5,
"committed_gpus": 8,
"pct": 0.625
},
"instances": [
{
"instance_id": "ins_01HX...",
"hostname": "gpu-4a7f.gpu.ai",
"gpu_count": 4,
"status": "running"
},
{
"instance_id": "ins_01HY...",
"hostname": "gpu-c1d2.gpu.ai",
"gpu_count": 1,
"status": "booting"
}
]
}
][]§ 04.5Operations¶
Async writes (instance create/delete) return an Operation pointer that you poll until terminal. Scope: instances: read.
| State | Meaning |
|---|---|
pending | Accepted, not yet started. Initial state. |
in_progress | Worker is actively executing. resource_id may now be populated. |
succeeded | Terminal. The resource is in its target state. |
failed | Terminal. See error for detail. |
cancelled | Terminal. Caller aborted (rare in v1). |
/v1/operations/{id}SCOPE · instances: readFetch an operation by its UUID. Operations are scoped to the API key that created them — cross-key access returns 404 not_found.
Suggested polling: backoff 1s → 2s → 4s → 8s → 16s → 30s. Operations typically complete in 30–90s for instance creates.
curl https://api.demo.gpu.ai/v1/operations/5f1b8a9c-... \
-H "Authorization: Bearer gpuai_live_..."{
"operation_id": "5f1b8a9c-...",
"kind": "instance.create",
"state": "in_progress",
"resource_id": "ins_01HX...",
"created_at": "2026-05-08T17:00:00Z",
"updated_at": "2026-05-08T17:00:35Z",
"completed_at": null
}{
"operation_id": "5f1b8a9c-...",
"state": "succeeded",
"resource_id": "ins_01HX...",
"completed_at": "2026-05-08T17:01:30Z",
...
}{
"operation_id": "5f1b8a9c-...",
"state": "failed",
"error": {
"code": "operation_failed",
"detail": "All suppliers rejected the placement"
},
...
}§ 04.6Usage¶
Time-bucketed GPU usage and cost. Scope: billing: read. Defaults to a 30-day window when start/end are omitted.
/v1/usageSCOPE · billing: readQuery parameters
bucketstringhour, day, week, month. Default depends on window length.group_bystringinstance_id or gpu_type.startISO 8601endISO 8601cursor / limitstandardcurl "https://api.demo.gpu.ai/v1/usage?bucket=day&group_by=gpu_type" \
-H "Authorization: Bearer gpuai_live_..."{
"data": [
{
"bucket_start": "2026-05-07T00:00:00Z",
"gpu_type": "h100_sxm",
"gpu_seconds": 86400,
"cost_cents": 7176
},
{
"bucket_start": "2026-05-08T00:00:00Z",
"gpu_type": "h100_sxm",
"gpu_seconds": 43200,
"cost_cents": 3588
}
],
"next_cursor": null
}