Reference

REST API

JSON over HTTPS for scripts and AI agents. Every endpoint below is also described in the machine-readable OpenAPI 3.1 document.

Conventions

  • Authenticate with Authorization: Bearer gph_…. Keys are limited to their scopes.
  • Amounts are decimal strings in credits, e.g. "1.725000" (1 credit = 1 USD).
  • POST /api/instances requires an Idempotency-Key header. Retrying with the same key returns the same instance and never charges twice.
  • Requests are rate limited. A 429 response includes a Retry-After header.

Errors use one shape:

json
{ "error": { "code": "INSUFFICIENT_FUNDS", "message": "Insufficient credits to start this instance", "details": { ... } } }

Example: rent and stop a GPU

bash
# 1. Find the cheapest GPU with at least 24 GB VRAM
curl -s -H "Authorization: Bearer $TENSOR_API_KEY" \
  "https://<host>/api/agent/compare?minVram=24&rankBy=price&limit=3"

# 2. Rent it (idempotent)
curl -s -X POST https://<host>/api/instances \
  -H "Authorization: Bearer $TENSOR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"listingId":"<listingId>","name":"training-run"}'

# 3. Poll until status is RUNNING
curl -s -H "Authorization: Bearer $TENSOR_API_KEY" https://<host>/api/instances/<id>

# 4. Stop it (billing ends, unused hold released)
curl -s -X POST -H "Authorization: Bearer $TENSOR_API_KEY" https://<host>/api/instances/<id>/stop

Endpoints

get/api/gpus

List rentable GPU listings with prices (credits/hour) and filter facets

Auth: Public (API key optional)Scope: gpus:read
?type
gpu|cpu (omit for both)
?minVcpu
int
?brand
NVIDIA|AMD
?model
substring
?minVram
int GB
?maxPrice
credits/hour
?region
string
?availability
AVAILABLE|LIMITED|UNAVAILABLE
?provider
provider slug
?sort
price_asc|price_desc|vram_desc|perf_desc
get/api/gpus/{id}

Get one GPU listing

Auth: Public (API key optional)Scope: gpus:read
get/api/agent/compare

Rank available offers by price, price per VRAM-GB or price per FP16 TFLOP

Auth: Public (API key optional)Scope: gpus:read
?minVram
int
?maxPricePerHour
number
?rankBy
price|price_per_vram|price_per_tflop
?includeSimulated
true|false
?limit
1-50
post/api/instances

Rent a GPU. Requires Idempotency-Key header. Reserves credits, then provisions.

Auth: Session or API keyScope: instances:writeIdempotent
listingId
string (required)
name
string
image
container image
get/api/instances

List your instances

Auth: Session or API keyScope: instances:read
?status
active|all
get/api/instances/{id}

Instance details, connection info (owner only) and billed usage

Auth: Session or API keyScope: instances:read
post/api/instances/{id}/refresh

Reconcile instance state with the provider now

Auth: Session or API keyScope: instances:read
get/api/instances/{id}/metrics

Live GPU/CPU utilization from the provider

Auth: Session or API keyScope: instances:read
post/api/instances/{id}/stop

Gracefully stop and release the instance (billing ends)

Auth: Session or API keyScope: instances:writeIdempotent
post/api/instances/{id}/terminate

Terminate immediately (billing ends)

Auth: Session or API keyScope: instances:writeIdempotent
get/api/wallet

Balance, reserved credits, totals

Auth: Session or API keyScope: billing:read
get/api/wallet/transactions

Ledger entries (cursor paginated)

Auth: Session or API keyScope: billing:read
?type
ledger type
?cursor
id
?limit
1-200
get/api/usage

Daily spend series and billed usage records

Auth: Session or API keyScope: billing:read
?days
1-365
post/api/wallet/deposit

Verify an on-chain deposit (if enabled) or claim dev test credits (development only)

Auth: Browser session only
method
CRYPTO|DEV_FAUCET
txHash
0x… (CRYPTO)
amount
number (DEV_FAUCET)
get/api/api-keys

List API keys

Auth: Browser session only
post/api/api-keys

Create an API key (secret shown once)

Auth: Browser session only
name
string
scopes
string[]
dailySpendLimit
credits|null (required for instances:write)
maxConcurrentInstances
int
expiresInDays
int|null
delete/api/api-keys/{id}

Revoke an API key

Auth: Browser session only