GridPup API
One API key for everything GridPup does: live GPU prices across clouds, what an open model needs to run, GPU machines, and 100+ AI models through an OpenAI-compatible API. The same key works for AI agents through MCP. Base URL: https://api.gridpup.com.
- GPU pricesEvery GPU, offer and price history across clouds, every 15 minutes.Free
- Open modelsThe GPU memory an open model needs and the cheapest machine that runs it now.Free
- MachinesLaunch, connect to and terminate GPU machines.Paid from your balance
- AI modelsChat, images and speech from 100+ models, OpenAI-compatible.Paid from your balance
- TrainingUpload code and data, train on a rented GPU, download what it saved.Paid from your balance
- Balance and spendingYour credit and every charge.Free
- AI agents (MCP)All of the above as tools for Claude, Cursor and other agents.Free
Quick start
- Create a key (log in first) and choose what it may do. Copy it: it is shown once.
- Send it on every request as
Authorization: Bearer gp_live_…
curl -H "Authorization: Bearer $GRIDPUP_API_KEY" \ "https://api.gridpup.com/v1/gpus?sort=cheapest"
import os, requests
r = requests.get(
"https://api.gridpup.com/v1/gpus/nvidia-h100/offers",
params={"in_stock": "true", "sort": "price", "limit": 5},
headers={"Authorization": f"Bearer {os.environ['GRIDPUP_API_KEY']}"},
)
for o in r.json()["items"]:
print(o["provider"], o["usd_per_gpu_hour"], o["stock_state"])Every field and a way to try calls in the browser: api.gridpup.com/docs (OpenAPI: openapi.json).
Keys and access
Each key carries the permissions you choose when you create it:
| Permission | Lets the key | Chosen as |
|---|---|---|
prices:read | GPU prices, offers and history; the open-model catalog; the AI model list | Every key |
machines:read | Your machines and how to connect, templates, live quotes, your SSH keys | “Prices and my machines” or “Launch and manage machines” |
machines:write | Launch, reboot and terminate machines, within the key's own $/hour and machine limits | “Launch and manage machines” |
billing:read | Your balance and spending history | Any key with machines or AI models |
ai:use | AI models, each request paid from your balance | “Also use AI models” |
training:read | Your training projects, runs, logs and outputs | “Also train models” |
training:write | Create projects, upload code and data, start and stop runs, within the key's limit per run | “Also train models” |
- Up to 10 keys per account. Optional expiry. Revoke any key at any time; it stops working at once.
- We store only a fingerprint of each key and email you when one is created.
- Keep keys out of public code and browser pages. A key that can launch machines or use AI models spends your balance: give it only the access it needs.
GPU prices
| Call | What it does |
|---|---|
GET /v1/gpus | Every GPU model with its lowest and typical price, clouds and stock. Filters: sort, rentable, class, provider, gpus, vram, max_price, in_stock, verified, area (na, eu, apac, sa, mea), vcpu, ram, disk (minimums), max_total (the machine's GPUs per hour), reliability (min %), net (min Mbps), cuda (min version), host (datacenter, community), nvlink and template (offers that can launch it; ids from GET /v1/templates). |
GET /v1/gpus/{gpu_id} | One GPU: specs and price summary per cloud. |
GET /v1/gpus/{gpu_id}/offers | Every offer for one GPU across clouds. sort (price, total, reliability, network, memory, ...), limit, offset, launchable (only what can be launched through GridPup) and the filters above. left_out counts offers a filter left out because their cloud does not say. |
GET /v1/gpus/{gpu_id}/history | Price history: typical price, cheapest-to-90th-percentile band, each cloud. range: 24h, 7d, 30d, 90d, 1y. |
GET /v1/offers | Search offers across all GPUs and clouds (gpu, sort, limit, offset and the filters above). |
GET /v1/clouds | The clouds we collect from, and when each was last read. |
GET /v1/health | Service status (no key needed). |
- GPU ids are the ones in our page addresses, e.g.
nvidia-h100for gridpup.com/gpus/nvidia-h100. Lists are paged withlimit(up to 500) andoffset. - US dollars.
usd_per_gpu_houris per GPU;usd_total_houris the whole offer. On-demand by default; spot and reserved where a cloud offers them (billingfilter). launchable: truemarks offers you can launch through GridPup now.last_collected_atsays how fresh the data is.
Open models
Popular models from Hugging Face (Llama, Qwen, Mistral, gpt-oss, DeepSeek, Gemma, FLUX, Whisper and more): how much GPU memory each needs and the GPUs that run it, at today's prices. The same data as gridpup.com/models. Any key.
| Call | What it does |
|---|---|
GET /v1/models | Search open models: q, task, max_gpu_gb (fits in this much GPU memory), deployable, sort (downloads, likes, smallest, updated), page. Each with the GPU memory it needs and the cheapest machine now. |
GET /v1/models/{author}/{name} | One model: each version's needs (GPU memory, disk, CUDA, GPU generations) and every GPU that fits it, with the price per hour and, where measured, tokens per second. |
# chat models that fit in 24 GB, most downloaded first
curl -s -H "Authorization: Bearer $GRIDPUP_API_KEY" \
"https://api.gridpup.com/v1/models?task=text-generation&max_gpu_gb=24&deployable=true" \
| jq '.items[] | {id, need_gpu_gb, cheapest}'{
"id": "meta-llama/Llama-3.1-8B-Instruct",
"need_gpu_gb": 21.3,
"context_length": 131072,
"cheapest": { "gpu": "2x RTX 3060", "gpus": 2, "memory_gb": 24.0, "usd_per_hour": 0.19 },
"url": "https://gridpup.com/models/meta-llama/Llama-3.1-8B-Instruct"
}Machines
Accounts that can rent GPUs on GridPup can also launch and manage machines through the API, paid from the same prepaid balance and under the same rules as the website. Create a key with Launch and manage machines; it has two limits you choose: the most dollars an hour of machines it may run at once, and the most machines.
| Call | What it does | Access |
|---|---|---|
GET /v1/templates | What a machine can start with (Ubuntu, PyTorch, ...), per cloud. | machines:read |
GET /v1/offers/{offer_id}/quote | Live check of one offer: free now? exact prices, disk range, templates. | machines:read |
POST /v1/machines | Launch a machine. Needs an Idempotency-Key header. | machines:write |
GET /v1/machines | Your machines (status=active or ended; label=… for one label). | machines:read |
GET /v1/machines/{id} | One machine, checked with the cloud now, with SSH details while it runs. | machines:read |
PATCH /v1/machines/{id} | Set or clear the machine's label. | machines:write |
POST /v1/machines/{id}/reboot | Reboot (where the cloud supports it; see can.reboot). | machines:write |
DELETE /v1/machines/{id} | Terminate. The machine and its disks are deleted. | machines:write |
GET / POST /v1/ssh-keys | Your saved SSH keys; add one. | machines:read / write |
Find an offer, check it, launch, wait for it to run, connect, terminate:
H="Authorization: Bearer $GRIDPUP_API_KEY"
# 1. the cheapest RTX 4090 you can launch, in stock
curl -s -H "$H" "https://api.gridpup.com/v1/gpus/nvidia-rtx-4090/offers?in_stock=true&sort=price&limit=20" \
| jq -r '[.items[] | select(.launchable)][0].id' # e.g. vast:12345|on_demand
# 2. live check: free now? exact price, disk range, templates
curl -s -H "$H" "https://api.gridpup.com/v1/offers/vast:12345%7Con_demand/quote"
# 3. launch (the Idempotency-Key makes a retry safe: it never starts a second machine)
curl -s -H "$H" -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{"offer": "vast:12345|on_demand", "template": "ubuntu-22.04", "disk_gb": 40,
"ssh_public_keys": ["'"$(cat ~/.ssh/id_ed25519.pub)"'"], "max_price_usd_hour": 0.50}' \
"https://api.gridpup.com/v1/machines"
# 4. poll until "status": "running", then use connection.ssh
curl -s -H "$H" "https://api.gridpup.com/v1/machines/i-abc123"
# 5. terminate (the machine and its disk are deleted)
curl -s -X DELETE -H "$H" "https://api.gridpup.com/v1/machines/i-abc123"Idempotency-Keyis required onPOST /v1/machines. Reuse it when you retry; a new request needs a new key.- Instead of
template, sendimage: any public container image, started with SSH (Vast, Runpod and GPU.ai), e.g.nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04. Offers also carryperf_score(Vast's DLPerf) andcuda_max. - Give a machine a
labelwhen you launch it (e.g.sweep-7/arm-1) and find it withGET /v1/machines?label=sweep-7/arm-1; change it withPATCH. - Some clouds (Lium, Runpod) rent part of a machine. Their quote has
gpus({min, max, value}): passgpusto the quote and the launch to rent more than the smallest size.gpu_countand the machine price are for the GPUs you rent. max_price_usd_hourrefuses the launch if the price has gone up since you looked. Launching needs about an hour of the machine available in your balance. At $0 your machines are terminated, as on the website.- Launches, reboots and terminations: 10 a minute per key. Poll a machine every 10 seconds or so; most run within 1 to 5 minutes. We email you the first time each key launches a machine.
AI models
Chat, images, video, music, speech, translation and decisions from 100+ models (GPT, Claude, Gemini, Grok, Llama, DeepSeek, Qwen, FLUX, Seedream, Whisper and more). Chat, images and audio are in OpenAI's API format, the rest in calls of their own (below): point any OpenAI SDK or tool at https://api.gridpup.com/v1/ai with a key that has Also use AI models. Each request is paid from your balance at the prices on gridpup.com/ai; try models first in the Playground: under each tool, Use this in your code shows the same request in curl, Python, JavaScript and Go.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.gridpup.com/v1/ai", api_key=os.environ["GRIDPUP_API_KEY"])
r = client.chat.completions.create(
model="openai/gpt-5-mini",
messages=[{"role": "user", "content": "Explain KV cache in two sentences."}],
)
print(r.choices[0].message.content)
print("cost:", r.usage.cost_usd, "USD") # GridPup adds what it costcurl -N "https://api.gridpup.com/v1/ai/chat/completions" \
-H "Authorization: Bearer $GRIDPUP_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "anthropic/claude-sonnet-5.5", "stream": true,
"messages": [{"role": "user", "content": "Write a haiku about GPUs."}]}'| Call | What it does |
|---|---|
GET /v1/ai/models | Every model with its task (chat, image, transcription, speech, translation, decide, video, music), price and options; web_search on chat models that can search. |
POST /v1/ai/chat/completions | Chat, streamed (stream: true) or whole. Images as image_url parts for models that read them. web_search: true lets the model search the web (it cites numbered sources). usage.cost_usd is what it cost. |
POST /v1/ai/images/generations | One image a request: model, prompt, size (e.g. 1024x1024), response_format url or b64_json. With image (a data: URL) and mode edit, cutout or upscale, it works on a photo. |
POST /v1/ai/audio/transcriptions | Speech to text, multipart: file (up to 25 MB), model, language, response_format (json, text, verbose_json, vtt). |
POST /v1/ai/audio/translations | Speech in any language to English text (models that can). |
POST /v1/ai/audio/speech | Text to speech: model, input, voice. Returns the audio file; its cost is in the X-Cost-USD header. |
POST /v1/ai/translate | Text into another language: model, text, target (and source). Returns text and cost_usd. |
POST /v1/ai/decide | Decision and extraction models: model, state (text or JSON), questions by id. Returns answers and cost_usd (input tokens only). |
POST /v1/ai/videos | Start a video clip: model, prompt, and for some models image, last_image, reference_images, length, quality, shape. Returns a job (202). |
POST /v1/ai/music | Start a piece of music: model, prompt, seconds, instrumental, lyrics. Returns a job (202). |
GET /v1/ai/jobs/{id} | A video or music job: running, done (output.url, a link valid for hours) or error. Charged once done; a failed job costs nothing. |
POST /v1/ai/uploads | A signed link to PUT a clip for a video tool (upscale, cutout); pass its key as video_key to /v1/ai/videos. |
- Model ids come from
GET /v1/ai/models(e.g.openai/gpt-5-mini,google/gemini-3.8-flash,@cf/meta/llama-3.3-70b-instruct-fp8-fast). - Every answer says what it cost:
usage.cost_usdfor chat (in the last chunk when streamed),cost_usdfor images and transcriptions, theX-Cost-USDheader for speech. A request that fails at the model is not charged. - Your balance must cover the most a request can cost, and at least the minimum for its kind ($1 by default). Up to 6 requests at once per account.
- Reasoning models (GPT-5, Claude with thinking, Gemini) think before they answer, and thinking counts toward
max_tokens: give them room (2,000 or more), or the answer can come back empty withfinish_reason: "length". Their thinking streams asdelta.reasoning. - Image links last 6 hours; the image is kept 30 days.
- Errors:
insufficient_balance(402),not_available(403),unknown_model(404),busy(429, too many at once),model_error(502).
Training
Everything gridpup.com/training does, from your code or CI: a project holds your code and its run settings; a run copies the project as it is, rents the GPU you chose, runs your setup and training commands, saves what your code writes to /outputs and destroys the machine. Each run stops at its max_cost_usd or max_hours at the latest and is paid from your balance. Create a key with Also train models; it has its own limit on what one run may cost.
| Call | What it does | Access |
|---|---|---|
GET /v1/training/gpus | GPUs a run can use now, cheapest first: each GPU model and machine size (count: 1, 2, 4 or 8), with the price per hour for the machine (disk_gb). | any key |
GET / POST /v1/training/projects | Your projects; create one (name, starter). | read / write |
GET / PATCH / DELETE /v1/training/projects/{id} | One project's files and run settings; rename or change settings; delete. | read / write |
GET / PUT /v1/training/projects/{id}/file | Read a file (path=…); save a text file (path, text). | read / write |
POST /v1/training/projects/{id}/uploads, …/commit | Larger or binary files: signed PUT links by SHA-256, then commit them. | write |
POST /v1/training/projects/{id}/files/delete | Delete files (paths). | write |
GET /v1/training/projects/{id}/quote | Before starting: steps, GPU and price, limits, balance, problems. | read |
POST /v1/training/projects/{id}/runs | Start a run (gpu, max_cost_usd, max_hours; default: the project's settings). | write |
GET /v1/training/runs, …/runs/{id} | Your runs; one run with its state, steps, cost so far, machine and log lines (after_seq). | read |
POST /v1/training/runs/{id}/stop, …/again | Stop (outputs saved first unless now=true); run again with the same files and settings. | write |
GET /v1/training/runs/{id}/outputs | A download link (1 hour) for a file the run saved in /outputs (path=…). | read |
GET / POST /v1/training/data… | Datasets: list; upload in 64 MB parts (uploads, …/parts, …/complete); DELETE /v1/training/data/{id}. | read / write |
H="Authorization: Bearer $GRIDPUP_API_KEY"; J="Content-Type: application/json"
B=https://api.gridpup.com/v1/training
# 1. a project, with your training script
P=$(curl -s -H "$H" -H "$J" -d '{"name": "resnet"}' $B/projects | jq -r .id)
curl -s -X PUT -H "$H" -H "$J" -d "$(jq -n --rawfile t train.py '{path: "train.py", text: $t}')" $B/projects/$P/file
# 2. run settings: the command, a GPU from /v1/training/gpus, and limits
curl -s -X PATCH -H "$H" -H "$J" $B/projects/$P -d '{"settings": {
"train": "python train.py", "gpu": "nvidia-rtx-4090", "max_cost_usd": 5, "max_hours": 2}}'
# 3. check (problems, price, balance), then start
curl -s -H "$H" $B/projects/$P/quote | jq '{problems, price: .gpu}'
R=$(curl -s -X POST -H "$H" -H "$J" -d '{}' $B/projects/$P/runs | jq -r .id)
# 4. poll until "state" is "done" (or "failed"); new log lines with after_seq
curl -s -H "$H" "$B/runs/$R?after_seq=-1" | jq '{state, cost_usd, logs: .logs.batches[-1]}'
# 5. download what it saved in /outputs
curl -s -H "$H" "$B/runs/$R/outputs?path=model.pt" | jq -r .url | xargs curl -o model.pt- Settings are the same as the editor's Run settings:
setupcommands,train,environment,data(uploaded datasets),secrets(from your Secrets),gpu,disk_gb,max_cost_usd,max_hours. Wrong settings are refused with the field named. - Starting, stopping and re-running are limited to 10 a minute per key; an account can have up to 5 runs waiting or running. A run's files and outputs are kept 7 days after it ends.
- A run over the key's limit is refused with
409; a missing GPU, file or secret with422and the field.
Balance and spending
| Call | What it does | Access |
|---|---|---|
GET /v1/balance | Credit: added, billed, running estimate, available. | billing:read |
GET /v1/usage | Your balance and spending history, newest first: top-ups, each machine's charges (its billed lines in parts), AI model use (one line a day), adjustments. limit up to 500. | billing:read |
Add funds and turn on Auto top-up on gridpup.com/dashboard/billing.
AI agents (MCP)
GridPup is an MCP server, so Claude, Cursor and other agents can compare GPU prices, size a machine for a model and, with a key that has machine access, launch and manage machines for you. It runs at https://api.gridpup.com/mcp (Streamable HTTP); nothing to install. Send an API key in the Authorization header; the agent can do what that key can.
claude mcp add --transport http gridpup https://api.gridpup.com/mcp \ --header "Authorization: Bearer $GRIDPUP_API_KEY"
{
"mcpServers": {
"gridpup": {
"url": "https://api.gridpup.com/mcp",
"headers": { "Authorization": "Bearer gp_live_…" }
}
}
}{
"mcpServers": {
"gridpup": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.gridpup.com/mcp", "--header", "Authorization:Bearer ${GRIDPUP_API_KEY}"],
"env": { "GRIDPUP_API_KEY": "gp_live_…" }
}
}
}| Tools | Needs |
|---|---|
find_gpus, get_gpu, find_offers, price_history, find_models, get_model | any key |
list_templates, quote_offer, list_machines, get_machine | machines:read |
launch_machine, set_machine_label, reboot_machine, terminate_machine | machines:write |
list_training_projects, quote_training_run, list_training_runs, get_training_run, training_output_link | training:read |
start_training_run, stop_training_run | training:write |
get_balance, get_usage | billing:read |
Try: “What GPU do I need for Qwen3 32B, and what's the cheapest one right now?” or “Launch the cheapest RTX 4090 under $0.50/h with PyTorch and my SSH key, then give me the SSH command.” Agents are told to confirm before launching or terminating; the key's limits and your balance apply, and a retried launch never starts a second machine.
Limits and errors
- 300 requests a minute per key. Every response has
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset(seconds). Over the limit you get429withRetry-After. - Price data changes every 15 minutes, so polling faster gains nothing. Price responses can be cached for 60 s.
- Errors are JSON:
{"error": {"code": "unauthorized", "message": "…"}}.401missing, invalid, revoked or expired key;402not enough balance;403the key lacks access;404not found;409a key limit, a changed price or a gone offer;422bad parameter;429rate limit;502the cloud or model failed (nothing charged).
Using the data
Prices and the model catalog are free for your own projects and products. If you publish prices from them, credit “Prices from GridPup” with a link to gridpup.com. Don't resell the data or republish it in bulk. We may limit or revoke keys that are abused. See the terms.
Coming later
Webhooks (machine running, terminated, run finished, balance low); managing deployed models through the API; video, translation and decide/extract models in the AI API. Tell us what you'd use at [email protected].