Codex
The Codex CLI, desktop app and IDE extension share one config; the key is read from an environment variable.
- API key (Bearer)
- OAuth sign-in
Store the key in an environment variable
· macOS / Linuxexport AICHARGED_API_KEY="<API_KEY>"
Add the export line to your shell profile (e.g. ~/.zshrc) so new terminals see the key too.
Store the key in an environment variable — Windows (PowerShell)
· Windows[Environment]::SetEnvironmentVariable("AICHARGED_API_KEY", "<API_KEY>", "User")
One command
Recommendedcodex mcp add aicharged --url https://aicharged.io/api/v1/mcp --bearer-token-env-var AICHARGED_API_KEY
Config file
~/.codex/config.toml
[mcp_servers.aicharged]
url = "https://aicharged.io/api/v1/mcp"
bearer_token_env_var = "AICHARGED_API_KEY"
Config with the key inline
~/.codex/config.toml
[mcp_servers.aicharged]
url = "https://aicharged.io/api/v1/mcp"
http_headers = { "Authorization" = "Bearer <API_KEY>" }
Sign in with OAuth
codex mcp add aicharged --url https://aicharged.io/api/v1/mcp
codex mcp login aicharged