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

  1. Go to API Console and create a key. Copy the cgw-sk-... value — it's shown once.
  2. Top up your USDT balance via Billing. A first top-up of $10 becomes $15, enough to test for a while.
  3. Make a request:
  4. 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>.
cURL
curl 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

MethodPathPurpose
POST/v1/chat/completionsOpenAI-format chat completion. Same request/response shape as OpenAI.
GET/v1/modelsList 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.

MethodPathPurpose
GET/v1/gpu/offersCards for rent: model, VRAM, hourly price, availability (none / low / ok), minimum card count.
GET/v1/gpu/templatesTemplates: id, name, recommended card, whether it exposes a public API endpoint.
POST/v1/gpu/instancesStart an instance. Body: gpu_model and/or template, optional gpu_count (1–8) and model_name. Returns 202 with status creating.
GET/v1/gpu/instancesYour 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 minute100 requests
Per account, per day10,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 } }.

StatuscodeWhen
401missing_authorizationNo Authorization header.
401invalid_api_keyKey unknown or revoked.
400model_not_foundModel id not in catalog. See GET /v1/models.
402insufficient_balanceUSDT balance below $0.01. Top up.
429rate_limit_exceededPer-minute or per-day limit hit.
503upstream_not_configuredGateway being provisioned — should resolve within hours.