{"components":{"parameters":{"CursorParam":{"in":"query","name":"cursor","schema":{"type":"string"}},"IdempotencyKeyHeader":{"in":"header","name":"Idempotency-Key","schema":{"maxLength":255,"type":"string"}},"LimitParam":{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}}},"requestBodies":{"CreateInstance":{"content":{"application/json":{"schema":{"properties":{"gpu_count":{"maximum":8,"minimum":1,"type":"integer"},"gpu_type":{"type":"string"},"max_price_per_hour":{"format":"double","type":"number"},"name":{"type":"string"},"region":{"type":"string"},"ssh_key_ids":{"items":{"type":"string"},"type":"array"},"tier":{"enum":["spot","on_demand"],"type":"string"}},"required":["gpu_type","gpu_count","tier"],"type":"object"}}},"required":true}},"responses":{"GPUTypePage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GPUTypePage"}}},"description":"OK"},"InstancePage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstancePage"}}},"description":"OK"},"PricingPage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingPage"}}},"description":"OK"},"Problem":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Error response (RFC 7807)"},"RateLimited":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait.","headers":{"Retry-After":{"description":"Seconds the client should wait before retrying.","schema":{"minimum":1,"type":"integer"}}}},"SSHKeyPage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSHKeyPage"}}},"description":"OK"},"UsagePage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsagePage"}}},"description":"OK"},"WebhookEndpointPage":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPage"}}},"description":"OK"}},"schemas":{"GPUType":{"properties":{"architecture":{"type":"string"},"gpu_type":{"type":"string"},"vram_gb":{"type":"integer"}},"required":["gpu_type","vram_gb"],"type":"object"},"GPUTypePage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/GPUType"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"type":"object"},"Instance":{"properties":{"connection":{"nullable":true,"properties":{"hostname":{"type":"string"},"port":{"type":"integer"},"ssh_command":{"type":"string"}},"type":"object"},"created_at":{"format":"date-time","type":"string"},"gpu_count":{"maximum":8,"minimum":1,"type":"integer"},"gpu_type":{"type":"string"},"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"price_per_hour":{"format":"double","type":"number"},"ready_at":{"format":"date-time","nullable":true,"type":"string"},"region":{"type":"string"},"status":{"enum":["creating","provisioning","booting","running","stopping","stopped","terminated","error"],"type":"string"},"terminated_at":{"format":"date-time","nullable":true,"type":"string"},"tier":{"enum":["spot","on_demand"],"type":"string"}},"required":["id","status","gpu_type","gpu_count","region","tier","price_per_hour","created_at"],"type":"object"},"InstancePage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Instance"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"type":"object"},"Operation":{"properties":{"completed_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"error":{"nullable":true,"properties":{"code":{"type":"string"},"detail":{"type":"string"}},"type":"object"},"kind":{"enum":["instance.create","instance.delete"],"type":"string"},"operation_id":{"format":"uuid","type":"string"},"resource_id":{"nullable":true,"type":"string"},"state":{"enum":["pending","in_progress","succeeded","failed","cancelled"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["operation_id","kind","state","created_at"],"type":"object"},"Pricing":{"properties":{"available":{"description":"count of available units","type":"integer"},"gpu_type":{"type":"string"},"price_per_hour":{"format":"double","type":"number"},"region":{"type":"string"},"tier":{"enum":["spot","on_demand"],"type":"string"}},"required":["gpu_type","region","tier","price_per_hour","available"],"type":"object"},"PricingPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Pricing"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"type":"object"},"Problem":{"properties":{"code":{"enum":["unauthenticated","invalid_api_key","insufficient_scope","not_found","idempotency_conflict","idempotency_mismatch","validation_failed","invalid_gpu_type","insufficient_balance","quota_exceeded","rate_limited","internal_error","operation_failed"],"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"},"status":{"type":"integer"},"title":{"type":"string"},"type":{"format":"uri","type":"string"}},"required":["type","title","status","detail","code","request_id"],"type":"object"},"SSHKey":{"properties":{"created_at":{"format":"date-time","type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name","fingerprint","created_at"],"type":"object"},"SSHKeyPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SSHKey"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"type":"object"},"UsageBucket":{"properties":{"bucket_start":{"format":"date-time","type":"string"},"cost_cents":{"type":"integer"},"gpu_seconds":{"type":"integer"},"gpu_type":{"nullable":true,"type":"string"},"instance_id":{"nullable":true,"type":"string"}},"required":["bucket_start","gpu_seconds","cost_cents"],"type":"object"},"UsagePage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/UsageBucket"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"type":"object"},"WebhookEndpoint":{"properties":{"created_at":{"format":"date-time","type":"string"},"enabled":{"type":"boolean"},"event_types":{"items":{"enum":["instance.creating","instance.running","instance.terminated","instance.failed"],"type":"string"},"type":"array"},"id":{"format":"uuid","type":"string"},"secret":{"description":"Returned ONLY at creation; subsequent reads omit.","type":"string"},"url":{"format":"uri","type":"string"}},"required":["id","url","event_types","enabled","created_at"],"type":"object"},"WebhookEndpointPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookEndpoint"},"type":"array"},"next_cursor":{"nullable":true,"type":"string"}},"required":["data","next_cursor"],"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"gpuai_live_\u003c24-base62\u003e","scheme":"bearer","type":"http"}}},"info":{"contact":{"email":"support@gpu.ai","name":"GPU.ai Support"},"description":"Programmatic API for GPU.ai. Authenticate with API keys minted from\nthe dashboard. See https://gpu.ai/docs for details.\n","title":"GPU.ai Public Developer API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/gpu-types":{"get":{"parameters":[{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/LimitParam"}],"responses":{"200":{"$ref":"#/components/responses/GPUTypePage"},"default":{"$ref":"#/components/responses/Problem"}},"security":[],"summary":"List available GPU types (no auth required)"}},"/health":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"status":{"const":"ok","type":"string"}},"type":"object"}}},"description":"OK"}},"security":[],"summary":"Liveness probe"}},"/instances":{"get":{"parameters":[{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/LimitParam"}],"responses":{"200":{"$ref":"#/components/responses/InstancePage"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"List instances"},"post":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"$ref":"#/components/requestBodies/CreateInstance"},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"Accepted; long-running operation","headers":{"Operation-Id":{"description":"Use GET /operations/{id} to poll","schema":{"type":"string"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Create an instance (async — returns 202 + Operation-Id header)"}},"/instances/{id}":{"delete":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"Accepted; termination in progress","headers":{"Operation-Id":{"schema":{"type":"string"}}}},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Already gone — idempotent terminate (D-07)"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Terminate an instance (idempotent)"},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}},"description":"OK"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get an instance"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"patch":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"}},"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}},"description":"OK"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Update an instance (rename only in v1)"}},"/openapi.json":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OK"}},"security":[],"summary":"OpenAPI 3.1 specification"}},"/operations/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"}}},"description":"OK"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get an async operation status"}},"/pricing":{"get":{"responses":{"200":{"$ref":"#/components/responses/PricingPage"},"default":{"$ref":"#/components/responses/Problem"}},"security":[],"summary":"List pricing per GPU type + region (no auth required)"}},"/ssh-keys":{"get":{"parameters":[{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/LimitParam"}],"responses":{"200":{"$ref":"#/components/responses/SSHKeyPage"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"List SSH keys"},"post":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"type":"string"},"public_key":{"type":"string"}},"required":["name","public_key"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSHKey"}}},"description":"Created"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Create an SSH key"}},"/ssh-keys/{id}":{"delete":{"responses":{"204":{"description":"Deleted"},"404":{"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Already deleted (idempotent)"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Delete an SSH key (idempotent — 404 on already-gone per D-07)"},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSHKey"}}},"description":"OK"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get an SSH key"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]},"/usage":{"get":{"parameters":[{"in":"query","name":"bucket","schema":{"enum":["hour","day","week","month"],"type":"string"}},{"in":"query","name":"group_by","schema":{"enum":["instance_id","gpu_type"],"type":"string"}},{"in":"query","name":"start","schema":{"format":"date-time","type":"string"}},{"in":"query","name":"end","schema":{"format":"date-time","type":"string"}},{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/LimitParam"}],"responses":{"200":{"$ref":"#/components/responses/UsagePage"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Time-bucketed usage"}},"/webhook-endpoints":{"get":{"parameters":[{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/LimitParam"}],"responses":{"200":{"$ref":"#/components/responses/WebhookEndpointPage"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"List webhook endpoints"},"post":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKeyHeader"}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"event_types":{"items":{"enum":["instance.creating","instance.running","instance.terminated","instance.failed"],"type":"string"},"type":"array"},"url":{"format":"uri","type":"string"}},"required":["url","event_types"],"type":"object"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"Created"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Create a webhook endpoint"}},"/webhook-endpoints/{id}":{"delete":{"responses":{"204":{"description":"Deleted"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Delete a webhook endpoint"},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}},"description":"OK"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Problem"}},"summary":"Get a webhook endpoint"},"parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}]}},"security":[{"bearerAuth":[]}],"servers":[{"description":"Production","url":"https://api.gpu.ai/v1"},{"description":"Demo","url":"https://api.demo.gpu.ai/v1"}]}