Skip to main content
Use Codex through the Tokensmind API

Install

Official download (macOS)

https://openai.com/codex/

CLI

npm install -g @openai/codex

Environment / config

Config files

  1. Edit ~/.codex/config.toml:
profile = "Tokensmind"

[model_providers.Tokensmind]
name = "Tokensmind"
base_url = "https://tokensmind.ai/v1"
personality = "pragmatic"
wire_api = "responses"

[profiles.Tokensmind]
model = "gpt-5.2"
model_provider = "Tokensmind"
model_reasoning_effort = "high"
  1. Edit ~/.codex/auth.json:
{
  "OPENAI_API_KEY": "Tokensmind_API_KEY"
}

CC-Switch

  1. Open CC-Switch → add a provider.
Codex 1
  1. Pick Tokensmind from presets.
Codex 2
  1. Paste your API key → Add.
Codex 3
  1. Select Tokensmind on the home screen → Enable.
Codex 4

Using Codex

Terminal

  1. cd to your project, run codex.
cd /path/to/your/project
codex
  1. Set permissions as prompted.
Codex 5
  1. Choose a model.
Codex 6
  1. Type a natural-language task—if you get a reply, setup works.
Codex 8

Desktop app

  1. Open Codex, pick a workspace folder.
  2. Enter a task—if it responds, you’re good.
Codex 9

CLI reference

Help

codex -h

Options (excerpt)

Usage
  $ codex [options] <prompt>

Options
  -h, --help                 Show help and exit
  -m, --model <model>        Model to use (default: codex-mini-latest)
  -i, --image <path>         Path to an image input file
  -v, --view <rollout>       Inspect a saved rollout
  -q, --quiet                Non-interactive: print only final assistant output
  -a, --approval-mode <mode>  Override approval: 'suggest', 'auto-edit', or 'full-auto'

  --auto-edit                Auto-approve file edits; still confirm shell commands
  --full-auto                Auto-approve edits and commands in the sandbox

  --no-project-doc           Do not auto-include repo `codex.md`
  --project-doc <file>       Include a specific Markdown file as context
  --full-stdout              Do not truncate command stdout/stderr

Dangerous
  --dangerously-auto-approve-everything
                             Skip all confirmations and run commands (no sandbox)
                             For temporary local testing only

Experimental
  -f, --full-context         “Full context” mode: load the whole repo and batch-edit
                             Requires --model

Examples
  $ codex "Write and run a Python program that prints ASCII art"
  $ codex -q "Fix the build"