Clients/Claude Code
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.
Updated
On this pageexpand_more
Get an API key and the base URLlink
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 keykeyUse the Wokey base URL
Set the client base URL to the gateway domain; the configuration below shows whether to append /v1.
Configure the clientlink
Claude Code uses Anthropic-compatible environment variables and sends ANTHROPIC_AUTH_TOKEN as an Authorization Bearer token.
export ANTHROPIC_BASE_URL="https://api.wokey.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
claudeAPI formats and base URLslink
When one client switches API format, whether the base URL ends in /v1 can change.
| Format | Base URL | Use it for |
|---|---|---|
| Anthropic Messages | https://api.wokey.ai | Claude models |
Where it is configured: Environment variables, or env in ~/.claude/settings.json
Verify with curllink
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 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" }
]
}'Errors & Troubleshootinglink
Separate auth, balance, rate limit, model availability, and upstream timeout cases first.
invalid api key
The key is missing, mistyped, deleted, or Authorization / x-api-key headers conflict.
insufficient balance
The account balance is too low. Top up before sending more requests.
model_denylisted / account_restricted
Calls to the model, or to every model on the account, are paused after repeated violations. See Violation Handling Fees & Restrictions.
request_blocked
This request was blocked before reaching the upstream and is not charged, for example an unchanged resend of a request the model just refused, or a paused end user (X-End-User-Id). The error message says what is blocked; change the request as it says or retry later. Other requests are not affected.
rate limited
Traffic is too frequent. Retry later or reduce concurrency. If only one model, or one end user (X-End-User-Id), keeps returning 429, it may be a temporary limit after violations.
client disconnected
The client closed the connection before the response finished (code downstream_aborted). This is free by default. Once an account has at least 50 client disconnects in the past 24 hours and they make up 10% or more of its requests, later disconnected requests are billed for the usage the upstream reported: the processed input, including cache reads and writes, and output only when the upstream counted it. A disconnect before the upstream reported any usage stays free. The account is notified when billing starts, and billing stops automatically within an hour once the disconnect rate is back to normal. The usual cause is a client or proxy timeout that is too short, or a program that cancels requests before they finish.
upstream unavailable
The upstream model service is temporarily unavailable. Switch models or retry later.
upstream timeout
The upstream response timed out. Shorten context, reduce max_tokens, or retry.
upstream overloaded
The upstream model is temporarily overloaded and Wokey already retried on other routes (code upstream_overloaded). It is unrelated to your balance. Retry shortly or switch models.
Frequently asked questionslink
- Should ANTHROPIC_BASE_URL for Claude Code end in /v1?
- No. Use https://api.wokey.ai. Claude Code appends /v1/messages itself, so a base URL ending in /v1 becomes /v1/v1/messages and returns 404.
- ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY?
- Use ANTHROPIC_AUTH_TOKEN; Claude Code sends it as Authorization: Bearer. If an old ANTHROPIC_API_KEY is still set, unset it first, because two headers that disagree return 401.
- How do I keep the configuration in new terminals?
- Put the two export lines in ~/.zshrc or ~/.bashrc, or add them to the env field of ~/.claude/settings.json, which Claude Code reads on every start.
Setup and error guideslink
- Claude "Invalid signature in thinking block" (400): Causes and Fixes
A thinking block in the history failed verification: its signature isn't one Claude issued, or the conversation before it changed. The usual trigger is switching to Claude mid-session after another provider. Both message variants, how Claude Code recovers, and code that strips thinking blocks.
- Claude Code "OAuth authentication is currently not allowed for this organization": Causes and Fixes
A server-side organization setting, so reinstalling and logging in again don't help. Causes by account type: billing and organization mix-ups on Pro/Max, seats and admin settings on Team/Enterprise. Includes every wording Claude Code shows and how to keep working with an API key.
- Claude Code Base URL: Setting ANTHROPIC_BASE_URL the Right Way
ANTHROPIC_BASE_URL takes the origin without /v1. AUTH_TOKEN vs API_KEY, settings.json, the VS Code extension and the desktop app, with real error responses.
- Claude Code "invalid x-api-key": Your Request Went to Anthropic
"invalid x-api-key" means ANTHROPIC_BASE_URL was not applied and the request went to api.anthropic.com. Fixes for the terminal, settings.json, VS Code, the desktop app and the SDK, with real responses.
- Claude Code 529 Overloaded: Causes, Retry Settings and Fixes
A 529 means the upstream model is overloaded, not that you ran out of quota. Claude Code retries 10 times; how gateways handle 529, how it differs from 429/503/402, and how to tune retries or switch models.
- Claude Code "Request timed out": API_TIMEOUT_MS and Proxy Fixes
Timeouts are rarely a slow model; usually a proxy buffers the stream or cuts idle connections. Test streaming with curl, check your proxy, tune API_TIMEOUT_MS, and read what each gateway 504 code means.
- Claude Code VS Code Extension with a Third-Party API: environmentVariables Setup
The VS Code extension ignores variables exported in your shell, and settings.json alone keeps showing the sign-in screen. Use claudeCode.environmentVariables plus disableLoginPrompt; JetBrains setup and troubleshooting included.