Codex CLI routing

Use Codex CLI with hosted, local, or Tailnet models

Point Codex at hosted TEKIZ.AI or local port 8790 and keep the same Responses API setup. TEKIZ.AI chooses a suitable model, switches when one fails, and keeps your provider keys on the router.

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

Works with the Responses API

Codex profiles can use wire_api = "responses", base_url = "https://api.tekiz.ai/v1/", and model = "tekizai/auto" for hosted routing.

Local and Tailnet routes

Run TEKIZ.AI on http://127.0.0.1:8790/v1/ or a Tailnet host when provider credentials, OAuth profiles, and local Ollama fallback should stay on trusted infrastructure.

Keep working when an account is busy

When a Codex route, provider key, or upstream model rate-limits, TEKIZ.AI can choose another working route. Codex profiles keep one routing configuration.

Set up Codex CLI setup

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

Use the same router with OpenClaw, local workspaces, Umbrel hosts, and Tailnet machines so Codex routing stays consistent across the fleet.

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

TEKIZ.AI keeps Codex pointed at one address while choosing a model that fits the task, checking availability and usage limits, and using local models when requested.

Next steps

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