Codex CLI
OpenAI's command-line coding assistant, connectable to BeLive Studio via a custom model provider in config.toml.
Codex CLI is OpenAI's terminal coding agent. It runs locally and safely modifies your codebase with patch-based editing (apply_patch), sandbox policies and approval modes.
- Official site: https://chatgpt.com/codex
- Repository: https://github.com/openai/codex
Prerequisites
- Codex CLI installed (
npm i -g @openai/codex) - Base URL:
https://api.tokenhub.belivestudios.com - API Key: create one in "API Tokens" on the BeLive Studio Console
- Model name: e.g.
gpt-5.6-sol, exactly matching a model ID in the console model list
Edit the Config File
Edit ~/.codex/config.toml and add BeLive Studio as a custom model provider:
model_provider = "belive-studios"
model = "gpt-5.6-sol"
[model_providers.belive-studios]
name = "BeLive Studio"
base_url = "https://api.tokenhub.belivestudios.com"
env_key = "BELIVE_STUDIOS_API_KEY"
wire_api = "chat"About wire_api
BeLive Studio exposes an OpenAI-compatible Chat Completions API, so wire_api must be "chat" (not the default "responses").
Then set the environment variable (add to ~/.zshrc or system environment):
export BELIVE_STUDIOS_API_KEY="sk-your-belive-studios-key"Start Using
cd /path/to/your/project
codexUse /model to switch models. For first-time use, set the approval mode to on-request so Codex asks before writing files or running commands.
FAQ
unauthorized errors?
Make sure BELIVE_STUDIOS_API_KEY is exported and env_key in config.toml matches the variable name.
404 on requests?
Check that base_url ends with /v1 and wire_api = "chat" is set.
After switching the endpoint, all models go through the BeLive Studio gateway instead of your OpenAI account quota.