Skip to Content

Using with Codex CLI - MyTokenGate

Codex CLI  is OpenAI’s official terminal coding assistant. It supports custom model providers, so you can point requests at MyTokenGate’s OpenAI-compatible API.

Install Codex CLI

npm install -g @openai/codex

Configure MyTokenGate

Edit ~/.codex/config.toml, add a provider pointing at MyTokenGate, and set it as the default:

model = "gpt-5.4" model_provider = "mytokengate" [model_providers.mytokengate] name = "MyTokenGate" base_url = "https://gateway.mytokengate.com/v1" env_key = "MYTOKENGATE_API_KEY"

env_key names the environment variable to read the key from. Set it in your shell profile:

export MYTOKENGATE_API_KEY="your-api-key-here" # Get it from https://mytokengate.com/app/dashboard

Once configured, just run:

codex

Model Selection

Change model in config.toml to whichever model you need:

  • gpt-5.4 - General workhorse
  • gpt-5.6-sol - Flagship, for complex tasks
  • claude-sonnet-5 - Balanced default
  • See more at Model List 

Usage Tips

  • Use codex "describe your task" for one-off instructions
  • For complex changes, ask for a plan first, then approve before it executes
  • Monitor usage and spend in the MyTokenGate Console
Last updated on