Skip to content
Skillpedia
Agents84k Β· #1417

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.md

Copy 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

Use this skill to help me: https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/config-codex-cli/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

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.

<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->

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, body prompt_cache_key / session_id) are only used for pinning when TTL > 0.
  • Max: 86400 seconds / 86400000 ms (24h). Set TTL above the expected task length (e.g. 43200 s for ~12h).

Stream idle timeout (default 10 minutes)

  • Env: STREAM_IDLE_TIMEOUT_MS (default 600000). Also consider FETCH_BODY_TIMEOUT_MS (same baseline; 0 disables).
  • 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 for Idle timeout: no data from.

Recommended multi-hour recipe

  1. Dashboard β†’ Settings β†’ Routing β†’ Session affinity β†’ Affinity TTL = 43200 (12h) or 86400 (24h max).
  2. OmniRoute environment:
STREAM_IDLE_TIMEOUT_MS=0
FETCH_BODY_TIMEOUT_MS=0
  1. Restart OmniRoute. Leave Codex config.toml as usual (wire_api = "responses", correct base_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.

<!-- skill:custom-end -->
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.

repo: cheaper-inference/OmniRoute

Popularity

GitHub stars
84k
Ranking position
#1417
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills