API reference
Settling locks a vendor. The owed_ key you get speaks that vendor’s real contract, so official SDKs work with a single baseURL override.
Base URL
The base URL is this origin: https://getowed.fun. /gateway/v1 is an alias for /v1 if you prefer an explicit path. Authentication is the header the vendor expects, carrying the owed_ key in place of theirs.
Endpoints
| Vendor | Path | Auth header |
|---|---|---|
| Anthropic | POST /v1/messages | x-api-key: owed_… |
| OpenAI | POST /v1/chat/completions | Authorization: Bearer owed_… |
POST /v1beta/models/{model}:generateContent | x-goog-api-key: owed_… | |
| DeepSeek | POST /v1/chat/completions | Authorization: Bearer owed_… |
| xAI | POST /v1/chat/completions | Authorization: Bearer owed_… |
| Mistral | POST /v1/chat/completions | Authorization: Bearer owed_… |
| Meta | POST /v1/chat/completions | Authorization: Bearer owed_… |
| Cohere | POST /v1/chat/completions | Authorization: Bearer owed_… |
| Perplexity | POST /chat/completions | Authorization: Bearer owed_… |
| Moonshot | POST /v1/chat/completions | Authorization: Bearer owed_… |
OpenAI-compatible vendors
OpenAI, DeepSeek, xAI, Mistral, Meta, Cohere, Perplexity, and Moonshot all share the chat-completions contract. Point the OpenAI SDK at this origin and set the model to the one you locked at settle time.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OWED_KEY, // owed_…
baseURL: "https://getowed.fun/v1",
});
const res = await client.chat.completions.create({
model: "gpt-5.2-mini",
messages: [{ role: "user", content: "Summarise this diff" }],
stream: true,
});
for await (const chunk of res) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Anthropic
Anthropic uses its own messages contract and the x-api-key header. The SDK needs the origin without a version suffix.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.OWED_KEY,
baseURL: "https://getowed.fun",
});
await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 512,
messages: [{ role: "user", content: "Hello" }],
});Use the official generateContent path against this origin, with the key in x-goog-api-key.
curl https://getowed.fun/v1beta/models/gemini-3.0-flash:generateContent \
-H "x-goog-api-key: $OWED_KEY" \
-H "content-type: application/json" \
-d '{"contents":[{"parts":[{"text":"Hello"}]}]}'Using a key in Cursor
Cursor accepts an OpenAI-compatible base URL. Set the override to https://getowed.fun/v1, paste the owed_ key as the API key, and pick the model you locked. When the cap is spent, requests return 402 and nothing silently falls back to a paid account.
Errors
| Code | Meaning |
|---|---|
400 | The request body failed validation before it left the desk. |
401 | The key is missing, revoked, or unknown to the gateway. |
402 | The cap on that key is spent. Mint a new key from remaining compute credit. |
403 | The key is valid but locked to a different vendor or model than the one requested. |
429 | Rate limited. The header tells you when to retry. |
503 | That vendor’s upstream is unset or unreachable from the desk. |
Need a key first? See compute credit.