Base URL
https://carbide-ai.work.gd/v1
OpenAI-compatible. Point any OpenAI SDK at Carbide by changing the base URL and the key — everything else stays the same.
from openai import OpenAI client = OpenAI( base_url="https://carbide-ai.work.gd/v1", api_key=os.environ["CARBIDE_KEY"], )
Authentication
Sign in with Discord at /login — your first sign-in creates the account and a sk-carbide-… key. Send the key as a bearer token on every request:
Keys are shown once and stored hashed. Rotate any time from the dashboard.
Chat completions
curl https://carbide-ai.work.gd/v1/chat/completions \ -H "Authorization: Bearer $CARBIDE_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "dsv4-flash-bf16", "messages": [{"role": "user", "content": "hello"}] }'
Responses include an usage object with token counts. Carbide deducts those tokens from your balance and returns two extra headers: X-Carbide-Tokens-Used and X-Carbide-Balance.
response = client.chat.completions.create(
model="dsv4-flash-bf16",
messages=[{"role": "user", "content": "hello"}],
)
print(response.choices[0].message.content)Streaming
Pass "stream": true to receive server-sent events, exactly like the OpenAI API. Streamed usage is metered with a per-token estimate.
stream = client.chat.completions.create(
model="dsv4-flash-bf16",
messages=[{"role": "user", "content": "count to five"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")List models
Public endpoint — no key required. The table below is live from the catalogue.
| Model ID | Name | Context | Input / M | Output / M |
|---|---|---|---|---|
| Loading catalogue… | ||||
Earning tokens
Every ad you watch in the dashboard credits 100,000 tokens to your balance. Watch time and a small proof-of-work are verified server-side, each ad can be claimed once, ad blockers must be off, and there's a daily cap (50 per account and 100 per network, resets at midnight UTC). Spend tokens by calling the API — balances can go slightly negative on a single large request.
POST /api/ads/start— begin a verified ad session (returns a proof-of-work challenge)POST /api/ads/claim— credit the reward after watch time + PoWGET /api/account— balance, usage, and ad counters
Errors & limits
Errors follow the OpenAI shape: {"error": {"message", "type", "code"}}.
- 401 — missing or invalid API key
- 402 —
insufficient_balance: watch an ad to top up - 404 — unknown model (check
GET /v1/models) - 429 — rate limit: 20 requests/min per key, 40/min per IP, max 2 concurrent per key, 90/min on account endpoints
Request bodies are capped at 8 MB. Idle balance of 0 tokens blocks new requests until you earn more.