Codex Integration
AIO Sandbox includes the OpenAI Codex CLI. Codex is a terminal-first AI coding agent, so you can run it directly inside the sandbox or launch it through the built-in terminal page.
Access
- Browser: open
http://localhost:8080/codexto redirect to the built-in terminal and startcodex - Terminal: run
codexinside the container
Environment Variables
You can generate the Codex configuration at container startup with environment variables:
For most setups, prefer CODEX_API_KEY.
Examples
Official OpenAI API:
Other Responses-compatible endpoint:
Fully custom Codex configuration:
Use CODEX_CONFIG_TOML when you need to provide any Codex-supported config.toml fields. Prefer referencing the API key through env_key instead of writing the secret value directly into TOML.
Configuration Priority
At startup, AIO Sandbox generates config.toml in this order:
CODEX_CONFIG_TOML- Auto-generated config from
CODEX_API_KEY/ARK_API_KEY/OPENAI_API_KEY - No generated config
When auto-generating the config, AIO Sandbox selects the API key in this order:
CODEX_API_KEYARK_API_KEYOPENAI_API_KEY
If no API key is available, AIO Sandbox does not generate or overwrite Codex configuration.
CODEX_CONFIG_TOML is validated as TOML, and CODEX_MODEL_CATALOG_JSON is validated as JSON. If validation fails, startup exits with an explicit error instead of silently falling back to another configuration.
User Customization
After startup, you can edit ~/.codex/config.toml directly. If the container is restarted with CODEX_CONFIG_TOML or one of the API key environment variables above, the startup script regenerates the configuration. To keep manual edits, restart without those environment variables.