API Documentation

BadAssModeles is a drop-in OpenAI-compatible API. If a tool speaks OpenAI, it speaks BadAssModeles.

The two things every tool asks for

Base URL: https://badassmodel.com/v1

API Key: sk-bam-... (Dashboard → API Keys → Create key)

Set up your tool in one paste

Click the button to drop your own API key into every setup block below, then hit Copy on the one for your tool.

Or paste an existing key:

Kimi Code CLI

Add to ~/.kimi-code/config.toml, then run kimi and pick the model with /model.

[providers.badass]
type = "openai"
base_url = "https://badassmodel.com/v1"
api_key = "sk-bam-PASTE-YOUR-KEY-HERE"

[models."badass-model"]
provider = "badass"
model = "badass-model"
max_context_size = 262144

[models."badass-large"]
provider = "badass"
model = "badass-large"
max_context_size = 1000000

[models."badass-large-v2"]
provider = "badass"
model = "badass-large-v2"
max_context_size = 1000000

Codex CLI

~/.codex/config.toml, then export the key and run codex.

model_provider = "badass"
model = "badass-large"

[model_providers.badass]
name = "BadAssModel"
base_url = "https://badassmodel.com/v1"
env_key = "BADASS_API_KEY"
wire_api = "chat"

# then in your shell:
export BADASS_API_KEY="sk-bam-PASTE-YOUR-KEY-HERE"

Claude Code (via claude-code-router)

Claude Code speaks Anthropic's protocol, so a translator fronts it. npm i -g @musistudio/claude-code-router, save this to ~/.claude-code-router/config.json, then start with: ccr code

{
  "Providers": [
    {
      "name": "badass",
      "api_base_url": "https://badassmodel.com/v1/chat/completions",
      "api_key": "sk-bam-PASTE-YOUR-KEY-HERE",
      "models": ["badass-model", "badass-large", "badass-large-v2"]
    }
  ],
  "Router": {
    "default": "badass,badass-large",
    "background": "badass,badass-model",
    "think": "badass,badass-large-v2"
  }
}

Cursor

1. Open Settings (Ctrl+Shift+J) → Models tab
2. OpenAI API Key: sk-bam-PASTE-YOUR-KEY-HERE
3. Enable "Override OpenAI Base URL": https://badassmodel.com/v1
4. Click "+ Add model" and add exactly: badass-model, badass-large, badass-large-v2
5. Click Verify, then pick badass-large in the model picker

Hermes

Run: hermes model
Choose "custom OpenAI-compatible endpoint" and enter:
  Base URL: https://badassmodel.com/v1
  API key:  sk-bam-PASTE-YOUR-KEY-HERE
  Model:    badass-large

OpenClaw

openclaw.json — baseUrl ends at /v1, do not add /chat/completions.

{
  "models": {
    "providers": {
      "badass": {
        "baseUrl": "https://badassmodel.com/v1",
        "apiKey": "sk-bam-PASTE-YOUR-KEY-HERE",
        "api": "openai-completions",
        "models": [
          { "id": "badass-model", "name": "BadAss Model" },
          { "id": "badass-large", "name": "BadAss Large" },
          { "id": "badass-large-v2", "name": "BadAss Large v2" }
        ]
      }
    }
  }
}

OpenAI SDK (Python / Node)

# Python
from openai import OpenAI
client = OpenAI(base_url="https://badassmodel.com/v1", api_key="sk-bam-PASTE-YOUR-KEY-HERE")
resp = client.chat.completions.create(
    model="badass-large",
    messages=[{"role": "user", "content": "hello"}],
)
print(resp.choices[0].message.content)

// Node
import OpenAI from "openai";
const client = new OpenAI({
  baseURL: "https://badassmodel.com/v1",
  apiKey: "sk-bam-PASTE-YOUR-KEY-HERE",
});
const resp = await client.chat.completions.create({
  model: "badass-large",
  messages: [{ role: "user", content: "hello" }],
});
console.log(resp.choices[0].message.content);

curl (the 30-second test)

curl https://badassmodel.com/v1/chat/completions \
  -H "Authorization: Bearer sk-bam-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-r1",
    "stream": true,
    "messages": [{"role": "user", "content": "hello"}]
  }'

List models: curl https://badassmodel.com/v1/models -H "Authorization: Bearer sk-bam-..."

Check balance: curl https://badassmodel.com/v1/wallet -H "Authorization: Bearer sk-bam-..." → credits remaining + your rate tier.

Pick your model

Every model you can call is in GET /v1/models. Take the id of the one you want and put it in the "model" field of your request — that’s the whole selection mechanism, same as OpenAI.

curl https://badassmodel.com/v1/models -H "Authorization: Bearer sk-bam-..."

→ {"data": [
    {"id": "euryale-l3.3-70b-uncensored", "kind": "chat",  ...},
    {"id": "qwen3-vl-235b-instruct",      "kind": "chat",  ...},
    {"id": "flux-1-dev",                  "kind": "image", ...},
    {"id": "kokoro-82m",                  "kind": "tts",   ...},
    ...]}

The kind tells you which endpoint serves it: chat → /chat/completions, image → /images/generations,tts → /audio/speech. The live list with per-model prices is on the pricing page.

Vision: models tagged vision on the pricing table (qwen3-vl-235b-instruct, glm-4.6v, deepseek-v4-flash-vision, badass-model, …) accept images via OpenAI content parts —{"type": "image_url", "image_url": {"url": "https://…"}} alongside your text.badass-model takes images as base64 data URLs only (data:image/jpeg;base64,…); other vision models also accept remote HTTPS URLs.

Python (official openai SDK)

from openai import OpenAI

client = OpenAI(base_url="https://badassmodel.com/v1", api_key="sk-bam-...")

stream = client.chat.completions.create(
    model="deepseek-r1",
    messages=[{"role": "user", "content": "hello"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

OpenCode

export BADASS_API_KEY=sk-bam-...
# add to ~/.config/opencode/opencode.json:
{
  "provider": {
    "badassmodeles": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "BadAssModeles",
      "options": { "baseURL": "https://badassmodel.com/v1", "apiKey": "{env:BADASS_API_KEY}" },
      "models": { "deepseek-r1": { "name": "DeepSeek R1" } }
    }
  }
}

One-paste setup for any AI agent

Copy the whole block, swap in your key, paste it to your AI coding agent (opencode, Claude Code, Cursor agent, Cline, …). It does the full setup itself:

Set up BadAssModeles as my LLM provider. Do every step, no questions:

1. Add custom provider "badassmodeles", OpenAI-compatible:
   base URL  https://badassmodel.com/v1
   API key   sk-bam-PASTE-YOUR-KEY-HERE
2. Fetch the full catalog:
   curl -s https://badassmodel.com/v1/models -H "Authorization: Bearer sk-bam-PASTE-YOUR-KEY-HERE"
   Register EVERY id it returns as an available model — chat, image, and tts.
3. Make qwen3-coder-480b the default model.
4. Add a /balance command that runs:
   curl -s https://badassmodel.com/v1/wallet -H "Authorization: Bearer sk-bam-PASTE-YOUR-KEY-HERE"
   and answers in one line: my credit balance in dollars and my rate tier.
5. Reply with the model count and "ready".

Cursor / VS Code (Cline, Roo, Continue) / Open WebUI / SillyTavern

Choose OpenAI Compatible as the provider and fill in:

Base URL: https://badassmodel.com/v1

API Key: sk-bam-...

Model: any id from GET https://badassmodel.com/v1/models

Image generation

OpenAI-shaped POST /v1/images/generations. Billed flat per image returned (see pricing); n is capped at 4.

curl https://badassmodel.com/v1/images/generations \
  -H "Authorization: Bearer sk-bam-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-1-schnell",
    "prompt": "a cat riding a skateboard",
    "n": 1,
    "size": "1024x1024"
  }'

Returns {"created": ..., "data": [{"b64_json": "..."}]}.

Text to speech

OpenAI-shaped POST /v1/audio/speech. Billed per input character.

curl https://badassmodel.com/v1/audio/speech \
  -H "Authorization: Bearer sk-bam-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kokoro-82m",
    "input": "The quick brown fox jumps over the lazy dog"
  }' \
  --output speech.wav

Returns raw audio bytes (audio/wav or audio/mpeg).

Billing & limits

Prepaid credits only — $1 = 1 credit. Deposit via crypto (NOWPayments, no fee) or Whop (card, Apple Pay, more — 5% processing fee, so a $50 deposit adds 47.50 credits); $5 minimum. Every request is billed from your balance — per token for chat, per image for generations, per character for speech — no balance, no requests (HTTP 402). 60 requests/min per key. Deposit any amount from $5 up; a single deposit of $50+, $100+, or $200+ permanently unlocks lower rates (see pricing). All deposits are final — no refunds.