config-codex-cli
What it does
This skill is a step-by-step guide for connecting the Codex command line tool to OmniRoute. It is for developers who want Codex to send its requests through OmniRoute on a common operating system.
When to use it
- βWhen a user wants to use the Codex CLI with OmniRoute as its backend.
- βWhen a user needs Codex set up on Windows, macOS or Linux.
- βWhen a user plans long, multi-hour Codex sessions and wants them to stay stable.
Skill link
https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/config-codex-cli/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up the Codex CLI on my computer so it uses OmniRoute.β
5 new skills a week. 1 minute to read.
How it works
The skill checks the operating system and shell, writes the Codex config file with several named profiles, sets the needed environment variables, and then verifies the setup.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Overview
Step-by-step agent workflow to configure the OpenAI Codex CLI on any machine (Linux, macOS, Windows) to use OmniRoute as an OpenAI-compatible backend. Detects OS and shell, writes config.toml and 7 named profiles, sets environment variables, and verifies the setup.
Quick install
npm install -g omniroute # or: npx omniroute
omniroute --version
Subcommands
No CLI subcommands mapped for this family yet.
<!-- skill:custom-start -->Long-running Codex tasks (#7287)
Two OmniRoute defaults silently break multi-hour Codex sessions. Document them whenever configuring Codex for overnight / multi-hour work. Full guide: docs/guides/CODEX-CLI-CONFIGURATION.md β Long-running tasks.
Session affinity (default off)
- Setting:
sessionAffinityTtlMs(ms; UI shows Affinity TTL (seconds) under Dashboard β Settings β Routing β Session affinity). Legacy alias:codexSessionAffinityTtlMs. - Default
0= disabled. Each turn can land on a different account and break prompt-cache / session continuity. - Codex session keys (
x-codex-session-id,x-session-id,x-omniroute-session, bodyprompt_cache_key/session_id) are only used for pinning when TTL > 0. - Max:
86400seconds /86400000ms (24h). Set TTL above the expected task length (e.g.43200s for ~12h).
Stream idle timeout (default 10 minutes)
- Env:
STREAM_IDLE_TIMEOUT_MS(default600000). Also considerFETCH_BODY_TIMEOUT_MS(same baseline;0disables). - Synthetic SSE heartbeats do not reset the idle clock β only real upstream chunks do.
- A quiet reasoning turn past the idle window is force-closed (
stream_idle_timeout/StreamIdleTimeoutError). Grep logs forIdle timeout: no data from.
Recommended multi-hour recipe
- Dashboard β Settings β Routing β Session affinity β Affinity TTL =
43200(12h) or86400(24h max). - OmniRoute environment:
STREAM_IDLE_TIMEOUT_MS=0
FETCH_BODY_TIMEOUT_MS=0
- Restart OmniRoute. Leave Codex
config.tomlas usual (wire_api = "responses", correctbase_url).
Defaults decision
Do not flip ship defaults in code for this skill: sessionAffinityTtlMs stays 0 and STREAM_IDLE_TIMEOUT_MS stays 600000. Long-running operators must opt in. See Discussion #5718 and issue #7287.
FAQ
What does the setup create?
It writes a config.toml file with seven named profiles and sets the environment variables Codex needs.
Does it check the result?
Yes. The skill ends by verifying the setup.
What about long coding sessions?
The skill notes that session affinity is off by default and should be set longer than the expected task length for long sessions.
Details
Original description by the author
Step-by-step agent workflow to configure the OpenAI Codex CLI on any machine (Linux, macOS, Windows) to use OmniRoute as an OpenAI-compatible backend. Detects OS and shell, writes config.toml and 7 named profiles, sets environment variables, and verifies the setup.
Popularity
- GitHub stars
- 84k
- Ranking position
- #1417
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
cli-a2a
84kRuns the OmniRoute command line for agent-to-agent tasks, letting you send work, check task history and test skills.
cli-backup-sync
84kRuns OmniRoute data backups from the command line, including snapshots, cloud sync, schedules and restores from archives.
cli-batches
84kSubmits batch AI jobs from the command line, tracks their progress and saves results or errors, including for CI pipelines.
cli-chat
84kSends chat requests to AI models from the command line, with streaming replies, system prompts and an interactive session.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.