Clients/Z Code

Use the Wokey API with Z Code

Get a Wokey API key, point Z 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 keykey

Use the Wokey base URL

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

Configure the clientlink

Z Code adds custom providers on its settings page and supports both the Anthropic and OpenAI API formats. Use the Anthropic format for Claude models.

  1. 1

    Open model settings

    Click the model name in the chat box → Manage Models, or go to Settings → Model Settings.

  2. 2

    Add the provider

    Click Add Provider and name it Wokey. For the Anthropic format set Base URL to https://api.wokey.ai; for the OpenAI format set it to https://api.wokey.ai/v1. Paste your Wokey API key into API Key.

  3. 3

    Add and enable a model

    Under the provider, click Add Model, enter a model ID such as claude-opus-5-5, and turn on its enable switch.

  4. 4

    Switch models

    Back in the chat box, pick the model you added from the model list and send a short message to confirm.

Z Code
Provider name: Wokey
API format: Anthropic
Base URL: https://api.wokey.ai
API Key: YOUR_API_KEY
Model ID: claude-opus-5-5

API formats and base URLslink

When one client switches API format, whether the base URL ends in /v1 can change.

FormatBase URLUse it for
Anthropic Messageshttps://api.wokey.aiClaude models
OpenAI Chat Completionshttps://api.wokey.ai/v1DeepSeek, GLM, Kimi, and other models

Where it is configured: Settings → Model Settings (file ~/.zcode/v2/config.json)

Verify with curllink

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

Z 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" }
    ]
  }'

Errors & Troubleshootinglink

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.

403

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.

403

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.

429

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.

499

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.

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_overloaded). It is unrelated to your balance. Retry shortly or switch models.

Frequently asked questionslink

Should the Z Code base URL end in /v1?
It depends on the API format you connect with. For Anthropic use https://api.wokey.ai with no /v1; for OpenAI use https://api.wokey.ai/v1.
Why are the environment variables I exported in a terminal ignored?
Terminal environment variables and the Z Code desktop model setup are separate and are not synced. Enter the base URL and API key in the provider under Settings → Model Settings.
The provider is added. Why can't I pick a model?
Each provider also needs Add Model with a model ID, and the model's enable switch turned on, before it shows up in the chat box model list.
What if output is cut off or the context is too small?
Open Advanced on the model and adjust Max output tokens and the context window to the values on the model page. A newly added model defaults to a 200000 context window.
Where does Z Code store this configuration?
In ~/.zcode/v2/config.json. Back the file up before moving machines or reinstalling; it contains your API key, so do not share it.