{"openapi":"3.1.0","jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","info":{"title":"gpu.nz API","version":"1.0.0","summary":"Rent GPU servers in rubles: API v1","description":"The gpu.nz REST API: search servers, rent, manage, balance, SSH keys and API keys.\n\nAuthentication: `Authorization: Bearer gpz_…`. Create a key in the console (Keys page) or run `gpunz login`.\nMoney is whole kopecks (`*_kop`); hourly prices are kopecks per hour (`*_kop_h`); currency RUB.\nLists: `?limit=` (default 50, max 200) and `?cursor=` from `next_cursor`.\nRate limits: 120 requests per minute per key, 60 per minute per address without a key. See `X-RateLimit-*` headers."},"servers":[{"url":"https://gpu.nz/api/v1","description":"Production"}],"tags":[{"name":"account","description":"Profile, balance and transactions","x-displayName":"Account"},{"name":"catalog","description":"GPUs, offers and templates","x-displayName":"Catalog"},{"name":"ssh","description":"Keys for server access","x-displayName":"SSH keys"},{"name":"instances","description":"Rental, control and logs","x-displayName":"Instances"},{"name":"keys","description":"Issue and revoke keys","x-displayName":"API keys"},{"name":"auth","description":"Device flow for gpunz login","x-displayName":"Terminal login"},{"name":"meta","description":"API schema","x-displayName":"Meta"}],"security":[],"paths":{"/me":{"get":{"operationId":"me","tags":["account"],"summary":"Current user","description":"Profile of the key owner.","security":[{"bearerAuth":["user:read"]}],"responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/balance":{"get":{"operationId":"balance","tags":["account"],"summary":"Balance and burn rate","description":"Balance, available amount, burn rate per hour, and how many hours the money lasts at the current burn.","security":[{"bearerAuth":["billing:read"]}],"responses":{"200":{"description":"Balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/transactions":{"get":{"operationId":"transactions","tags":["account"],"summary":"Account transactions","description":"Top-ups, rental and traffic charges, bonuses. Newest first.","security":[{"bearerAuth":["billing:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"How many rows to return (1–200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Cursor from the previous page's next_cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of transactions","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/gpus":{"get":{"operationId":"gpus","tags":["catalog"],"summary":"GPU models","description":"All GPU models with free GPU count and the cheapest price per card. Public, CORS enabled.","security":[],"responses":{"200":{"description":"Models","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GpuModel"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}}}}},"/offers":{"get":{"operationId":"offers","tags":["catalog"],"summary":"Search offers","description":"Servers available to rent, with filters and sorting. Prices are for the whole server, kopecks per hour. Public.\n\nOnly offers available right now are listed. Page with next_cursor, not offsets.","security":[],"parameters":[{"name":"gpu","in":"query","required":false,"description":"Comma-separated model slugs","schema":{"type":"string","example":"rtx-4090-24gb,rtx-3090-24gb"}},{"name":"num_gpus","in":"query","required":false,"description":"GPUs per server: 1,2,4,8 (comma-separated)","schema":{"type":"string","example":"1,2"}},{"name":"min_gpus","in":"query","required":false,"description":"Minimum GPUs per server","schema":{"type":"integer","minimum":1}},{"name":"type","in":"query","required":false,"description":"on_demand (default) or interruptible","schema":{"type":"string","enum":["on_demand","interruptible"]}},{"name":"country","in":"query","required":false,"description":"ISO-2 country codes, comma-separated","schema":{"type":"string","example":"DE,NL"}},{"name":"min_reliability","in":"query","required":false,"description":"Reliability from 0 to 1","schema":{"type":"number","minimum":0,"maximum":1}},{"name":"min_vram_gb","in":"query","required":false,"description":"Minimum VRAM per GPU, GB","schema":{"type":"number","minimum":0}},{"name":"max_price_kop_h","in":"query","required":false,"description":"At most this many kopecks per hour (whole server, for the chosen type)","schema":{"type":"integer","minimum":0}},{"name":"verified","in":"query","required":false,"description":"Verified datacenters only","schema":{"type":"boolean"}},{"name":"min_cuda","in":"query","required":false,"description":"Minimum CUDA version, e.g. 12.4","schema":{"type":"number"}},{"name":"min_disk_gb","in":"query","required":false,"description":"Minimum disk, GB","schema":{"type":"number","minimum":0}},{"name":"min_inet_down_mbps","in":"query","required":false,"description":"Minimum download, Mbit/s","schema":{"type":"number","minimum":0}},{"name":"order","in":"query","required":false,"description":"price (default), -price, dlperf, dlperf_per_price, reliability, vram, inet_down","schema":{"type":"string","enum":["price","-price","dlperf","dlperf_per_price","reliability","vram","inet_down"]}},{"name":"limit","in":"query","required":false,"description":"How many rows to return (1–200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Cursor from the previous page's next_cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of offers","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/offers/{id}":{"get":{"operationId":"offer","tags":["catalog"],"summary":"One offer","description":"Full specification and prices. Public.","security":[],"parameters":[{"name":"id","in":"path","required":true,"description":"offer id","schema":{"type":"string"}}],"responses":{"200":{"description":"Offer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Offer"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"operationId":"templates","tags":["catalog"],"summary":"Templates","description":"The template catalogue. With a key, your own templates are included (owner = me).","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"templateCreate","tags":["catalog"],"summary":"Create an own template","description":"Your own Docker image with ports and variables. Visible only to you. Limit: 20 templates.","security":[{"bearerAuth":["instances:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"},"example":{"name":"My trainer","image":"ghcr.io/me/trainer:1.2","ports":[7860],"min_disk_gb":40}}}},"responses":{"201":{"description":"Created template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The state does not allow it: price changed, already destroying, limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates/{slug}":{"delete":{"operationId":"templateDelete","tags":["catalog"],"summary":"Delete an own template","description":"Hides the template. Instances already created from it keep running.","security":[{"bearerAuth":["instances:write"]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"Template slug","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ssh-keys":{"get":{"operationId":"sshList","tags":["ssh"],"summary":"SSH keys","description":"Keys attached to new instances.","security":[{"bearerAuth":["user:read"]}],"responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SshKey"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sshCreate","tags":["ssh"],"summary":"Add an SSH key","description":"A public key from the .pub file. Never send a private key.","security":[{"bearerAuth":["user:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKeyCreate"},"example":{"name":"laptop","public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAc6078X+m8JF6aSSsBQjeBTnWzC726H37M3DAbeLVMg you@laptop"}}}},"responses":{"201":{"description":"Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SshKey"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ssh-keys/{id}":{"delete":{"operationId":"sshDelete","tags":["ssh"],"summary":"Delete an SSH key","description":"New instances will not get the key. Running ones are not changed.","security":[{"bearerAuth":["user:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"SSH key id","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/instances":{"get":{"operationId":"instancesList","tags":["instances"],"summary":"Instances","description":"Your instances. By default only live ones (not destroyed).","security":[{"bearerAuth":["instances:read"]}],"parameters":[{"name":"status","in":"query","required":false,"description":"active (default) or all","schema":{"type":"string","enum":["active","all"]}},{"name":"limit","in":"query","required":false,"description":"How many rows to return (1–200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Cursor from the previous page's next_cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of instances","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Instance"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"instanceCreate","tags":["instances"],"summary":"Create an instance","description":"Quotes the offer, locks the price and creates the instance. Send an Idempotency-Key header: a repeat with the same key does not create a second instance and returns the existing one (200).\n\n402 insufficient_funds: details.short_kop is how many kopecks are missing for the 2-hour runway.\n\n403 forbidden with details.reason = email_not_verified: confirm your e-mail in the account.\n\nInterruptible instance: type: interruptible. When the price rises it becomes outbid (GPU not billed); start places a new bid.","security":[{"bearerAuth":["instances:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique request key, up to 64 characters","schema":{"type":"string","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceCreate"},"example":{"offer_id":"o_4Jx9Q2","template":"pytorch-cuda12","disk_gb":40,"name":"trainer"}}}},"responses":{"200":{"description":"Repeat request: the same instance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}},"headers":{"Idempotent-Replayed":{"description":"true on a repeat","schema":{"type":"string"}}}},"201":{"description":"Instance created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_funds`: Not enough money for 2 hours of runtime. details.short_kop is how much","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The state does not allow it: price changed, already destroying, limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`provider_unavailable`: Temporary service unavailability. Retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/instances/{id}":{"get":{"operationId":"instanceGet","tags":["instances"],"summary":"Instance","description":"State, access and cost of an instance.","security":[{"bearerAuth":["instances:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"instance id","schema":{"type":"string"}}],"responses":{"200":{"description":"Instance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"instancePatch","tags":["instances"],"summary":"Rename an instance","description":"Only the name changes.","security":[{"bearerAuth":["instances:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"instance id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstancePatch"},"example":{"name":"trainer-2"}}}},"responses":{"200":{"description":"Instance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"instanceDestroy","tags":["instances"],"summary":"Destroy","description":"Irreversible: the disk and its data are removed. Status becomes destroying, then destroyed.","security":[{"bearerAuth":["instances:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"instance id","schema":{"type":"string"}}],"responses":{"200":{"description":"Instance (destroying)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The state does not allow it: price changed, already destroying, limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/instances/{id}/start":{"post":{"operationId":"instanceStart","tags":["instances"],"summary":"Start","description":"Starts a stopped instance. Requires a balance covering 2 hours of runtime.","security":[{"bearerAuth":["instances:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"instance id","schema":{"type":"string"}}],"responses":{"200":{"description":"Instance (status catches up shortly)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`insufficient_funds`: Not enough money for 2 hours of runtime. details.short_kop is how much","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The state does not allow it: price changed, already destroying, limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/instances/{id}/stop":{"post":{"operationId":"instanceStop","tags":["instances"],"summary":"Stop","description":"Stops the instance. Only the disk is billed while stopped.","security":[{"bearerAuth":["instances:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"instance id","schema":{"type":"string"}}],"responses":{"200":{"description":"Instance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The state does not allow it: price changed, already destroying, limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/instances/{id}/logs":{"get":{"operationId":"instanceLogs","tags":["instances"],"summary":"Logs","description":"Last lines of the startup log.","security":[{"bearerAuth":["instances:read"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"instance id","schema":{"type":"string"}},{"name":"tail","in":"query","required":false,"description":"How many lines (1–1000, default 200)","schema":{"type":"integer","minimum":1,"maximum":1000}}],"responses":{"200":{"description":"Lines","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstanceLogs"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`provider_unavailable`: Temporary service unavailability. Retry later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api-keys":{"get":{"operationId":"keysList","tags":["keys"],"summary":"API keys","description":"Your active keys (no secrets).","security":[{"bearerAuth":["user:read"]}],"responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"next_cursor":{"type":["string","null"],"description":"Cursor for the next page, or null"}}}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"keysCreate","tags":["keys"],"summary":"Create a key","description":"The secret is returned only in this response. You cannot grant permissions your key does not have.","security":[{"bearerAuth":["user:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"},"example":{"name":"CI","scopes":["instances:read","instances:write"],"expires_in_days":90}}}},"responses":{"201":{"description":"Key with its secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`conflict`: The state does not allow it: price changed, already destroying, limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api-keys/{id}":{"delete":{"operationId":"keysDelete","tags":["keys"],"summary":"Revoke a key","description":"The key stops working at once. You may revoke the key you are using.","security":[{"bearerAuth":["user:write"]}],"parameters":[{"name":"id","in":"path","required":true,"description":"key id","schema":{"type":"string"}}],"responses":{"204":{"description":"Revoked"},"401":{"description":"`unauthorized`: No key, or the key is wrong, revoked or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: The key lacks the scope, or the account is blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: Not found, or it belongs to someone else","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/device":{"post":{"operationId":"deviceStart","tags":["auth"],"summary":"Terminal login: start","description":"Issues a device_code for the CLI and a short user_code for the browser. Codes live 10 minutes. Used by gpunz login.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Optional: client name","properties":{"client_name":{"type":"string","maxLength":60,"description":"For example, \"laptop\"","example":"laptop"}}},"example":{"client_name":"laptop"}}}},"responses":{"200":{"description":"Codes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCode"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/device/token":{"post":{"operationId":"deviceToken","tags":["auth"],"summary":"Terminal login: get the key","description":"The CLI polls every interval seconds until the user approves the code in the browser. The key is issued once.\n\nWhile waiting: 400 authorization_pending. Polling too fast: 400 slow_down (increase the interval).","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"},"example":{"device_code":"b1JQ3m7kZxR9aY2pD5sU8wE0tG4hK6nL1cV3fB7oM2i"}}}},"responses":{"200":{"description":"Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceToken"}}}},"400":{"description":"`authorization_pending`: Device flow: waiting for approval in the browser\n\n`slow_down`: Device flow: polling too often\n\n`access_denied`: Device flow: denied in the browser\n\n`expired_token`: Device flow: the code expired or was already used","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: Invalid input. details.issues lists the fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: Too many requests. Retry-After says when to retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"`internal`: Internal error. Retry later; the request id helps support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"gpz_<40 base62 characters>","description":"API key gpz_…"}},"schemas":{"Error":{"description":"Error: stable code, human message, optional details","type":"object","properties":{"error":{"type":"object","description":"Error object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","validation_error","insufficient_funds","conflict","rate_limited","provider_unavailable","internal","authorization_pending","slow_down","access_denied","expired_token"],"description":"Machine-readable code"},"message":{"type":"string","description":"Message in the language of Accept-Language"},"details":{"type":"object","description":"Extra details, e.g. field issues"}},"required":["code","message"]}},"required":["error"],"example":{"error":{"code":"insufficient_funds","message":"Insufficient funds: 120 RUB short. Top up your balance.","details":{"short_kop":12000}}}},"User":{"description":"Profile of the key owner","type":"object","properties":{"id":{"type":"string","description":"User id","example":"u_01J9Z3K2Q7"},"email":{"type":["string","null"],"description":"E-mail, null when not set","example":"you@example.com"},"name":{"type":"string","description":"Display name","example":"Egor"},"created_at":{"type":"string","format":"date-time","description":"Registration time","example":"2026-10-10T12:00:00.000Z"},"two_factor":{"type":"boolean","description":"Two-factor auth enabled","example":false},"email_verified":{"type":"boolean","description":"E-mail is verified","example":true},"telegram_linked":{"type":"boolean","description":"Telegram is linked","example":false}},"required":["id","name","created_at"],"example":{"id":"u_01J9Z3K2Q7","email":"you@example.com","name":"Egor","created_at":"2026-09-01T10:00:00.000Z","two_factor":false,"email_verified":true,"telegram_linked":false}},"Balance":{"description":"Balance in kopecks; burn rate in kopecks per hour","type":"object","properties":{"balance_kop":{"type":"integer","description":"Cash plus bonus, kopecks","example":250000},"available_kop":{"type":"integer","description":"Available now, including accrued but not yet posted usage","example":241250},"credit_limit_kop":{"type":"integer","description":"Credit limit","example":0},"burn_kop_h":{"type":"integer","description":"Total burn across all instances, kopecks per hour","example":4120},"runway_hours":{"type":["number","null"],"description":"Hours left at the current burn (null when idle)","example":58.5},"currency":{"type":"string","enum":["RUB"],"description":"Currency","example":"RUB"}},"example":{"balance_kop":250000,"available_kop":241250,"credit_limit_kop":0,"burn_kop_h":4120,"runway_hours":58.5,"currency":"RUB"}},"Transaction":{"description":"Wallet ledger entry","type":"object","properties":{"id":{"type":"string","description":"Transaction id","example":"t_01J9Z4"},"at":{"type":"string","format":"date-time","description":"When it happened","example":"2026-10-10T12:00:00.000Z"},"type":{"type":"string","enum":["topup","usage","bandwidth","refund","promo_grant","promo_expire","adjustment","writeoff","reversal"],"description":"Kind of operation","example":"usage"},"amount_kop":{"type":"integer","description":"Balance change: positive is credit, negative is debit","example":-1850},"description":{"type":"string","description":"Human description","example":"Instance rental"},"instance_id":{"type":["string","null"],"description":"Related instance id, if any","example":"i_8f2KQ1xZ"}},"example":{"id":"t_01J9Z4","at":"2026-10-10T11:00:00.000Z","type":"usage","amount_kop":-1850,"description":"Instance rental","instance_id":"i_8f2KQ1xZ"}},"GpuModel":{"description":"GPU model with current supply","type":"object","properties":{"slug":{"type":"string","description":"Model slug, used in the gpu= filter","example":"rtx-4090-24gb"},"name":{"type":"string","description":"Display name","example":"RTX 4090"},"vram_gb":{"type":"integer","description":"VRAM per GPU, GB","example":24},"tier":{"type":"string","enum":["consumer","workstation","datacenter","legacy"],"description":"Class","example":"consumer"},"available_gpus":{"type":"integer","description":"GPUs available right now","example":42},"from_kop_h":{"type":["integer","null"],"description":"Cheapest on-demand price per GPU, kopecks per hour","example":2650},"from_interruptible_kop_h":{"type":["integer","null"],"description":"Cheapest interruptible price per GPU, kopecks per hour","example":1190}},"example":{"slug":"rtx-4090-24gb","name":"RTX 4090","vram_gb":24,"tier":"consumer","available_gpus":42,"from_kop_h":2650,"from_interruptible_kop_h":1190}},"Offer":{"description":"Offer: a server configuration with its price","type":"object","properties":{"id":{"type":"string","description":"Offer id (used in POST /instances)","example":"o_4Jx9Q2"},"available":{"type":"boolean","description":"Can be rented right now","example":true},"verified":{"type":"boolean","description":"Verified datacenter","example":true},"country":{"type":["string","null"],"description":"Country, ISO-2","example":"DE"},"region":{"type":["string","null"],"description":"Region","example":"Hesse"},"gpu":{"type":"object","description":"GPU","properties":{"slug":{"type":"string","description":"Model slug","example":"rtx-4090-24gb"},"name":{"type":"string","description":"Name","example":"RTX 4090"},"count":{"type":"integer","description":"GPUs in the server","example":2},"vram_gb":{"type":"integer","description":"VRAM per GPU, GB","example":24},"total_tflops":{"type":["number","null"],"description":"Compute, TFLOPS (whole server)","example":165.2},"mem_bw_gbs":{"type":["integer","null"],"description":"Memory bandwidth, GB/s","example":1008}}},"cpu":{"type":"object","description":"CPU","properties":{"name":{"type":["string","null"],"description":"Model","example":"AMD EPYC 7543"},"cores":{"type":["integer","null"],"description":"Cores","example":16}}},"ram_gb":{"type":["integer","null"],"description":"System RAM, GB","example":128},"disk":{"type":"object","description":"Disk","properties":{"max_gb":{"type":["integer","null"],"description":"Max size, GB","example":1500},"bw_mbps":{"type":["integer","null"],"description":"Speed, MB/s","example":2400},"name":{"type":"null","description":"Reserved"}}},"network":{"type":"object","description":"Network","properties":{"up_mbps":{"type":["integer","null"],"description":"Upload, Mbit/s","example":900},"down_mbps":{"type":["integer","null"],"description":"Download, Mbit/s","example":950},"ports":{"type":["integer","null"],"description":"Directly reachable ports","example":4}}},"pcie":{"type":"object","description":"PCIe","properties":{"gen":{"type":["integer","null"],"description":"Generation","example":4},"bw_gbs":{"type":["number","null"],"description":"Bandwidth, GB/s","example":31.5}}},"cuda_max":{"type":["number","null"],"description":"Highest CUDA version","example":12.8},"driver":{"type":["string","null"],"description":"Driver version","example":"550.120"},"reliability":{"type":["number","null"],"description":"Reliability, 0–1","example":0.9987},"max_duration_days":{"type":["integer","null"],"description":"Days left in the host contract","example":120},"dlperf":{"type":["number","null"],"description":"Deep-learning performance index","example":88.4},"price":{"type":"object","description":"Prices for the whole server (all GPUs), kopecks","properties":{"on_demand_kop_h":{"type":"integer","description":"On-demand, kopecks per hour (with base disk)","example":5280},"interruptible_kop_h":{"type":["integer","null"],"description":"Interruptible, kopecks per hour","example":2380},"storage_kop_gb_month":{"type":"integer","description":"Extra disk, kopecks per GB-month","example":900},"traffic_kop_gb":{"type":"integer","description":"Traffic, kopecks per GB","example":0}}}},"required":["id","available","gpu","price"],"example":{"id":"o_4Jx9Q2","available":true,"verified":true,"country":"DE","region":"Hesse","gpu":{"slug":"rtx-4090-24gb","name":"RTX 4090","count":2,"vram_gb":24,"total_tflops":165.2,"mem_bw_gbs":1008},"cpu":{"name":"AMD EPYC 7543","cores":16},"ram_gb":128,"disk":{"max_gb":1500,"bw_mbps":2400,"name":null},"network":{"up_mbps":900,"down_mbps":950,"ports":4},"pcie":{"gen":4,"bw_gbs":31.5},"cuda_max":12.8,"driver":"550.120","reliability":0.9987,"max_duration_days":120,"dlperf":88.4,"price":{"on_demand_kop_h":5280,"interruptible_kop_h":2380,"storage_kop_gb_month":900,"traffic_kop_gb":0}}},"Template":{"description":"Template: image and launch mode","type":"object","properties":{"slug":{"type":"string","description":"Slug (used in template=)","example":"pytorch-cuda12"},"name":{"type":"string","description":"Name","example":"PyTorch + CUDA 12"},"description":{"type":"string","description":"Description","example":"PyTorch 2.5 with CUDA 12.4 and Jupyter"},"image":{"type":"string","description":"Docker image","example":"pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime"},"launch_mode":{"type":"string","enum":["ssh","jupyter","entrypoint"],"description":"Launch mode","example":"ssh"},"ports":{"type":"array","items":{"type":"integer"},"description":"Container ports","example":[8888]},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables","example":{}},"onstart":{"type":["string","null"],"description":"Command run at start","example":null},"min_disk_gb":{"type":"integer","description":"Minimum disk, GB","example":20},"recommended_disk_gb":{"type":"integer","description":"Recommended disk, GB","example":40},"public":{"type":"boolean","description":"Visible to everyone","example":true},"owner":{"type":"string","enum":["gpunz","me"],"description":"gpunz for the catalogue, me for your own template","example":"gpunz"}},"example":{"slug":"pytorch-cuda12","name":"PyTorch + CUDA 12","description":"PyTorch 2.5 with CUDA 12.4 and Jupyter","image":"pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime","launch_mode":"ssh","ports":[8888],"env":{},"onstart":null,"min_disk_gb":20,"recommended_disk_gb":40,"public":true,"owner":"gpunz"}},"TemplateCreate":{"description":"Own template","type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":60,"description":"Name","example":"My trainer"},"description":{"type":"string","maxLength":500,"description":"Description","example":"Training image"},"image":{"type":"string","description":"Docker image with a tag","example":"ghcr.io/me/trainer:1.2"},"launch_mode":{"type":"string","enum":["ssh","jupyter","entrypoint"],"description":"Launch mode (default ssh)","example":"ssh"},"ports":{"type":"array","items":{"type":"integer","minimum":1,"maximum":65535},"maxItems":10,"description":"Ports to publish","example":[7860]},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables (up to 30)","example":{"HF_HOME":"/workspace/hf"}},"onstart":{"type":"string","maxLength":4000,"description":"Command run at start","example":"python serve.py"},"min_disk_gb":{"type":"integer","minimum":10,"maximum":2000,"description":"Minimum disk","example":40},"recommended_disk_gb":{"type":"integer","minimum":10,"maximum":2000,"description":"Recommended disk","example":80}},"required":["name","image"],"example":{"name":"My trainer","description":"Training image","image":"ghcr.io/me/trainer:1.2","launch_mode":"ssh","ports":[7860],"env":{"HF_HOME":"/workspace/hf"},"onstart":"python serve.py","min_disk_gb":40,"recommended_disk_gb":80}},"SshKey":{"description":"Public SSH key","type":"object","properties":{"id":{"type":"string","description":"Key id","example":"k_9Qw1Zm"},"name":{"type":"string","description":"Name","example":"laptop"},"type":{"type":"string","description":"Key type","example":"ssh-ed25519"},"fingerprint":{"type":"string","description":"SHA256 fingerprint","example":"SHA256:5mkcWNm+GX3XK8EbRD+A6ieMSHyFHC0ysCe5CgbJRLM"},"created_at":{"type":"string","format":"date-time","description":"Added","example":"2026-10-10T12:00:00.000Z"}},"example":{"id":"k_9Qw1Zm","name":"laptop","type":"ssh-ed25519","fingerprint":"SHA256:5mkcWNm+GX3XK8EbRD+A6ieMSHyFHC0ysCe5CgbJRLM","created_at":"2026-09-01T10:00:00.000Z"}},"SshKeyCreate":{"description":"New SSH key","type":"object","properties":{"name":{"type":"string","maxLength":60,"description":"Name (optional)","example":"laptop"},"public_key":{"type":"string","description":"Line from the .pub file","example":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI… you@laptop"}},"required":["public_key"],"example":{"name":"laptop","public_key":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAc6078X+m8JF6aSSsBQjeBTnWzC726H37M3DAbeLVMg you@laptop"}},"Instance":{"description":"Instance (rental)","type":"object","properties":{"id":{"type":"string","description":"Instance id","example":"i_8f2KQ1xZ"},"name":{"type":["string","null"],"description":"Name","example":"trainer"},"status":{"type":"string","enum":["creating","starting","running","stopping","stopped","destroying","destroyed","failed","outbid"],"description":"Current state","example":"running"},"desired_state":{"type":"string","enum":["running","stopped","destroyed"],"description":"Where it is heading","example":"running"},"type":{"type":"string","enum":["on_demand","interruptible"],"description":"Rental type","example":"on_demand"},"gpu":{"type":"object","description":"GPU","properties":{"slug":{"type":"string","description":"Model slug","example":"rtx-4090-24gb"},"name":{"type":"string","description":"Name","example":"RTX 4090"},"count":{"type":"integer","description":"Count","example":1},"vram_gb":{"type":["integer","null"],"description":"VRAM per GPU, GB","example":24}}},"template":{"type":"object","description":"Template","properties":{"slug":{"type":"string","description":"Slug","example":"pytorch-cuda12"},"name":{"type":"string","description":"Name","example":"PyTorch + CUDA 12"}}},"image":{"type":"string","description":"Docker image","example":"pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime"},"disk_gb":{"type":"integer","description":"Disk, GB","example":40},"country":{"type":["string","null"],"description":"Country, ISO-2","example":"DE"},"price":{"type":"object","description":"Prices, kopecks per hour","properties":{"running_kop_h":{"type":"integer","description":"While running","example":2640},"stopped_kop_h":{"type":"integer","description":"While stopped (disk only)","example":24},"traffic_kop_gb":{"type":"integer","description":"Traffic, kopecks per GB","example":0}}},"cost_so_far_kop":{"type":"integer","description":"Charged so far, kopecks","example":1850},"ssh":{"type":["object","null"],"description":"SSH access (null until the port is assigned)","properties":{"host":{"type":"string","description":"Host","example":"203.0.113.10"},"port":{"type":"integer","description":"Port","example":40122},"user":{"type":"string","description":"User","example":"root"},"command":{"type":"string","description":"Ready-to-run command","example":"ssh -p 40122 root@203.0.113.10"}}},"urls":{"type":"array","description":"Web interfaces of the template","items":{"type":"object","properties":{"label":{"type":"string","description":"Label","example":"8888"},"url":{"type":["string","null"],"description":"URL (null while not ready)","example":"http://203.0.113.10:41001/"}}}},"created_at":{"type":"string","format":"date-time","description":"Created","example":"2026-10-10T12:00:00.000Z"},"started_at":{"type":["string","null"],"format":"date-time","description":"First time running","example":"2026-10-10T11:02:00.000Z"},"stop_reason":{"type":["string","null"],"description":"Why it stopped: user, low_balance, admin, provider","example":"user"}},"required":["id","status","type","gpu","price"],"example":{"id":"i_8f2KQ1xZ","name":"trainer","status":"running","desired_state":"running","type":"on_demand","gpu":{"slug":"rtx-4090-24gb","name":"RTX 4090","count":1,"vram_gb":24},"template":{"slug":"pytorch-cuda12","name":"PyTorch + CUDA 12"},"image":"pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime","disk_gb":40,"country":"DE","price":{"running_kop_h":2640,"stopped_kop_h":24,"traffic_kop_gb":0},"cost_so_far_kop":1850,"ssh":{"host":"203.0.113.10","port":40122,"user":"root","command":"ssh -p 40122 root@203.0.113.10"},"urls":[{"label":"8888","url":"http://203.0.113.10:41001/"}],"created_at":"2026-10-10T11:00:00.000Z","started_at":"2026-10-10T11:02:00.000Z","stop_reason":null}},"InstanceCreate":{"description":"Parameters of a new instance","type":"object","properties":{"offer_id":{"type":"string","description":"Offer id from GET /offers","example":"o_4Jx9Q2"},"template":{"type":"string","description":"Template slug","example":"pytorch-cuda12"},"disk_gb":{"type":"integer","minimum":10,"maximum":2000,"description":"Disk, GB","example":40},"name":{"type":"string","maxLength":60,"description":"Name","example":"trainer"},"ssh_key_ids":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"Keys (default: all of yours)","example":["k_9Qw1Zm"]},"type":{"type":"string","enum":["on_demand","interruptible"],"description":"Type (default on_demand)","example":"on_demand"},"image":{"type":"string","description":"Docker image, only for the custom template","example":"pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime"},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Not supported yet: send an empty object or omit it","example":{}},"onstart":{"type":"string","description":"Not supported yet: send null or omit it","example":null}},"required":["offer_id","template","disk_gb"],"example":{"offer_id":"o_4Jx9Q2","template":"pytorch-cuda12","disk_gb":40,"name":"trainer","ssh_key_ids":["k_9Qw1Zm"],"type":"on_demand"}},"InstancePatch":{"description":"Instance changes","type":"object","properties":{"name":{"type":["string","null"],"maxLength":60,"description":"New name (null clears it)","example":"trainer-2"}},"required":["name"],"example":{"name":"trainer-2"}},"InstanceLogs":{"description":"Last log lines of the instance","type":"object","properties":{"lines":{"type":"array","items":{"type":"string"},"description":"Lines","example":["Starting container…","Ready."]}},"example":{"lines":["Starting container…","Ready."]}},"ApiKey":{"description":"API key (without the secret)","type":"object","properties":{"id":{"type":"string","description":"Key id","example":"ak_3hT8Lw"},"name":{"type":"string","description":"Name","example":"CI"},"prefix":{"type":"string","description":"Start of the key, for recognition","example":"gpz_3fA9"},"scopes":{"type":"array","items":{"type":"string","enum":["user:read","user:write","instances:read","instances:write","billing:read"]},"description":"Permissions","example":["instances:read","instances:write"]},"source":{"type":"string","enum":["console","cli","api"],"description":"Where it was issued","example":"console"},"last_used_at":{"type":["string","null"],"format":"date-time","description":"Last used","example":"2026-10-10T11:30:00.000Z"},"created_at":{"type":"string","format":"date-time","description":"Created","example":"2026-10-10T12:00:00.000Z"},"expires_at":{"type":["string","null"],"format":"date-time","description":"Expires (null — never)","example":null}},"example":{"id":"ak_3hT8Lw","name":"CI","prefix":"gpz_3fA9","scopes":["instances:read","instances:write"],"source":"console","last_used_at":"2026-10-10T11:30:00.000Z","created_at":"2026-10-01T09:00:00.000Z","expires_at":null}},"ApiKeyCreate":{"description":"New key","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"Name","example":"CI"},"scopes":{"type":"array","minItems":1,"items":{"type":"string","enum":["user:read","user:write","instances:read","instances:write","billing:read"]},"description":"Permissions. You cannot grant more than your key has","example":["instances:read","instances:write"]},"expires_in_days":{"type":["integer","null"],"minimum":1,"maximum":3650,"description":"Lifetime in days (null — no expiry)","example":90}},"required":["name","scopes"],"example":{"name":"CI","scopes":["instances:read","instances:write"],"expires_in_days":90}},"ApiKeyCreated":{"description":"New key with its secret. The secret is shown once","type":"object","properties":{"id":{"type":"string","description":"Key id","example":"ak_3hT8Lw"},"secret":{"type":"string","description":"Secret gpz_… (save it now)","example":"gpz_3fA9xK2mQp7vL0dR8sT4yW1bN6hJ5cE9fG2aZ8kP"},"name":{"type":"string","description":"Name","example":"CI"},"prefix":{"type":"string","description":"Start of the key","example":"gpz_3fA9"},"scopes":{"type":"array","items":{"type":"string"},"description":"Permissions","example":["instances:read","instances:write"]},"source":{"type":"string","description":"Where it was issued","example":"api"},"last_used_at":{"type":["string","null"],"format":"date-time","description":"Last used","example":null},"created_at":{"type":"string","format":"date-time","description":"Created","example":"2026-10-10T12:00:00.000Z"},"expires_at":{"type":["string","null"],"format":"date-time","description":"Expires","example":"2027-01-08T09:00:00.000Z"}},"example":{"id":"ak_3hT8Lw","secret":"gpz_3fA9xK2mQp7vL0dR8sT4yW1bN6hJ5cE9fG2aZ8kP","name":"CI","prefix":"gpz_3fA9","scopes":["instances:read","instances:write"],"source":"api","last_used_at":null,"created_at":"2026-10-10T09:00:00.000Z","expires_at":"2027-01-08T09:00:00.000Z"}},"DeviceCode":{"description":"Device login codes (gpunz login)","type":"object","properties":{"device_code":{"type":"string","description":"Secret for the CLI, never shown to the user","example":"b1JQ3m7kZxR9aY2pD5sU8wE0tG4hK6nL1cV3fB7oM2i"},"user_code":{"type":"string","description":"Code the user confirms in the browser","example":"KQZD-7WXM"},"verification_uri":{"type":"string","description":"Approval page","example":"https://gpu.nz/console/cli/auth"},"verification_uri_complete":{"type":"string","description":"Approval page with the code filled in","example":"https://gpu.nz/console/cli/auth?code=KQZD-7WXM"},"expires_in":{"type":"integer","description":"Lifetime, seconds","example":600},"interval":{"type":"integer","description":"Minimum polling interval, seconds","example":3}},"example":{"device_code":"b1JQ3m7kZxR9aY2pD5sU8wE0tG4hK6nL1cV3fB7oM2i","user_code":"KQZD-7WXM","verification_uri":"https://gpu.nz/console/cli/auth","verification_uri_complete":"https://gpu.nz/console/cli/auth?code=KQZD-7WXM","expires_in":600,"interval":3}},"DeviceTokenRequest":{"description":"Token request by device_code","type":"object","properties":{"device_code":{"type":"string","description":"device_code from POST /auth/device","example":"b1JQ3m7kZxR9aY2pD5sU8wE0tG4hK6nL1cV3fB7oM2i"}},"required":["device_code"],"example":{"device_code":"b1JQ3m7kZxR9aY2pD5sU8wE0tG4hK6nL1cV3fB7oM2i"}},"DeviceToken":{"description":"Issued key (once)","type":"object","properties":{"api_key":{"type":"string","description":"Secret gpz_…","example":"gpz_9Kc2Lw8pQx4Rz1Tn6Vb3Mh7Jd0Fs5Ya2Ge8Xu1Pq"},"key_id":{"type":"string","description":"Key id","example":"ak_5qP2Vm"},"user":{"type":"object","description":"Owner","properties":{"email":{"type":["string","null"],"description":"E-mail","example":"you@example.com"}}}},"example":{"api_key":"gpz_9Kc2Lw8pQx4Rz1Tn6Vb3Mh7Jd0Fs5Ya2Ge8Xu1Pq","key_id":"ak_5qP2Vm","user":{"email":"you@example.com"}}}}}}