Codex with 6bee.ai
Codex speaks the OpenAI Responses format. Add 6bee.ai as a model provider in its config file and it runs on 6bee.ai models.
Before you start
- Codex CLI installed (
npm install -g @openai/codex). - Create an account with a verified email address, add prepaid balance, then create a key on the console's API keys page. Keep the key secret.
- Model IDs are listed in the console and returned by
GET https://api.6bee.ai/v1/models. Replace<model id>with one of them.
Add the provider
Put this in ~/.codex/config.toml, then export your key as SIXBEE_API_KEY:
# ~/.codex/config.toml, then: export SIXBEE_API_KEY=<your key>
model = "<model id>"
model_provider = "sixbee"
[model_providers.sixbee]
name = "6bee"
base_url = "https://api.6bee.ai/v1"
env_key = "SIXBEE_API_KEY"
wire_api = "responses" base_urlhttps://api.6bee.ai/v1, with/v1.env_key- The name of the environment variable that holds your key. The key itself stays out of the file.
wire_api"responses": Codex usesPOST /v1/responses.
Check that it works
- Run
export SIXBEE_API_KEY=<your key>. - Start
codexin a project folder and send a short message. - The request shows up in the console’s usage log.
What the Responses endpoint supports
Codex sends the full input on every turn, which is what 6bee.ai expects. Server-side conversation state is not kept, in line with not storing conversations:
storeandprevious_response_idare not supported.- WebSocket mode is not supported. Streaming uses server-sent events.
Limits
- Context
- Input plus output up to the model’s window: 128K to 1M tokens, depending on the model.
- Output
- max_tokens up to the model’s output cap: 16,384 to 131,072, depending on the model. Larger values are lowered to the cap, not rejected. If omitted: 8,192 to 32,768.
- Input tokens
- 1,000,000 uncached tokens per rolling minute. Cache hits don’t count.
- Requests
- 60 per minute.
- Concurrency
- 2 requests at a time.
- Request body
- Up to 8 MiB. n must be 1.
Over a limit you get HTTP 429 with Retry-After, or 400 when a request can’t fit the context. A lowered output cap is reported in the X-6bee-Output-Cap response header; on /v1/messages a thinking budget is lowered with it.
Troubleshooting
- HTTP 401
- The key is missing or wrong. Copy it again from the console, without spaces or quotes.
- Model not found
- The model ID does not match. List the valid IDs with
GET /v1/modelsor check the console. - HTTP 429
- You are over a per-account limit (requests, input tokens or concurrency). The
Retry-Afterheader says how long to wait. - HTTP 400 on long sessions
- The request no longer fits the model’s context window. Compact or clear the conversation, or switch to a model with a larger window.
- Request rejected for balance
- Each request first reserves its input plus
max_tokensof output. Top up, or lowermax_tokens. - Codex asks for an OpenAI login
- Check that
model_provider = "sixbee"is at the top level ofconfig.tomland thatSIXBEE_API_KEYis exported in the same shell.