Quickstart
Go from zero to your first token-hub API call in under five minutes. Sign up, create a key, send a cURL request, and connect OpenAI-compatible or Anthropic Messages-compatible clients.
token-hub is an LLM API gateway with OpenAI Chat Completions, Anthropic Messages, and Responses-compatible routes behind one TokenHub key. This guide gets you from sign-up to a live response using an enabled model route.
Step 1 - Sign up
Open tokenhub.sandboxclaw.com/register and create an account with email. No phone number is required.
Verify your email if the console asks you to. That unlocks the dashboard.
Step 2 - Top up and create a key
From the dashboard, go to /topup. Public checkout is currently USD-only through Stripe, with topups starting at $5. Your card issuer or bank may handle any local currency conversion.
Then visit /keys and click New Key. Copy the full TokenHub key shown by the console. We hash the key server-side and cannot show it again; if you lose it, revoke and reissue.
Step 3 - Send your first OpenAI-compatible request
The OpenAI-compatible base URL is https://llm.sandboxclaw.com/v1.
curl https://llm.sandboxclaw.com/v1/chat/completions \
-H "Authorization: Bearer $TOKENHUB_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "moonshot-v1-8k",
"messages": [{"role": "user", "content": "Reply exactly ok"}],
"max_tokens": 8
}'
You get back an OpenAI-shaped response:
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "moonshot-v1-8k",
"choices": [
{ "index": 0, "message": { "role": "assistant", "content": "ok" }, "finish_reason": "stop" }
],
"usage": { "prompt_tokens": 12, "completion_tokens": 1, "total_tokens": 13 }
}
The usage block drives billing. Token counts come from the upstream channel and are passed through.
Step 4 - Use the OpenAI Python SDK
Override base_url and pass the TokenHub key:
from openai import OpenAI
import os
client = OpenAI(
base_url="https://llm.sandboxclaw.com/v1",
api_key=os.environ["TOKENHUB_KEY"],
)
resp = client.chat.completions.create(
model="moonshot-v1-8k",
messages=[{"role": "user", "content": "Reply exactly ok"}],
max_tokens=8,
)
print(resp.choices[0].message.content)
For streaming, set "stream": true. The response is a text/event-stream of OpenAI-compatible delta chunks terminated by data: [DONE].
Step 5 - Connect Claude Code-style clients
For Anthropic Messages-compatible clients, use the Anthropic-style base URL without /v1:
export ANTHROPIC_BASE_URL=https://llm.sandboxclaw.com
export ANTHROPIC_API_KEY=$TOKENHUB_KEY
claude --bare -p --model moonshot-v1-8k "Reply exactly ok"
Claude Code reaches /v1/messages with this configuration.
Step 6 - Know the current CLI status
- Claude Code: set
ANTHROPIC_BASE_URL=https://llm.sandboxclaw.comandANTHROPIC_API_KEY=$TOKENHUB_KEY. - OpenCode: configure an OpenAI-compatible provider with
baseURL: "https://llm.sandboxclaw.com/v1"and modelmoonshot-v1-8k. - DeepSeek-TUI: set
DEEPSEEK_API_KEY=$TOKENHUB_KEY,DEEPSEEK_BASE_URL=https://llm.sandboxclaw.com/v1, andDEEPSEEK_MODEL=moonshot-v1-8k. - Codex: configure TokenHub as a Responses provider. Model availability follows the API key’s enabled model list.
What to read next
- FAQ - policies, data handling, refunds, rate limits.
- Troubleshooting - common errors and how to fix them.
- Scenarios - end-to-end examples for integrating token-hub from your backend.