cuda

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.

base url
https://cuda.codes/v1
auth
Bearer sk-cuda-…
default model
cuda/warp-1

start

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

methodpathauthwhat
POST/v1/chat/completionsbearerChat completions, streaming or not.
GET/v1/modelsnoneThe catalogue with prices and tier gates.
GET/v1/accessbearerYour tier, holding, usage and limits.
GET/api/statenoneTreasury, market, runway and totals.
GET/api/series?days=noneHourly buckets of fees, spend and tokens.
GET/api/fleetnoneEvery 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

tierholdingreq/min$/daymax outputmodels
holder10,000 CUDA30$1.002,048 tok6 of 8
operator100,000 CUDA120$5.004,096 tok8 of 8
core1,000,000 CUDA300$20.008,192 tok8 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.

Stated plainly

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.

surfacecredentialhow
site chatsignature cookieConnect 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.
apibearer keyAuthorization: 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.

shell
export CUDA_API_KEY=sk-cuda-7Yx…   # shown once, at creation

Where 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.


api

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
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
  }'
response · 200
{
  "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

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
headermeaning
x-cuda-nodeHostname of the GPU that served the request. Matches /api/fleet.
x-cuda-tierThe tier your wallet resolved to for this request.
x-ratelimit-limitRequests allowed per minute at your tier.
x-ratelimit-remainingRequests left in the current window.
x-ratelimit-resetUnix 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.

typescript · openai sdk
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 ?? "");
}
sse frames
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

python · openai sdk
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.

response · shape
{
  "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"
    }
  ]
}
idparamscontextpromptcompletionmin tier
cuda/warp-170B128k$0.18/M$0.42/Mholder
meta/llama-3.3-70b70B128k$0.2/M$0.45/Mholder
qwen/qwen-2.5-72b72B128k$0.2/M$0.45/Mholder
deepseek/deepseek-v3671B MoE64k$0.3/M$0.9/Moperator
google/gemma-3-27b27B128k$0.08/M$0.18/Mholder
mistral/mistral-small-3.124B128k$0.07/M$0.16/Mholder
qwen/qwen-2.5-coder-32b32B128k$0.1/M$0.24/Mholder
deepseek/deepseek-r1-distill-70b70B64k$0.25/M$0.6/Moperator

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
curl https://cuda.codes/v1/access -H "Authorization: Bearer $CUDA_API_KEY"
response · 200
{
  "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
  }
}
fieldmeaning
activetrue when the wallet meets the first threshold and the token has launched.
tiernone · holder · operator · core
holdingWhole CUDA in the wallet at the last check, or null if it could not be read.
requiredHolding needed for the first tier.
next_tierThe tier above yours, or null at the top.
requests / spent_usdLifetime totals for this wallet.
limitsPer-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.

response · shape
{
  "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
  }
}
fieldmeaning
statusonline · provisioning · draining · offline. Only online nodes take traffic.
utilization0 to 1. Classroom load plus API load.
modelThe model loaded in VRAM. A request for another model may cause a swap.
workloadWhat the card is doing: holder api, a batch job, or idle.
tokensTotalCumulative tokens generated by that card. Only goes up.
usdPerHourRental rate the treasury pays for this card.
typescript · sse
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
curl "https://cuda.codes/api/series?days=7" | jq '.[-1]'

reference

Errors#

Errors use the OpenAI envelope so SDKs raise the right exception class. code is the field to switch on.

response · 403
{
  "error": {
    "message": "Your wallet holds 4,200 CUDA. The holder tier starts at 10,000.",
    "type": "permission_error",
    "code": "not_a_holder"
  }
}
statuscodewhen
401invalid_api_keyMissing, malformed, unknown or revoked key.
401not_signed_inSite chat without a valid session cookie.
403not_launchedThe token has no mint yet, so nobody holds it.
403not_a_holderWallet is below the first threshold.
403tier_too_lowThe model needs a higher tier than yours.
404model_not_foundUnknown model id.
429rate_limit_exceededPer-minute window is full. Check x-ratelimit-reset.
429daily_limit_reachedYour daily allowance, or the service-wide ceiling, is spent.
502upstream_unreachableThe node that took the request stopped answering. Retry.
503upstream_unconfiguredNo node can serve this model right now.

Rate limits#

Limits are per wallet, not per key. All keys on a wallet share one budget.

tierreq/min$/daymax output
holder30$1.002,048 tok
operator120$5.004,096 tok
core300$20.008,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.