All docs

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
# ~/.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_url
https://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 uses POST /v1/responses.

Check that it works

  1. Run export SIXBEE_API_KEY=<your key>.
  2. Start codex in a project folder and send a short message.
  3. 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:

  • store and previous_response_id are 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/models or check the console.
HTTP 429
You are over a per-account limit (requests, input tokens or concurrency). The Retry-After header 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_tokens of output. Top up, or lower max_tokens.
Codex asks for an OpenAI login
Check that model_provider = "sixbee" is at the top level of config.toml and that SIXBEE_API_KEY is exported in the same shell.