Step 1 / Choose your route
Connect Codex to TEKIZ.AI.
Use a TEKIZ.AI account key for the hosted API, or run the local router with provider credentials you control. The setup below uses a separate Codex profile, so your usual Codex setup stays in place.
Already have an account? Finish key setup.Step 2
Add a separate profile for the hosted API
Replace the placeholder with the sk_tekiz_* key from
your account. The command adds a TEKIZ.AI provider if needed and
writes separate profile files. Codex uses TEKIZ.AI when you run
it with the matching --profile command.
Leave your default provider in ~/.codex/config.toml
unchanged. Running codex uses that default;
codex --profile tekizai uses TEKIZ.AI. Keep
model_provider and oss_provider out of
the root settings if you want this opt-in behavior.
Configure one authentication method per provider. Use
env_key or [model_providers.tekizai.auth],
and do not configure both. Codex reports
provider auth cannot be combined with env_key when both
are present.
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
mkdir -p ~/.codex/model-catalog
curl -fsSL https://tekiz.ai/models/catalog/tekizai.json \
-o ~/.codex/model-catalog/tekizai.json
cat > ~/.codex/tekizai.config.toml <<'TOML'
model_provider = "tekizai"
model = "tekizai/auto"
model_catalog_json = "~/.codex/model-catalog/tekizai.json"
model_auto_compact_token_limit = 75000
TOML
cat > ~/.codex/tekizai-frontier.config.toml <<'TOML'
model_provider = "tekizai"
model = "tekizai/frontier"
model_catalog_json = "~/.codex/model-catalog/tekizai.json"
model_auto_compact_token_limit = 180000
TOML
export TEKIZAI_API_KEY=sk_tekiz_your_key_here
Step 3
Check your key and available models
Run the model-list request before using the new profile for real work. A successful response confirms that this key can reach the hosted API and shows which models your account can use.
curl https://api.tekiz.ai/v1/models \
-H "Authorization: Bearer $TEKIZAI_API_KEY"
codex --profile tekizai
Optional / Fusion
Use parallel review when the work separates cleanly.
Fusion assigns independent numbered tasks to smaller workers, then returns one reviewed answer. Use it for planning, investigation, review, or a final written synthesis.
Keep tekizai/frontier for Codex turns that need to
run tools or edit files. Fusion deliberately keeps client tools
out of parallel worker calls.
# Run the Hosted Codex setup first, then paste this.
mkdir -p ~/.codex
cat > ~/.codex/tekizai-fusion.config.toml <<'TOML'
model_provider = "tekizai"
model = "tekizai/fusion"
model_catalog_json = "~/.codex/model-catalog/tekizai.json"
model_auto_compact_token_limit = 180000
TOML
codex --profile tekizai-fusion
Run Codex through your own local or Tailnet router
Local profile
Connect to the router on this computer
Set up your authorized provider credentials on the router host first. Follow the local router guide, then use this Codex profile.
mkdir -p ~/.codex
if ! grep -Fqx '[model_providers.tekizai-local]' ~/.codex/config.toml 2>/dev/null; then
cat >> ~/.codex/config.toml <<'TOML'
[model_providers.tekizai-local]
name = "TEKIZ.AI Local"
base_url = "http://127.0.0.1:8790/v1/"
env_key = "TEKIZAI_API_KEY"
wire_api = "responses"
TOML
fi
cat > ~/.codex/tekizai-local-frontier.config.toml <<'TOML'
model_provider = "tekizai-local"
model = "tekizai/frontier"
TOML
export TEKIZAI_API_KEY=local
codex --profile tekizai-local-frontier
Tailnet profile
Connect to a router on your Tailnet
Replace <tailnet-host> with the private host running your router. Use the client credential configured for that router.
mkdir -p ~/.codex
if ! grep -Fqx '[model_providers.tekizai-tailnet]' ~/.codex/config.toml 2>/dev/null; then
cat >> ~/.codex/config.toml <<'TOML'
[model_providers.tekizai-tailnet]
name = "TEKIZ.AI Tailnet"
base_url = "http://<tailnet-host>:8790/v1/"
env_key = "TEKIZAI_API_KEY"
wire_api = "responses"
TOML
fi
cat > ~/.codex/tekizai-tailnet-frontier.config.toml <<'TOML'
model_provider = "tekizai-tailnet"
model = "tekizai/frontier"
TOML
export TEKIZAI_API_KEY=local
codex --profile tekizai-tailnet-frontier
| Status | Likely cause | Next action |
|---|---|---|
provider auth cannot be combined with env_key
|
The selected provider block contains both env_key
and nested auth configuration.
|
Remove one method. Use env_key or
[model_providers.<id>.auth], and do not set both.
|
| 401 | The Codex environment variable is missing, revoked, or not the key expected by the selected provider. |
Check env_key, regenerate a hosted
sk_tekiz_* key, or set the local router token.
|
| 402 | The hosted account plan, quota, or billing state blocks model traffic. | Finish checkout, choose a plan, or review usage on the account page. |
| 429 | The account or router is rate limited. | Reduce Codex concurrency, retry later, or upgrade the hosted plan limit. |
| 503 | No authorized healthy backend route is currently available. | Check public status for hosted requests. For local requests, check router health and the provider credentials on your router host. |
For response headers, safe curl probes, and no-secret support context, use the hosted API troubleshooting page.
Download the Codex model catalog from
/models/catalog/tekizai.json.
Install it with model_catalog_json and set
model_auto_compact_token_limit below the route context
window so long sessions compact before the context limit is
reached.
Support boundary
Keep prompts and secrets out of support requests.
Do not paste prompts, provider credentials, OAuth tokens, generated API keys, private keys, session cookies, raw provider responses, or customer data into public support channels. Safe troubleshooting context is limited to account email, plan, timestamp, request id, HTTP status, safe error class, and non-secret key prefix.