RequestBeam

Documentation

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.

text
Codex base_url: https://api.requestbeam.com/openai

Prerequisites

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:

bash
mkdir -p ~/.codex
touch ~/.codex/config.toml

For Windows CMD:

bat
mkdir %userprofile%\.codex
type nul > %userprofile%\.codex\config.toml

Back Up Config

If you have used Codex before, back up the current config first:

bash
cp ~/.codex/config.toml ~/.codex/config.toml.bak
cp ~/.codex/auth.json ~/.codex/auth.json.bak

Update config.toml

Open ~/.codex/config.toml, then add or update this configuration:

toml
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 = true

The 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:

text
https://api.requestbeam.com/openai/responses

If 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.processed compatibility 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:

toml
[model_providers.requestbeam]
supports_websockets = false

[features]
responses_websockets = false

Codex 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:

bash
echo '{"OPENAI_API_KEY":"YOUR_REQUESTBEAM_API_KEY"}' > ~/.codex/auth.json

For Windows CMD:

bat
echo {"OPENAI_API_KEY":"YOUR_REQUESTBEAM_API_KEY"} > %userprofile%\.codex\auth.json

Restart and Test

Save the config, fully quit Codex, then open it again.

You can test the CLI with:

bash
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_url must be the public API Base URL shown on this page plus /openai.
  • wire_api must be responses; do not change it to chat.
  • 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 = true and responses_websockets = true by default. If your Codex version or network proxy cannot use WebSocket, temporarily set supports_websockets = false to fall back to HTTP.
  • auth.json must be valid JSON, and the key name must be OPENAI_API_KEY.
  • If you get 401 or invalid 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/models and set model and review_model to a visible GPT model. The default example uses gpt-5.4; gpt-5.3-codex and gpt-5.6-luna are not currently enabled.
  • Fully quit and reopen Codex after changing config. Closing only the window may not reload auth.json.
  • 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 returns response.compaction.
  • WS /openai/responses: Responses WebSocket-compatible endpoint. It supports response.create, response.cancel, returns response.completed, and keeps the response.processed compatibility event.
  • WS /openai/responses/compact: uses the same Compact capability check and endpoint. A WebSocket handshake alone does not prove model support.