Documentation

Quickstart

BusMixer exposes an OpenAI-compatible API. Send a request to one endpoint with a model id from the catalog and your BusMixer key.

Overview

Use any HTTP client or OpenAI SDK. The base URL is:

https://busmixer.us/api/v1

The model id is the id shown in the catalog, for example anthropic/claude-sonnet-5. Prices are per million tokens and are listed beside each model.

Authentication

Create a key in the console, then send it in the Authorization header:

Authorization: Bearer <BUSMIXER_API_KEY>

Keys are shown once when created. Store the key in an environment variable and never commit it. A key can be disabled or deleted from the console at any time.

Chat completions

Send a standard chat request to POST /api/v1/chat/completions:

curl https://busmixer.us/api/v1/chat/completions \
  -H "Authorization: Bearer $BUSMIXER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "messages": [
      {"role": "user", "content": "Explain a mixin in one sentence."}
    ]
  }'

The response follows the OpenAI chat-completions shape: id, choices, usage, and so on. The model field echoes the model that served the request.

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://busmixer.us/api/v1",
    api_key=os.environ["BUSMIXER_API_KEY"],
)

completion = client.chat.completions.create(
    model="openai/gpt-5.5",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://busmixer.us/api/v1",
  apiKey: process.env.BUSMIXER_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "openai/gpt-5.5",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);

Streaming

Add "stream": true to receive server-sent events. Each event contains a delta with new content:

{
  "model": "anthropic/claude-sonnet-5",
  "messages": [{"role": "user", "content": "Count to five."}],
  "stream": true
}

Read the stream until the [DONE] marker. If the connection drops, retry with a new request; do not assume the partial response was billed as a completed generation.

List models

GET /api/v1/models returns the OpenAI model-list shape. The catalog UI uses the same data with prices per million tokens:

curl https://busmixer.us/api/v1/models

For a smaller payload with prices, read GET /api/catalog.

Errors

Errors use an OpenAI-style body:

{
  "error": {
    "message": "Insufficient balance",
    "type": "invalid_request_error"
  }
}
  • 401 — missing or invalid API key.
  • 402 — the account has no credit left.
  • 404 — the model id is not in the catalog.
  • 429 — too many requests; back off and retry.
  • 5xx — upstream or gateway error; retry with exponential backoff.

SDKs

Any OpenAI-compatible SDK works: the official Python and Node packages, LangChain, LlamaIndex, AI SDKs, and others. Set the base URL to https://busmixer.us/api/v1 and use a BusMixer key.

Need a model that is not in the catalog, or a custom rate limit? Contact support from your account page.