Use the Wokey API with Claude Code

Get a Wokey API key, point Claude Code at the Wokey base URL, then confirm the connection with one curl request.

vpn_key

Get an API key and the base URL

Every client uses the same Wokey API key and the same base URL.

Create an API key

Sign in and create a platform key on the API page. Keys in one account share its balance.

Create an API keykey

Use the Wokey base URL

Set the client base URL to the gateway domain; the configuration below shows whether to append /v1.

terminal

Configure the client

Point the client at Wokey with the configuration below.

Claude Code

Claude Code uses Anthropic-compatible environment variables and sends ANTHROPIC_AUTH_TOKEN as an Authorization Bearer token.

Claude Code
export ANTHROPIC_BASE_URL="https://api.wokey.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
claude
task_alt

Verify with curl

If the client reports an error, rule out the key and base URL with curl first.

Claude Code uses the Anthropic Messages format by default. A 200 from this request means the key and base URL are right. Replace YOUR_API_KEY with your key before sending it.

cURL
curl https://api.wokey.ai/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [
      { "role": "user", "content": "Hello" }
    ]
  }'
troubleshoot

Errors & Troubleshooting

Separate auth, balance, rate limit, model availability, and upstream timeout cases first.

401

invalid api key

The key is missing, mistyped, deleted, or Authorization / x-api-key headers conflict.

402

insufficient balance

The account balance is too low. Top up before sending more requests.

429

rate limited

Traffic is too frequent. Retry later or reduce concurrency.

502

upstream unavailable

The upstream model service is temporarily unavailable. Switch models or retry later.

504

upstream timeout

The upstream response timed out. Shorten context, reduce max_tokens, or retry.

529

upstream insufficient quota

The official upstream route is out of quota. Wait for routing recovery or switch models.