API Docs
OpenAI-compatible. If your code already uses the OpenAI SDK, you change two lines and you're done. Below: the 5-minute quick start, then everything in detail.
Quick start
- Go to API Console and create a key. Copy the
cgw-sk-...value — it's shown once. - Top up your USDT balance via Billing. A first top-up of $10 becomes $15, enough to test for a while.
- Make a request:
- Runnable examples (Python, Node.js, cURL, Cursor/Cline setup) are in the public repo <a href="https://github.com/mrhy7176/cloudgpu-examples" class="text-primary underline" target="_blank" rel="noopener">github.com/mrhy7176/cloudgpu-examples</a>.
cURLcurl https://cloudgpu.app/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $CGW_API_KEY" \ -d '{ "model": "deepseek-v4-flash", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Say hi in one sentence."} ] }'
Authentication
Every request to /v1/* requires an Authorization: Bearer cgw-sk-<your_key> header. Keys are scoped to your CloudGPU account. Revoke any key any time from the console; revocation takes effect immediately.
The raw key is shown exactly once at creation time. We store only a sha256 hash; we cannot recover it if you lose it. Create a new key if that happens.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| POST | /v1/chat/completions | OpenAI-format chat completion. Same request/response shape as OpenAI. |
| GET | /v1/models | List available models + current per-token pricing. |
Embeddings, function calling, vision, image generation — on the roadmap, not v0.
Streaming
Pass "stream": true in the request body. Response is Server-Sent Events in OpenAI format. The OpenAI SDK handles this transparently.
Python (streaming)# Streaming — same client, stream=True for chunk in client.chat.completions.create( model="deepseek-v4-flash", messages=[{"role": "user", "content": "Count to 5."}], stream=True, ): delta = chunk.choices[0].delta.content if delta: print(delta, end="", flush=True)
SDKs
We don't ship our own SDK — the OpenAI SDK works as-is with base_url override.
Python# pip install openai>=1.0 from openai import OpenAI client = OpenAI( api_key="cgw-sk-...", # from /api/console base_url="https://cloudgpu.app/v1", ) resp = client.chat.completions.create( model="deepseek-v4-flash", messages=[{"role": "user", "content": "Say hi."}], ) print(resp.choices[0].message.content) print(f"Used {resp.usage.total_tokens} tokens")
Node.js// npm install openai import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.CGW_API_KEY, baseURL: "https://cloudgpu.app/v1", }); const resp = await client.chat.completions.create({ model: "deepseek-v4-flash", messages: [{ role: "user", content: "Say hi." }], }); console.log(resp.choices[0].message.content);
Pricing & billing
Every model is priced against what its own vendor charges for the same model — most at or below it; the price table shows the exact comparison. You pay per token, per image, per character or per second of audio depending on the model; nothing is metered by the hour and there is no monthly minimum.
Each request deducts from your prepaid balance. Successful calls show in your console within ~1 second with full token counts and dollar cost.
Full per-model pricing table on the landing page.
GPU instances
The same API key also rents GPUs: list what is on the shelf, start an instance from a template, poll until it is running, read its SSH details and public API endpoint, destroy it. Billing is identical to the web console — per minute, from the same balance.
This section is about the REST API only. Renting a GPU from the web console has no minimum. The programmatic instance API is enabled for accounts with at least $2,000 of lifetime top-ups; other accounts receive 403 gpu_api_not_enabled with the amount still needed.
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/gpu/offers | Cards for rent: model, VRAM, hourly price, availability (none / low / ok), minimum card count. |
| GET | /v1/gpu/templates | Templates: id, name, recommended card, whether it exposes a public API endpoint. |
| POST | /v1/gpu/instances | Start an instance. Body: gpu_model and/or template, optional gpu_count (1–8) and model_name. Returns 202 with status creating. |
| GET | /v1/gpu/instances | Your running, starting and recently stopped instances. |
| GET | /v1/gpu/instances/{id} | One instance: status, SSH host/port/user/password, api_url, running minutes, cost so far. |
| DELETE | /v1/gpu/instances/{id} | Destroy an instance and settle the bill. POST /v1/gpu/instances/{id}/destroy does the same. |
curl -X POST https://cloudgpu.app/v1/gpu/instances \
-H "Authorization: Bearer $CLOUDGPU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"gpu_model": "RTX 4090", "template": "ollama"}'
# 202 Accepted
{"id":"2096…","object":"gpu.instance","gpu_model":"RTX 4090","gpu_count":1,"template":"ollama",
"status":"creating","hourly_usd":0.33,"ssh":null,"api_url":null, …}
# poll GET /v1/gpu/instances/{id} until status is "running";
# then ssh.host / ssh.port / ssh.password and api_url (for API templates) are filled in.Defaults: 10 instances running or starting at once, 20 creations per hour, 60 GPU API requests per minute per key. Ask support@cloudgpu.app to raise them for a real workload.
Rate limits
| Per API key, per minute | 100 requests |
| Per account, per day | 10,000 requests |
These defaults exist to stop abuse during the public beta. Contact us if you need them raised — happy to do it for any genuine workload, just need to know the use case.
Errors
Error responses follow OpenAI's shape: HTTP status code + JSON body { error: { type, code, message } }.
| Status | code | When |
|---|---|---|
| 401 | missing_authorization | No Authorization header. |
| 401 | invalid_api_key | Key unknown or revoked. |
| 400 | model_not_found | Model id not in catalog. See GET /v1/models. |
| 402 | insufficient_balance | USDT balance below $0.01. Top up. |
| 429 | rate_limit_exceeded | Per-minute or per-day limit hit. |
| 503 | upstream_not_configured | Gateway being provisioned — should resolve within hours. |
Ready?
Get your API key