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.
Grok CLI
Use the official Grok CLI config to connect to Wokey. Add a grok-4.7 model entry with its own api_key; the api_key in a model entry takes precedence over the grok login session, so Responses requests go to the Wokey gateway.
If the client reports an error, rule out the key and base URL with curl first.
Grok CLI uses the OpenAI Responses 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.
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 overloaded
The upstream model is temporarily overloaded and Wokey already retried on other routes (code upstream_unavailable). It is unrelated to your balance. Retry shortly or switch models.