# LunaRoute — Codex

Markdown twin for https://www.lunaroute.com/codex/ — canonical HTML at https://www.lunaroute.com/codex/.

Codex via LunaRoute: `npx @lunaroute/cli login` once, then `npx @lunaroute/cli run codex` for a session that writes no files (the provider is passed with `-c …` overrides and the key in the child environment). For a permanent setup, `npx @lunaroute/cli setup codex` writes one file — `$CODEX_HOME/lunaroute.config.toml` — selected with `codex --profile lunaroute`; `~/.codex/config.toml` is never touched and the key stays in `LUNAROUTE_API_KEY` via `env_key`. Codex's `/model` picker fills from `model_catalog_url = https://gw.lunaroute.com/v1/codex/models` with the real LunaRoute model ids. Codex's own web search does not run through LunaRoute. Undo: `rm ~/.codex/lunaroute.config.toml` and drop the export — there is no `--remove`. See https://docs.lunaroute.com/getting-started/codex/

See also https://www.lunaroute.com/llms.txt and https://www.lunaroute.com/openapi.json
