RequestBeam Docs
Codex Integration
Use RequestBeam's OpenAI Responses-compatible endpoint in Codex CLI, the VS Code extension, or the desktop app.
Codex calls models through the OpenAI Responses protocol. Configure the model provider with the OpenAI-compatible Base URL shown on this page.
Codex base_url: https://api.requestbeam.com/openaiPrerequisites
Prepare a valid RequestBeam API Key first. The key will be written to your local Codex config directory. Do not commit it to repositories, logs, or screenshots.
Codex usually stores config files in:
- macOS / Linux:
~/.codex/ - Windows:
%userprofile%\.codex\
If the directory or config file does not exist, create it first:
mkdir -p ~/.codex
touch ~/.codex/config.tomlFor Windows CMD:
mkdir %userprofile%\.codex
type nul > %userprofile%\.codex\config.tomlBack Up Config
If you have used Codex before, back up the current config first:
cp ~/.codex/config.toml ~/.codex/config.toml.bak
cp ~/.codex/auth.json ~/.codex/auth.json.bakUpdate config.toml
Open ~/.codex/config.toml, then add or update this configuration:
model_provider = "requestbeam"
model = "gpt-5.4"
review_model = "gpt-5.4"
model_reasoning_effort = "high"
disable_response_storage = true
network_access = "enabled"
[model_providers.requestbeam]
name = "RequestBeam"
base_url = "https://api.requestbeam.com/openai"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = true
websocket_connect_timeout_ms = 15000
[features]
responses_websockets = trueThe base_url rule is: the public API Base URL shown on this page + /openai.
If your config.toml already contains [marketplaces.*], [plugins.*], or other tool settings, keep them and only add or update the Codex model provider settings above.
WebSocket Mode
When supports_websockets = true and responses_websockets = true are enabled, Codex uses the Responses WebSocket endpoint shown below:
https://api.requestbeam.com/openai/responsesIf the API Base URL uses https://, Codex uses the corresponding wss:// connection.
This WebSocket mode is a Codex-specific Responses-over-WebSocket bridge:
- Supports
response.create - Supports
response.cancel - Returns
response.completed - Also keeps the
response.processedcompatibility event
response.cancelled acknowledges the local cancellation request. It does not confirm an upstream refund. A request whose upstream result is unknown remains reserved until its usage or failure is verified.
It is not the OpenAI Realtime API. It does not support session.update, conversation.item.*, input_audio_buffer.*, audio streaming, binary messages, or Realtime envelopes.
If a network proxy, corporate gateway, or older Codex version cannot establish WebSocket connections, temporarily switch to:
[model_providers.requestbeam]
supports_websockets = false
[features]
responses_websockets = falseCodex will then fall back to HTTP POST https://api.requestbeam.com/openai/responses. Compact is a separate capability: the currently listed five GPT models have no verified Compact channel. Switching HTTP/WebSocket modes does not enable compaction. Start a new conversation before exceeding the model's context limit; do not depend on automatic long-context compaction with these routes.
Write API Key
Replace YOUR_REQUESTBEAM_API_KEY with your RequestBeam API Key:
echo '{"OPENAI_API_KEY":"YOUR_REQUESTBEAM_API_KEY"}' > ~/.codex/auth.jsonFor Windows CMD:
echo {"OPENAI_API_KEY":"YOUR_REQUESTBEAM_API_KEY"} > %userprofile%\.codex\auth.jsonRestart and Test
Save the config, fully quit Codex, then open it again.
You can test the CLI with:
codex "Reply in one sentence whether the current model is available."For the VS Code extension or desktop app, fully quit the app, reopen it, then start a normal chat.
Troubleshooting
base_urlmust be the public API Base URL shown on this page plus/openai.wire_apimust beresponses; do not change it tochat.- A Compact-unavailable error means there is no verified Compact channel; changing a local token threshold cannot enable it.
- RequestBeam supports both HTTP Responses and Codex Responses WebSocket. Keep
supports_websockets = trueandresponses_websockets = trueby default. If your Codex version or network proxy cannot use WebSocket, temporarily setsupports_websockets = falseto fall back to HTTP. auth.jsonmust be valid JSON, and the key name must beOPENAI_API_KEY.- If you get
401orinvalid key, confirm that the API Key is valid and was not overwritten by an older local key. - If the model is unavailable, check
GET https://api.requestbeam.com/v1/modelsand setmodelandreview_modelto a visible GPT model. The default example usesgpt-5.4;gpt-5.3-codexandgpt-5.6-lunaare not currently enabled. - Fully quit and reopen Codex after changing config. Closing only the window may not reload
auth.json.
Related Endpoint
POST https://api.requestbeam.com/openai/responses: the recommended RequestBeam Responses-compatible endpoint.POST https://api.requestbeam.com/openai/responses/compact: requires an explicitly enabled Compact channel; otherwise returns 503 before reservation. A supported channel returnsresponse.compaction.WS /openai/responses: Responses WebSocket-compatible endpoint. It supportsresponse.create,response.cancel, returnsresponse.completed, and keeps theresponse.processedcompatibility event.WS /openai/responses/compact: uses the same Compact capability check and endpoint. A WebSocket handshake alone does not prove model support.