Using the API
Point Claude Code, an SDK or curl at ClaudeBall instead of Anthropic. Two lines change.
ClaudeBall speaks the Anthropic Messages API. Anything that already talks to Anthropic works by changing where it sends requests and which token it sends — the request body, the tools, the streaming format are all untouched.
Your key#
You never receive an Anthropic key; those cannot be handed out programmatically. ClaudeBall holds a single one server-side and issues you its own, bound to your wallet. Find it on the API tab, rotate it there whenever you want.
The key and the chat draw on the same daily credits. One wallet, one quota — spending it in Claude Code leaves less for the chat, and the other way round.
Claude Code#
Two environment variables. They are named ANTHROPIC_ because Claude Code named them, not because the value has to be an Anthropic key — they mean "where do I send requests" and "what token do I send".
export ANTHROPIC_BASE_URL=https://claudeball.app export ANTHROPIC_AUTH_TOKEN=cb_live_your_key_here claude
To keep your own account for other work, wrap it in a shell function instead of exporting globally:
claudeball() {
ANTHROPIC_BASE_URL=https://claudeball.app \
ANTHROPIC_AUTH_TOKEN=cb_live_your_key_here \
claude "$@"
}SDK#
Every Anthropic SDK takes a base URL. Nothing else about your code changes.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://claudeball.app",
authToken: "cb_live_your_key_here",
});Straight over HTTP#
curl https://claudeball.app/v1/messages \
-H "Authorization: Bearer cb_live_your_key_here" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'Endpoints#
| Endpoint | Method | Metered |
|---|---|---|
| /v1/messages | POST | yes |
| /v1/messages/count_tokens | POST | no |
| /v1/models | GET | no |
Counting tokens and listing models are free because Anthropic does not bill for them. A valid key is still required. Models you cannot reach at your tier are not listed at all, so a client never offers you something that will fail.
Reading your spend#
Every metered response carries what it cost and what is left, so a client can show the running balance without a second request.
x-claudeball-credits-used: 4.512 x-claudeball-credits-left: 127.488
Cost is metered on real token counts, not a flat per-request estimate — a long context costs more than a short one. When credits hit zero, requests return 429 until 00:00 UTC.
