Contents

Docs

Keep the OpenAI or Anthropic SDK you already use, and send your first request in a few minutes.

Quickstart

Create a key, set two environment variables, then send a request.

Two changes, nothing else

Point your OpenAI SDK at http://127.0.0.1:3001/v1, or your Anthropic SDK at http://127.0.0.1:3001, and use your yourbrand key. Requests, responses and streams keep the shapes your code already expects. A field we don't support gets a 400 rather than being dropped. Fine-tuning, batch, files and assistants aren't offered.

  1. 1
    Create a key

    Register with a username, buy $5 slips and redeem them for credit, then create a key in the dashboard.

  2. 2
    Set the base URL
    export YOURBRAND_BASE_URL=http://127.0.0.1:3001/v1
    export YOURBRAND_KEY=sk_...
  3. 3
    Send a request
    curl $YOURBRAND_BASE_URL/chat/completions \
      -H "Authorization: Bearer $YOURBRAND_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model":"qwen3.8-27b-abliterated","messages":[{"role":"user","content":"hello"}]}'

Agent setup

Any agent that accepts an OpenAI base URL works. These are the settings for the common ones. OpenCode reads its settings from ~/.config/opencode/opencode.json.

export OPENAI_API_BASE=http://127.0.0.1:3001/v1
export OPENAI_API_KEY=$YOURBRAND_KEY
aider --model openai/qwen3.8-27b-abliterated

Streaming

Set stream: true and the reply arrives as server-sent events while the model writes it. The SDKs handle the parsing; this is what they do underneath, for when you read the stream yourself.

curl -N $YOURBRAND_BASE_URL/chat/completions \
  -H "Authorization: Bearer $YOURBRAND_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen3.8-27b-abliterated","stream":true,"messages":[{"role":"user","content":"hello"}]}'
  • Each event is a data: line holding one chat.completion.chunk.
  • The last chunk carries usage, so you can count a stream's tokens without a second request.
  • The stream ends with data: [DONE]. Closing the connection early stops generation.

Event-by-event shapes, including the Anthropic stream, are in the API reference.

Handling errors

Three errors are worth retrying: 429 when you're over your plan's parallel limit, with a Retry-After header in seconds; 500 when something fails on our side; and 503 when a model is briefly not serving. Everything else needs a change to the request, and retrying won't help.

// The OpenAI SDK already retries 429 and 5xx with backoff and honours Retry-After.
const client = new OpenAI({
  apiKey: process.env.YOURBRAND_KEY,
  baseURL: process.env.YOURBRAND_BASE_URL,
  maxRetries: 5,
});

Every status code and both error shapes are listed under Errors; plan limits are under Rate limits.

↑↓ moveEnter openEsc close