
Documentation
One OpenAI-compatible endpoint, served by the GPUs listed on /gpus. Access is decided by how many $CUDA your wallet holds. No billing, no staking, no sign-up form.
Overview#
cuda is a small inference service paid for by the creator fees of a token. Every trade of $CUDA pays a fee; the fee lands in the treasury; the treasury rents consumer GPUs that run open-weight models. Holders of the token send requests to those cards through this API and are never billed for it.
The wire format is the OpenAI chat completions format, so any SDK or tool that takes a baseURL works unchanged. Point it at https://cuda.codes/v1, use a key that starts with sk-cuda-, and pick a model from GET /v1/models.
Endpoints
| method | path | auth | what |
|---|---|---|---|
| POST | /v1/chat/completions | bearer | Chat completions, streaming or not. |
| GET | /v1/models | none | The catalogue with prices and tier gates. |
| GET | /v1/access | bearer | Your tier, holding, usage and limits. |
| GET | /api/state | none | Treasury, market, runway and totals. |
| GET | /api/series?days= | none | Hourly buckets of fees, spend and tokens. |
| GET | /api/fleet | none | Every GPU and what it is doing right now. |
Access#
How it works
There is nothing to buy from us and nothing to stake. Hold $CUDA in the wallet you sign in with and the API turns on. Three thresholds: holder at 10,000, operator at 100,000, core at 1,000,000 $CUDA.
The holding is checked on chain, live, on every request and cached for 60 seconds. Sell below a threshold and your keys stop working within a minute. Buy back above it and they start again. The tokens never leave your wallet.
Tiers
| tier | holding | req/min | $/day | max output | models |
|---|---|---|---|---|---|
| holder | 10,000 CUDA | 30 | $1.00 | 2,048 tok | 6 of 8 |
| operator | 100,000 CUDA | 120 | $5.00 | 4,096 tok | 8 of 8 |
| core | 1,000,000 CUDA | 300 | $20.00 | 8,192 tok | 8 of 8 |
The dollar figure is what your requests cost the treasury in GPU time, priced per model on the models page. You are never invoiced. When the day's allowance runs out you get a 429 until the window resets.
Who pays
Creator fees from the token accrue to the dev wallet, which is the treasury. Fees arrive as . GPU hosts bill in dollars, so the team converts a portion to fiat and pays the rental invoices by hand. The runway shown on the homepage is treasury ÷ daily GPU spend.
Nothing on-chain compels any of this. The conversion and the rentals are done by people, not a contract. If fees stop, the fleet shrinks. If the team stops, it stops. The token can go to zero. Read how it works before you buy anything.
Capacity
The fleet is sized by fee income, not by demand. When many holders are active at once a node may deprioritise new requests; you will see slower first tokens and a lower x-ratelimit-remaining before you see errors. The fleet page shows each card's current workload so you can see why.
Authentication#
There are two ways in, and they are the same pipeline underneath.
| surface | credential | how |
|---|---|---|
| site chat | signature cookie | Connect a wallet, sign a nonce. No transaction, nothing to approve on chain. The browser gets a cuda_session cookie and the playground calls POST /api/chat. |
| api | bearer key | Authorization: Bearer sk-cuda-… on every request to /v1/*. Keys are bound to the wallet that made them. |
Creating a key
Go to /api-keys, connect your wallet, give the key a label and press create. The secret is shown once. Any wallet can create keys; a key below the first threshold exists but runs nothing, and starts working the moment the wallet does.
export CUDA_API_KEY=sk-cuda-7Yx… # shown once, at creationWhere keys live
We store the sha256 of the secret and its last four characters. There is no reveal endpoint and nobody on the team can read a key back. Lose it, revoke it, make another. Revoked keys fail with 401 invalid_api_key immediately.
Chat completions#
POST /v1/chat/completions. The body is the standard shape: model, messages, and optionally stream, max_tokens, temperature, top_p, stop. Unknown fields are ignored.
Request
curl https://cuda.codes/v1/chat/completions \
-H "Authorization: Bearer $CUDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cuda/warp-1",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Why does 0.1 + 0.2 != 0.3 in most languages?"}
],
"max_tokens": 400
}'{
"id": "chatcmpl-8f1c…",
"object": "chat.completion",
"created": 1756000000,
"model": "cuda/warp-1",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Because both numbers are stored in binary floating point…" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 41, "completion_tokens": 212, "total_tokens": 253 }
}Response headers
HTTP/1.1 200 OK
content-type: application/json
x-cuda-node: cuda-node-03
x-cuda-tier: operator
x-ratelimit-limit: 120
x-ratelimit-remaining: 118
x-ratelimit-reset: 1756000060| header | meaning |
|---|---|
| x-cuda-node | Hostname of the GPU that served the request. Matches /api/fleet. |
| x-cuda-tier | The tier your wallet resolved to for this request. |
| x-ratelimit-limit | Requests allowed per minute at your tier. |
| x-ratelimit-remaining | Requests left in the current window. |
| x-ratelimit-reset | Unix seconds when the window resets. |
Streaming
Set stream: true and the response is text/event-stream with one chunk per data: line and a final [DONE]. The official SDKs handle this for you.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://cuda.codes/v1",
apiKey: process.env.CUDA_API_KEY,
});
const stream = await client.chat.completions.create({
model: "cuda/warp-1",
messages: [{ role: "user", content: "Summarize the tradeoffs of SSE versus WebSockets in two sentences." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}data: {"id":"chatcmpl-8f1c…","object":"chat.completion.chunk","model":"cuda/warp-1","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-8f1c…","object":"chat.completion.chunk","model":"cuda/warp-1","choices":[{"index":0,"delta":{"content":"SSE"},"finish_reason":null}]}
data: {"id":"chatcmpl-8f1c…","object":"chat.completion.chunk","model":"cuda/warp-1","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]Python
from openai import OpenAI
import os
client = OpenAI(
base_url="https://cuda.codes/v1",
api_key=os.environ["CUDA_API_KEY"],
)
r = client.chat.completions.create(
model="cuda/warp-1",
messages=[{"role": "user", "content": "Extract every email address from: reach ops@example.com or sales@example.com"}],
)
print(r.choices[0].message.content)max_tokens
Each tier has a ceiling on output length (holder 2,048, operator 4,096, core 8,192). A larger max_tokens is silently clamped, and an omitted one defaults to the ceiling. A response cut short by the clamp has finish_reason: "length".
Images
The fleet runs text models only. A message whose content array contains an image_url part is rejected with 400 images_unsupported before it reaches a node.
Models#
GET /v1/models needs no auth and returns the catalogue below. Ids are stable. Prices are what one million tokens cost the treasury in GPU time at the current rental rates; they change when the fleet does.
{
"object": "list",
"data": [
{
"id": "cuda/warp-1",
"object": "model",
"owned_by": "cuda",
"name": "cuda warp-1",
"context_length": 131072,
"pricing": {
"prompt_usd_per_million": 0.18,
"completion_usd_per_million": 0.42
},
"min_tier": "holder"
}
]
}| id | params | context | prompt | completion | min tier |
|---|---|---|---|---|---|
| cuda/warp-1 | 70B | 128k | $0.18/M | $0.42/M | holder |
| meta/llama-3.3-70b | 70B | 128k | $0.2/M | $0.45/M | holder |
| qwen/qwen-2.5-72b | 72B | 128k | $0.2/M | $0.45/M | holder |
| deepseek/deepseek-v3 | 671B MoE | 64k | $0.3/M | $0.9/M | operator |
| google/gemma-3-27b | 27B | 128k | $0.08/M | $0.18/M | holder |
| mistral/mistral-small-3.1 | 24B | 128k | $0.07/M | $0.16/M | holder |
| qwen/qwen-2.5-coder-32b | 32B | 128k | $0.1/M | $0.24/M | holder |
| deepseek/deepseek-r1-distill-70b | 70B | 64k | $0.25/M | $0.6/M | operator |
Calling a model above your tier returns 403 tier_too_low. An unknown id returns 404 model_not_found. The default, cuda/warp-1, is the house model.
Checking access#
GET /v1/access with a bearer key answers the question "will my next request work, and how many more do I get". It performs the same live holding check as a completion, so it counts as a cheap way to warm the 60-second cache.
curl https://cuda.codes/v1/access -H "Authorization: Bearer $CUDA_API_KEY"{
"object": "access",
"active": true,
"tier": "operator",
"holding": 142310,
"required": 100000,
"next_tier": { "id": "core", "minHolding": 1000000 },
"requests": 318,
"spent_usd": 0.64,
"limits": {
"requests_per_min": 120,
"daily_usd": 5,
"max_output_tokens": 4096
}
}| field | meaning |
|---|---|
| active | true when the wallet meets the first threshold and the token has launched. |
| tier | none · holder · operator · core |
| holding | Whole CUDA in the wallet at the last check, or null if it could not be read. |
| required | Holding needed for the first tier. |
| next_tier | The tier above yours, or null at the top. |
| requests / spent_usd | Lifetime totals for this wallet. |
| limits | Per-minute, per-day and output caps at your tier. |
The fleet#
GET /api/fleet returns a snapshot of every card the treasury is renting, refreshed about once a second. GET /api/stream/fleet is the same snapshot as server-sent events, one frame per second, which is what the /gpus page draws from.
{
"at": "2026-08-24T09:12:03.000Z",
"nodes": [
{
"id": "n03",
"hostname": "cuda-node-03",
"gpu": "RTX 5090 32GB",
"vramGb": 32,
"region": "us-east (ashburn)",
"provider": "vast.ai host",
"usdPerHour": 0.69,
"status": "online",
"utilization": 0.71,
"tempC": 63,
"powerW": 412,
"tokensPerSec": 48.2,
"tokensTotal": 91243110,
"model": "qwen/qwen-2.5-72b",
"workload": "holder api",
"activeSessions": 6,
"uptimeSec": 184220,
"bootedAt": "2026-08-22T06:01:43.000Z"
}
],
"totals": {
"online": 8, "tokens": 512033910, "tokensPerSec": 331.5,
"usdPerHour": 5.29, "usdPerDay": 126.96,
"activeSessions": 41, "sessionsToday": 1180, "requests": 90211
}
}| field | meaning |
|---|---|
| status | online · provisioning · draining · offline. Only online nodes take traffic. |
| utilization | 0 to 1. Classroom load plus API load. |
| model | The model loaded in VRAM. A request for another model may cause a swap. |
| workload | What the card is doing: holder api, a batch job, or idle. |
| tokensTotal | Cumulative tokens generated by that card. Only goes up. |
| usdPerHour | Rental rate the treasury pays for this card. |
const es = new EventSource("https://cuda.codes/api/stream/fleet");
es.onmessage = (e) => {
const snap = JSON.parse(e.data);
console.log(snap.totals.tokensPerSec, "tok/s across", snap.totals.online, "cards");
};The x-cuda-node header on a completion is the hostname of the node in this list that served you. Requests go to the least loaded online node that already has the model loaded.
Public data#
Everything on the homepage is available as JSON, without a key. Useful for dashboards or for checking our numbers.
GET /api/state
Market, treasury and ledger totals in one object, cached for 15 seconds. Fields include launched, marketCapUsd, holders, treasurySol, treasuryUsd, unclaimedSol, claimedUsd, spentUsd, gpuCostUsd, gpuBurnPerDayUsd, runwayDays, promptTokens, completionTokens, requests and the last few fee claims with their signatures. Before launch launched is false and the market fields are null.
GET /api/series?days=
Hourly buckets for the last 1, 7, 30 or 90 days: fees claimed, GPU cost, inference spend, tokens and requests per hour. The shape is an array ordered oldest first.
curl "https://cuda.codes/api/series?days=7" | jq '.[-1]'Errors#
Errors use the OpenAI envelope so SDKs raise the right exception class. code is the field to switch on.
{
"error": {
"message": "Your wallet holds 4,200 CUDA. The holder tier starts at 10,000.",
"type": "permission_error",
"code": "not_a_holder"
}
}| status | code | when |
|---|---|---|
| 401 | invalid_api_key | Missing, malformed, unknown or revoked key. |
| 401 | not_signed_in | Site chat without a valid session cookie. |
| 403 | not_launched | The token has no mint yet, so nobody holds it. |
| 403 | not_a_holder | Wallet is below the first threshold. |
| 403 | tier_too_low | The model needs a higher tier than yours. |
| 404 | model_not_found | Unknown model id. |
| 429 | rate_limit_exceeded | Per-minute window is full. Check x-ratelimit-reset. |
| 429 | daily_limit_reached | Your daily allowance, or the service-wide ceiling, is spent. |
| 502 | upstream_unreachable | The node that took the request stopped answering. Retry. |
| 503 | upstream_unconfigured | No node can serve this model right now. |
Rate limits#
Limits are per wallet, not per key. All keys on a wallet share one budget.
| tier | req/min | $/day | max output |
|---|---|---|---|
| holder | 30 | $1.00 | 2,048 tok |
| operator | 120 | $5.00 | 4,096 tok |
| core | 300 | $20.00 | 8,192 tok |
Windows are fixed. The per-minute counter resets at x-ratelimit-reset; the daily counter resets at 00:00 UTC. Neither carries over.
There is a service-wide ceiling of $30 per day across all holders. It exists so a busy day for the API cannot outrun the fee income that pays for the fleet. When it is reached every wallet gets 429 daily_limit_reached regardless of tier, until midnight UTC.
The fleet is finite. Capacity is whatever the treasury can rent. Under sustained pressure your limits do not change, but latency will, and nodes may reject requests with 503 for short periods. Back off and retry.
