TokenOff
OpenAI

Codex

Use TokenOff OpenAI model service in Codex Agent.

OpenAI provides the Codex coding Agent. TokenOff's OpenAI model service can be used in three ways:

  • Codex App
  • IDE Extension
  • Codex CLI

The configuration is essentially the same for all three.

Get API Key

Go to the API Keys page to create your API key.

Configuration

Codex supports global configuration via the .codex directory in the user's home directory.

On macOS and Linux it is ~/.codex; on Windows it is typically C:\Users\<username>\.codex.

  • Create a configuration file config.toml in the .codex directory with the following content:

    model = "gpt-5.3-codex"
    model_provider = "tokenoff"
    
    [model_providers.tokenoff]
    name = "TokenOff Chat Completions API"
    base_url = "https://tokenoff.com/api/v1"
    requires_openai_auth = false
    env_key = "TOKENOFF_API_KEY"
    http_headers = { "X-Api-Key" = "<your-api-key-here>" }

    Two authentication methods are provided: env_key and http_headers. Choose one as needed.

    Use only one method and remove the other from the config.

    • With env_key: the value is the environment variable name. It can be customized as long as it meets system naming requirements. Before using Codex, add the variable to your user profile:

      export TOKENOFF_API_KEY=<your-api-key-here>
    • With http_headers: the header name must be X-Api-Key (case-sensitive).

  • model specifies the default model. It is optional.

Codex also supports project-level configuration. Create a .codex directory in the project root and add a config.toml file. Project-level config takes precedence over global config.

VSCode

OpenAI provides a VSCode extension — Codex – OpenAI's coding agent.

Install the extension, then add global or project config as described above.

If using environment variable authentication, ensure the variable is added to your user profile.

Codex CLI

Install with:

npm install -g @openai/codex

After installation, add global or project config as described above, then run the codex command.

Codex App

Currently supports macOS and Windows. Follow the official docs to install.

Codex documentation has regional restrictions. If you encounter a 403 error, use a VPN.

Best Practices

See the official Best Practices guide for tips on using Codex effectively.

Due to regional restrictions on the official docs, we have mirrored the best practices at github.

Contact Us

If you encounter any issues while using TokenOff:

On this page