Clients/Codex
Use the Wokey API with Codex
Get a Wokey API key, point Codex 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
Codex CLI and the Codex desktop app share the same configuration, so the setup below applies to both. Codex uses the Responses protocol. Keep base_url at the gateway origin, without /responses. Replace YOUR_API_KEY with your Wokey API key in experimental_bearer_token, without a Bearer prefix. Remove any existing env_key setting; no environment variable export is needed. Save the file and run codex. The key is stored in plain text in the local config.
# ~/.codex/config.toml
model = "gpt-6-sol"
model_provider = "wokey"
[model_providers.wokey]
name = "Wokey"
base_url = "https://api.wokey.ai"
experimental_bearer_token = "YOUR_API_KEY"
wire_api = "responses"
# shell
codexAPI 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 |
|---|---|---|
| OpenAI Responses | https://api.wokey.ai | GPT models |
Where it is configured: ~/.codex/config.toml
Verify with curllink
If the client reports an error, rule out the key and base URL with curl first.
Codex 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.
curl https://api.wokey.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-sol",
"instructions": "You are a helpful assistant.",
"input": [
{ "role": "user", "content": "Hello" }
],
"store": false,
"stream": false
}'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 the Codex base_url end in /v1 or /responses?
- Neither. Set base_url to https://api.wokey.ai. Codex appends /responses itself, so adding it by hand doubles the path.
- Does experimental_bearer_token need the word Bearer?
- No. Paste the Wokey API key on its own, and delete the old env_key line so no environment variable is needed.
- What goes in wire_api?
- responses. Codex speaks the OpenAI Responses format, which is how GPT models are called on Wokey.
Setup and error guideslink
- Codex config.toml for a Custom API Provider: Responses Only Since 2026
A complete config.toml for a custom Codex provider. wire_api = "chat" was removed in February 2026; here is the timeline, the exact error text, and a troubleshooting checklist.
- Codex Through a Relay vs Official: Features, Pricing and Data Compared
A relay is Codex's custom-provider mode: local coding works the same, while cloud tasks, /status limits, Fast mode and server-side compaction differ. Includes a price comparison and a setup for using both.