Codex CLI routing

Codex CLI router for hosted, local, and Tailnet model routing

Use Tekiz as the model-routing layer behind Codex CLI. Keep the OpenAI-compatible Responses wire format, point Codex at hosted Sage Router or local port 8790, and let route policy handle failover, capability matching, and provider custody.

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

Responses API profile

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

Local and Tailnet routes

Run Tekiz 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.

429 failover

When a Codex route, provider key, or upstream model rate-limits, Tekiz can choose another eligible route instead of forcing every Codex profile to encode fallback logic.

60-second Codex CLI setup

mkdir -p ~/.codex
cat > ~/.codex/sage-router.config.toml <<'TOML'
model_provider = "sage-router-hosted"
model = "sage-router/auto"

[model_providers.sage-router-hosted]
name = "Tekiz hosted"
base_url = "https://api.tekiz.ai/v1/"
env_key = "SAGE_ROUTER_API_KEY"
wire_api = "responses"
TOML

# Shell
export SAGE_ROUTER_API_KEY=sk_sage_your_generated_key
codex --profile sage-router

Tool-aware profiles

Agentic and frontier profiles keep coding-agent behavior strict while allowing eligible providers to compete on health, latency, capability, and policy.

OpenClaw-compatible

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

Provider boundary

Tekiz 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 API key.

Codex without hardcoded model switching

Codex CLI is most useful when the model layer can adapt to the task. Tekiz keeps Codex pointed at one endpoint while routing by policy, capability, provider health, local availability, and quota state behind the scenes.

Next steps

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