gpu.nz

gpu.nz API

A REST API for renting GPU servers in rubles or dollars: search offers, rent, manage servers, check the balance and keep API keys. It works the same from curl, Python, JavaScript, CI and AI agents.

Base URL
https://gpu.nz/api/v1

Quickstart

Five steps from a key to a running server. Examples in curl, Python and JavaScript.

  1. 01Get a key

    Create one in the console: Keys → API keys. Or run gpunz login and the key is issued for you.

    export GPUNZ_API_KEY="gpz_…"
  2. 02Find a server

    GET /offers with filters: model, GPU count, country, price. Results are sorted by price.

    curl -X GET \
      'https://gpu.nz/api/v1/offers?gpu=rtx-4090-24gb&order=price&limit=5'
  3. 03Rent it

    POST /instances with an Idempotency-Key header. A repeat with the same key does not create a second server.

    curl -X POST 'https://gpu.nz/api/v1/instances' \
      -H "Authorization: Bearer $GPUNZ_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
      "offer_id": "o_4Jx9Q2",
      "template": "pytorch-cuda12",
      "disk_gb": 40,
      "name": "trainer"
    }'
  4. 04Connect

    When the status becomes running, the response carries a ready ssh command and the web interface links.

    curl -X GET 'https://gpu.nz/api/v1/instances/i_8f2KQ1xZ' \
      -H "Authorization: Bearer $GPUNZ_API_KEY"
  5. 05Stop or destroy

    POST /instances/{id}/stop stops it: only the disk is billed. DELETE /instances/{id} destroys it for good.

    curl -X POST 'https://gpu.nz/api/v1/instances/i_8f2KQ1xZ/stop' \
      -H "Authorization: Bearer $GPUNZ_API_KEY"
    curl -X DELETE 'https://gpu.nz/api/v1/instances/i_8f2KQ1xZ' \
      -H "Authorization: Bearer $GPUNZ_API_KEY"

For AI agents and tools

Plain-text docs for language models: /llms.txt (summary) and /llms-full.txt (full reference). OpenAPI 3.1 schema: /api/v1/openapi.json.

What to know about servers

The same model works through the API and the console.

Connect over SSH

Create a key once. On Windows open PowerShell; on macOS and Linux open Terminal:

ssh-keygen -t ed25519

Copy the contents of id_ed25519.pub and add it in settings or when you launch a server.

When the server is running, copy the command from its page:

ssh -p PORT USER@HOST

The key is added to new servers only. To open a server port on your machine, add a forward:

ssh -L 8888:localhost:8888 \
  -p PORT USER@HOST

ComfyUI, Jupyter and other interfaces

Templates with a web interface open with the Open button on the server page. The link contains an access token: do not share it, because anyone with it can open the server without a password. Jupyter uses HTTPS with the server's certificate, so your browser may warn about an insecure connection. That is expected.

Upload and download files

From your machine to the server and back, with scp or rsync:

scp -P PORT ./data.zip \
  USER@HOST:/workspace/
rsync -avP -e 'ssh -p PORT' \
  ./data/ USER@HOST:/workspace/data/

To pull models from Hugging Face, download straight to the server with huggingface-cli download. Inbound and outbound traffic is billed at the rate shown on the server card.

How not to overpay

  • A stopped server costs only its disk storage, usually a few cents an hour. Stop it during breaks.
  • Deleting a server erases its data for good. Download your results first.
  • We warn you when the balance covers about 24 hours, 3 hours, 1 hour and 15 minutes. At zero the servers and their data are deleted, so download your results in time.
  • A stopped server may fail to restart if another customer takes the GPU on that host. Your data is kept.

Full reference for every endpoint · write to support