TokenMaster

Documentation

Token Master is a drop-in base URL. Point any OpenAI, Anthropic or Gemini client at it and use your Token Master key.

Quickstart

  1. Create an account. Your dashboard is ready as soon as you sign up.
  2. Add credit in Wallet. Buy a package, or redeem a code you were given.
  3. Open API keys, click Create, and copy the sk-… key.
  4. Set your tool's base URL to . Add /v1 for OpenAI-format clients.
Before you wire a model into code, try it in the Playground.

Model IDs

Use model IDs exactly as they appear in the catalogue, for example claude-sonnet-4-6, claude-opus-4-8-thinking, gpt-5.6-terra or kimi-k3. If an ID ends in -thinking, that model uses extended reasoning. These usually cost more output tokens, but they handle multi-step work better.

Keys and limits

Use one key per project. Your logs stay readable, and if a key leaks only that project is affected.

Claude Code

export ANTHROPIC_BASE_URL=
export ANTHROPIC_AUTH_TOKEN=sk-your-key
export ANTHROPIC_MODEL=claude-sonnet-4-6
export ANTHROPIC_SMALL_FAST_MODEL=claude-haiku-4-5
claude

To make this permanent, add the same variables under "env" in ~/.claude/settings.json. Do not add /v1 to an Anthropic base URL.

Cursor

In Settings → Models, paste your key under OpenAI API Key. Then turn on Override OpenAI Base URL and set it to . Finally, add model IDs such as claude-sonnet-4-6 or gpt-5.6-terra under Add model.

Cline / Roo Code

Pick the OpenAI Compatible provider. Set the base URL to , add your key, and type the model ID. For Claude models you can also use the Anthropic provider with a custom base URL of .

Codex CLI

# ~/.codex/config.toml
model = "gpt-5.6-sol"
model_provider = "tokenmaster"

[model_providers.tokenmaster]
name = "Token Master"
base_url = "/v1"
env_key = "TOKENMASTER_API_KEY"

Run export TOKENMASTER_API_KEY=sk-your-key, then start codex.

Gemini (CLI and SDK)

export GOOGLE_GEMINI_BASE_URL=
export GEMINI_API_KEY=sk-your-key
gemini

With @google/genai, pass httpOptions: { baseUrl: "" }. Gemini models only show up here once they're listed in the catalogue.

OpenAI SDK (Python / Node)

from openai import OpenAI
client = OpenAI(base_url="/v1", api_key="sk-your-key")

stream = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Write a haiku about latency"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Anything built on the OpenAI SDK works the same way, including n8n, LangChain, LlamaIndex, OpenClaw and Hermes Agent.

Anthropic SDK

import anthropic
client = anthropic.Anthropic(base_url="", api_key="sk-your-key")
msg = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)

Balance and usage

curl /api/usage/token/ -H "Authorization: Bearer sk-your-key"

The response contains total_available and total_used in quota units, where 500,000 units equal $1. The balance checker does the conversion for you. For per-request detail (model, tokens, cost, latency), open Usage logs.

Errors

Support

Signed-in users can find the support channels in the dashboard. For a large-volume package or a dedicated channel pool, contact us through the dashboard and include your expected monthly token volume.