Codex CLI routing

Connect Codex CLI to TEKIZ.AI

Use a TEKIZ.AI API key for hosted models. If you want to route through your own provider accounts or local models, run the router on your machine or Tailnet. Codex connects to either route through the Responses API.

Create API key Open Codex guide Agent-native routing Browse models

Start with hosted models

Create a TEKIZ.AI key and use the Codex profile below. Hosted requests use your TEKIZ.AI account and its available models and quota. You do not need a separate provider key to start.

Use your own router

Run TEKIZ.AI on http://127.0.0.1:8790/v1/ or a Tailnet host to use provider accounts, authorized OAuth profiles, or local Ollama models. Provider usage follows your own accounts and billing.

When a model reaches a limit

TEKIZ.AI can try another eligible model when one rate-limits or fails, if another eligible route is available in the deployment you chose.

Connect Codex CLI to hosted TEKIZ.AI

mkdir -p ~/.codex
if ! grep -Fqx '[model_providers.tekizai]' ~/.codex/config.toml 2>/dev/null; then
cat >> ~/.codex/config.toml <<'TOML'
[model_providers.tekizai]
name = "TEKIZ.AI hosted"
base_url = "https://api.tekiz.ai/v1/"
env_key = "TEKIZAI_API_KEY"
wire_api = "responses"
TOML
fi

cat > ~/.codex/tekizai.config.toml <<'TOML'
model_provider = "tekizai"
model = "tekizai/auto"
TOML

# Shell
export TEKIZAI_API_KEY=sk_tekiz_your_generated_key
# Plain codex keeps using ChatGPT. TEKIZ.AI is explicit.
codex --profile tekizai

Profiles built for coding tools

Coding profiles follow the tool's file and instruction requirements. TEKIZ.AI chooses among eligible providers by availability, speed, and model support.

OpenClaw-compatible

Run your own router for Codex and OpenClaw on local workspaces, Umbrel hosts, or Tailnet machines. Each client points to the router address you control.

Use accounts you are allowed to use

TEKIZ.AI can complete the official Codex device flow for an authorized OpenAI account. It never grants access on its own; bring your subscription or use hosted routing with a TEKIZ.AI API key.

Change routed models from one Codex profile

Keep the hosted profile above for TEKIZ.AI account models. For your own provider accounts or local models, create a separate Codex profile with the base URL of your local or Tailnet router. Each profile uses the models and limits of the deployment it points to.

Next steps

Create an API key, open the Codex guide, copy the hosted quickstart, or estimate routing fit.