Skip to main content

Codex deployment

Codex-like tools typically support OpenAI-compatible APIs. Set the Base URL to the address shown under User Center > API Keys, then enter your API Key.

Example​

export OPENAI_API_KEY="Your MuskAI API Key"
export OPENAI_BASE_URL="Base URL copied from the official website User Center - [API Key] page"

Common startup methods​

If you just want to reduce the confirmation prompt but still keep the sandbox bounds, you can use:

codex --ask-for-approval never

If you definitely need to completely let go of sandbox and approval, you can use:

codex --dangerously-bypass-approvals-and-sandbox

This mode is the riskiest and is only recommended if you clearly understand the execution environment and file permissions.

/goal mode​

At the end of ~/.codex/config.toml add:

[features]
goals = true

You can also execute:

codex features enable goals

When performing tasks non-interactively, you can choose according to permission requirements:

codex exec --full-auto "<task>"
codex exec --sandbox danger-full-access "<task>"

Codex configuration example screenshot

Check items​

  • Whether the tool reads the environment variables of the current shell.
  • Whether the Base URL is consistent with the official website user center - [API Key] page display.
  • Whether the default model is available in the MuskAI console.