{"openapi":"3.1.0","info":{"title":"Tensor API","version":"1.0.0","description":"GPU rental marketplace API. Agents authenticate with `Authorization: Bearer gph_…` API keys. Keys are scoped, and any key with instances:write must have a 24h spending limit. Spending is capped by that limit and by the account's credit balance; unrestricted automatic spending is not possible."},"servers":[{"url":"https://tensor.expert"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Tensor API key (gph_…)"},"session":{"type":"apiKey","in":"cookie","name":"gpuhub_session"}}},"paths":{"/api/gpus":{"get":{"summary":"List rentable GPU listings with prices (credits/hour) and filter facets","x-required-scope":"gpus:read","security":[{},{"apiKey":[]}],"parameters":[{"name":"type","in":"query","required":false,"description":"gpu|cpu (omit for both)","schema":{"type":"string"}},{"name":"minVcpu","in":"query","required":false,"description":"int","schema":{"type":"string"}},{"name":"brand","in":"query","required":false,"description":"NVIDIA|AMD","schema":{"type":"string"}},{"name":"model","in":"query","required":false,"description":"substring","schema":{"type":"string"}},{"name":"minVram","in":"query","required":false,"description":"int GB","schema":{"type":"string"}},{"name":"maxPrice","in":"query","required":false,"description":"credits/hour","schema":{"type":"string"}},{"name":"region","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"availability","in":"query","required":false,"description":"AVAILABLE|LIMITED|UNAVAILABLE","schema":{"type":"string"}},{"name":"provider","in":"query","required":false,"description":"provider slug","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"price_asc|price_desc|vram_desc|perf_desc","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/gpus/{id}":{"get":{"summary":"Get one GPU listing","x-required-scope":"gpus:read","security":[{},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/agent/compare":{"get":{"summary":"Rank available offers by price, price per VRAM-GB or price per FP16 TFLOP","x-required-scope":"gpus:read","security":[{},{"apiKey":[]}],"parameters":[{"name":"minVram","in":"query","required":false,"description":"int","schema":{"type":"string"}},{"name":"maxPricePerHour","in":"query","required":false,"description":"number","schema":{"type":"string"}},{"name":"rankBy","in":"query","required":false,"description":"price|price_per_vram|price_per_tflop","schema":{"type":"string"}},{"name":"includeSimulated","in":"query","required":false,"description":"true|false","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1-50","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/instances":{"post":{"summary":"Rent a GPU. Requires Idempotency-Key header. Reserves credits, then provisions.","x-required-scope":"instances:write","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"8-128 chars; retries with the same key never double-provision or double-charge","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listingId":{"description":"string (required)"},"name":{"description":"string"},"image":{"description":"container image"}}}}}},"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}},"get":{"summary":"List your instances","x-required-scope":"instances:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"active|all","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/instances/{id}":{"get":{"summary":"Instance details, connection info (owner only) and billed usage","x-required-scope":"instances:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/instances/{id}/refresh":{"post":{"summary":"Reconcile instance state with the provider now","x-required-scope":"instances:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/instances/{id}/metrics":{"get":{"summary":"Live GPU/CPU utilization from the provider","x-required-scope":"instances:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/instances/{id}/stop":{"post":{"summary":"Gracefully stop and release the instance (billing ends)","x-required-scope":"instances:write","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/instances/{id}/terminate":{"post":{"summary":"Terminate immediately (billing ends)","x-required-scope":"instances:write","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/wallet":{"get":{"summary":"Balance, reserved credits, totals","x-required-scope":"billing:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/wallet/transactions":{"get":{"summary":"Ledger entries (cursor paginated)","x-required-scope":"billing:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"type","in":"query","required":false,"description":"ledger type","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"id","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1-200","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/usage":{"get":{"summary":"Daily spend series and billed usage records","x-required-scope":"billing:read","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"name":"days","in":"query","required":false,"description":"1-365","schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/wallet/deposit":{"post":{"summary":"Verify an on-chain deposit (if enabled) or claim dev test credits (development only)","security":[{"session":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"description":"CRYPTO|DEV_FAUCET"},"txHash":{"description":"0x… (CRYPTO)"},"amount":{"description":"number (DEV_FAUCET)"}}}}}},"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/api-keys":{"get":{"summary":"List API keys","security":[{"session":[]}],"parameters":[],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}},"post":{"summary":"Create an API key (secret shown once)","security":[{"session":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"string"},"scopes":{"description":"string[]"},"dailySpendLimit":{"description":"credits|null (required for instances:write)"},"maxConcurrentInstances":{"description":"int"},"expiresInDays":{"description":"int|null"}}}}}},"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}},"/api/api-keys/{id}":{"delete":{"summary":"Revoke an API key","security":[{"session":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success. Monetary amounts are decimal strings in credits (1 credit = 1 USD)."},"4XX":{"description":"Error: { error: { code, message, details? } }"}}}}}}