Setup guide · Claude Code

Claude Code setup: run it on a custom API key

Claude Code speaks the Anthropic Messages API, and MiniStaff serves it at /v1/messages. Three settings and Claude Code runs on a prepaid key — Claude Sonnet 5.5 at $1.00 / $5.00 per 1M tokens, exactly half the official price, with no subscription and no weekly meter.

Before you start

The settings

The reliable way is the env block in your Claude Code settings file, ~/.claude/settings.json — it is picked up on every launch, from any folder. Add:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.ministaff.pro",
    "ANTHROPIC_AUTH_TOKEN": "msst_your_key_here",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}

Check it works

  1. From any project folder, run: claude --print "Reply with exactly: OK" — you should get a short reply, not an API error.
  2. Open your MiniStaff dashboard — the call appears there with its model, token counts and cost, so you can watch the meter yourself.

Prefer to test the endpoint directly first? The same route Claude Code calls, from a terminal:

curl https://api.ministaff.pro/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: msst_your_key_here" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 16,
    "messages": [{"role": "user", "content": "Reply with exactly: OK"}]
  }'

Use any of the 19 models

Set ANTHROPIC_MODEL (and the matching default slot) to any ID from the model list:

Model IDInput / 1MOutput / 1MGood for
claude-haiku-5-5$0.05$0.25Fast, cheap background work
claude-sonnet-5-5$1.00$5.00Everyday serious coding
claude-opus-5-5$2.00$10.00The hardest problems
deepseek-v4.1-flash$0.075$0.30Cheap bulk edits

The full list is in the docs and at GET /v1/models. Two billing details that matter in long Claude Code sessions: Claude Code reuses a large cached prompt prefix turn after turn, and cached input is billed at 1/10 of the normal input rate here — repeat turns cost far less than the first. MiniStaff stores billing metadata, not prompt or response content.

Troubleshooting

ErrorWhat it meansFix
401 “Invalid or revoked credential”Key missing, mistyped or revokedRe-paste the key from the dashboard, or create a new one
402 insufficient_quotaWallet balance is $0Top up — the same key resumes working
404 / “model may not exist”Base URL has /v1 in it, so Claude Code called /v1/v1/messagesSet ANTHROPIC_BASE_URL to https://api.ministaff.pro exactly
400 “Model not available”A model name Claude Code sent is not on the MiniStaff listSet ANTHROPIC_MODEL and both default-model variables as above
429 rate_limit_error60 requests/minute per account, or a daily cap on a workhorse modelWait a few seconds and retry

Still stuck? Write to [email protected].