Price floor Every GPU at least 30% below the market median — re-checked against the marketplace weekly.

See the proof

Developers · Python SDK

Python SDK: GPUs as a context manager

The same package as the CLI, importable: typed dataclasses over the REST API, sensible retries, and a context manager that guarantees the meter stops when your block exits — even on exceptions.

Install

pip install powergpu            # Python ≥3.10, zero heavy deps
export POWERGPU_API_KEY=pg_live_…

Sixty seconds of SDK

core flow
import powergpu

client = powergpu.Client()                     # reads POWERGPU_API_KEY

# the public price sheet — no key needed for this call
for g in client.gpus():
    print(g.slug, g.price.on_demand)

# find capacity and deploy
offer = client.offers(gpu="rtx-4090", num_min=1)[0]
inst  = client.instances.create(
    machine_id=offer.machine_id,
    template="pytorch",
    disk_gb=60,
    type="interruptible",
)
inst.wait("running")
print(inst.hostname, inst.price_hr)

inst.stop()                                    # billing ends this second

Disposable GPUs, guaranteed

The pattern that saves real money: the context manager destroys the instance on exit, including when your code raises.

context manager
with client.ephemeral(gpu="a100-sxm4", template="axolotl",
                      volume="ckpts:/ckpts") as gpu:
    gpu.exec("axolotl train qlora.yml")        # streams output
    gpu.download("/ckpts/adapter", "./out")    # billed at $0.01/GB
# ← destroyed here, success or crash — no forgotten $2/hr instances

Async & fleets

parallel render farm in 12 lines
import asyncio, powergpu

async def frame(n: int):
    async with powergpu.AsyncClient().ephemeral(
            gpu="rtx-4090", template="blender",
            volume="scene:/scene:ro") as gpu:
        await gpu.exec(f"blender -b /scene/shot.blend -f {n}")

# 8 frames in parallel — per-second billing makes this cost the same
asyncio.run(asyncio.gather(*[frame(n) for n in range(1, 9)]))

Errors & retries

  • HTTP 429/5xx retry with exponential backoff (configurable, off for POST by default);
  • API errors raise powergpu.APIError carrying .code and .message straight from the error table;
  • business rules (low balance, machine gone) raise DeployError — catch it, top up, retry.

Typing

Fully typed (py.typed marker): editors autocomplete offers, instances and prices; mypy passes on strict. Dataclasses mirror the JSON of the REST API field for field, so the API reference doubles as the SDK reference.

Deploy your first GPU in under a minute

Top up in crypto, benchmark us against your current provider. Per-second billing, fixed prices ≥ 30% below market — cancel by just stopping the instance.