Launch Codex CLI through codex-relay for OpenAI-compatible model providers
Project description
codex-pal
codex-pal launches Codex CLI through
codex-relay so Codex can use
OpenAI-compatible providers that do not natively implement the Responses API.
It is intentionally a small launcher:
- starts or reuses a local
codex-relaysidecar; - injects per-invocation Codex config with
-c, leaving~/.codex/config.tomluntouched; - maps common providers to upstream URLs and API-key environment variables;
- hands the terminal to
codex.
Install
From crates.io:
cargo install codex-pal
From PyPI:
pipx install codex-pal
codex-pal expects codex and codex-relay to be installed and available on
PATH. The PyPI package declares codex-relay as a runtime dependency. The
Cargo package also declares the codex-relay crate dependency, but Cargo does
not install dependency binaries onto PATH when installing a binary crate; if
you install with Cargo, install both tools:
cargo install codex-pal codex-relay
Usage
codex-pal has two interfaces:
- a complete, explicit interface for scripts and debugging;
- a profile interface for humans.
Human-friendly profiles
export DEEPSEEK_API_KEY=...
codex-pal deepseek
export DASHSCOPE_API_KEY=...
codex-pal qwen
export OPENROUTER_API_KEY=...
codex-pal openrouter
The first run creates a profile under ~/.config/codex-pal/config.toml when
the profile name matches a built-in provider. Later runs reuse it.
Configure or modify a profile:
codex-pal deepseek config --model deepseek-v4-pro --port 4555
codex-pal deepseek show
codex-pal profiles
codex-pal providers
codex-pal deepseek status
codex-pal deepseek stop
codex-pal deepseek restart
Custom profile:
export EXAMPLE_API_KEY=...
codex-pal work-llm config \
--provider custom \
--upstream https://llm.example.com/v1 \
--api-key-env EXAMPLE_API_KEY \
--model vendor/model
codex-pal work-llm
Complete explicit interface
Use run when every setting should be supplied by arguments:
codex-pal run \
--provider deepseek \
--model deepseek-v4-pro \
--port 4444 \
--approval never \
--sandbox workspace-write
Custom one-shot launch:
codex-pal run \
--provider custom \
--upstream https://llm.example.com/v1 \
--api-key-env EXAMPLE_API_KEY \
--model vendor/model
Useful flags:
codex-pal relay status --port 4444
codex-pal relay stop --port 4444
codex-pal relay-config --provider openrouter
codex-pal run --provider deepseek --model deepseek-v4-pro --print-codex-command
codex-pal run --provider deepseek --model deepseek-v4-pro --ask
codex-pal run --provider deepseek --model deepseek-v4-pro --no-sandbox
Arguments left after codex-pal consumes its profile or launch options are
appended to the codex invocation, so Codex subcommands and flags can be used
directly:
codex-pal run --provider deepseek --model deepseek-v4-pro exec --skip-git-repo-check "summarize this repo"
codex-pal deepseek exec --skip-git-repo-check "summarize this repo"
codex-pal deepseek --oss
Use -- when you need to force a later argument to be handled by Codex even if
it looks like a codex-pal option:
codex-pal deepseek -- --model gpt-5.5
For relay-backed providers, codex-pal also injects a temporary Codex
model_catalog_json file so the in-session /model picker lists models for the
selected provider instead of only Codex's bundled OpenAI catalog. If Codex's
catalog command is unavailable, launch still continues with the chosen -m
model and prints a warning.
Provider Profiles
| Provider | Upstream | API key env |
|---|---|---|
deepseek |
https://api.deepseek.com/v1 |
DEEPSEEK_API_KEY |
kimi, moonshot |
https://api.moonshot.cn/v1 |
MOONSHOT_API_KEY |
qwen, dashscope |
https://dashscope.aliyuncs.com/compatible-mode/v1 |
DASHSCOPE_API_KEY |
mistral |
https://api.mistral.ai/v1 |
MISTRAL_API_KEY |
groq |
https://api.groq.com/openai/v1 |
GROQ_API_KEY |
xai, grok |
https://api.x.ai/v1 |
XAI_API_KEY |
openrouter |
https://openrouter.ai/api/v1 |
OPENROUTER_API_KEY |
Default models:
| Provider | Default model |
|---|---|
openai |
gpt-5.5 |
deepseek |
deepseek-v4-pro |
kimi, moonshot |
kimi-k2.7-code |
qwen, dashscope |
qwen3.7-max |
mistral |
mistral-medium-3-5+2 |
groq |
openai/gpt-oss-120b |
xai, grok |
grok-4.3 |
openrouter |
openrouter/auto |
Development
cargo test
cargo fmt --check
maturin build
Release
Releases are tag-driven from GitHub Actions.
One-time setup:
- Create a GitHub environment named
release. - Add an environment secret named
CARGO_REGISTRY_TOKENwith a crates.io API token. - On PyPI, create a pending Trusted Publisher for:
- project:
codex-pal - owner:
MetaFARS - repository:
codex-pal - workflow:
release.yml - environment:
release
- project:
Publish:
git tag v0.1.1
git push origin v0.1.1
The release workflow builds all wheels and the sdist, publishes to PyPI via Trusted Publishing, publishes the Rust crate to crates.io, and creates a GitHub Release with the built artifacts.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_pal-0.1.2.tar.gz.
File metadata
- Download URL: codex_pal-0.1.2.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8c224fd454c343fd99940cbf8d61306c006dabf78623bfbd97d6f2598d558b
|
|
| MD5 |
678226f2dd773ad71a4a2e9b66542e24
|
|
| BLAKE2b-256 |
7fd6ac9d1ba779b3b50ff9bf420557482ef416c7f50f1da73f4b41c833ba697e
|
File details
Details for the file codex_pal-0.1.2-py3-none-win_arm64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-win_arm64.whl
- Upload date:
- Size: 615.8 kB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f6dd36622541bdf20633c7d745570b6b188ff9d2ee18daae6d370a6684f152
|
|
| MD5 |
7a49e4d3a7d04317694b621ab28eb881
|
|
| BLAKE2b-256 |
6bbed2d1bafe3924ebb5bf5822c7e5265678f610b96c58fabfbdb67d64f2ba15
|
File details
Details for the file codex_pal-0.1.2-py3-none-win_amd64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-win_amd64.whl
- Upload date:
- Size: 642.2 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
379457be8c34dfd1bbdd61af2685dda071d4e0ee8908de52f743f004f57a2b0d
|
|
| MD5 |
c180c46dcec50d917f1373315e7d52ac
|
|
| BLAKE2b-256 |
d215ae78370b4624e7a7396ab1a19f3711d085830f19272c626d3e18a8b5be5b
|
File details
Details for the file codex_pal-0.1.2-py3-none-win32.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-win32.whl
- Upload date:
- Size: 590.4 kB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5963c751cbfd4efdce618a71a61d2414038f1046199c14c7e0575dd242105043
|
|
| MD5 |
a53e66ba84ebdd860d0842d2b5ebfb2f
|
|
| BLAKE2b-256 |
54e2e3765c04c7050169f1cb475b843f7cc54f70dbc62caee281401f08f6954b
|
File details
Details for the file codex_pal-0.1.2-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 866.5 kB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
091e1a7514b9847f4f2b3a36b7b04b20c6e6285bd469875d7bd91998bfb20c97
|
|
| MD5 |
e81e8795dd85c17a7ed81571ff3acd65
|
|
| BLAKE2b-256 |
2f20a686ca0718b679c3968727e82f7ce81133e18100bf6929f17b3371a01398
|
File details
Details for the file codex_pal-0.1.2-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 882.2 kB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
671c86d99d13a3315aced533420d828607845eff80972e71d02f026269e6614b
|
|
| MD5 |
d1849b5f9c870b24d21c3c8c34523b6c
|
|
| BLAKE2b-256 |
58afb45b82baf3d8328ad73800342eec05d72a047cc2b32eb06e875234ecfd04
|
File details
Details for the file codex_pal-0.1.2-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 818.3 kB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b116162d8f58a3f9891447406a581ad925385cdb13b196d220f936c98f57374
|
|
| MD5 |
cd003d753a1524d7417d9661abe67383
|
|
| BLAKE2b-256 |
27a47c52ec58d31dd117833f7c6ce0f407caaa6689e3f3a90572dc5d0f8f6ea8
|
File details
Details for the file codex_pal-0.1.2-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 843.4 kB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aec1613c626c211bd180a18a08df8473c20edaef5ca39ca971a543c1deb51bc6
|
|
| MD5 |
943a31b3a107cf5313743682e3a6a62e
|
|
| BLAKE2b-256 |
a39abaf3a6f5f5b866fd1b994b07a89f781b40af202bd6e35e5031ba616b88af
|
File details
Details for the file codex_pal-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 803.3 kB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eedcc3aeba188bdfb4a15e3a3e7a3eec40b17f95e8f6612feebb31ecb9a59549
|
|
| MD5 |
986454542b0138f114c7294ca406b576
|
|
| BLAKE2b-256 |
c1239cf8cd436415001c82ae9536eee3b3fb9fefa780c469ce8552250413a8f8
|
File details
Details for the file codex_pal-0.1.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 837.6 kB
- Tags: Python 3, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f0230093b2866345f6060de296eb0244f451ac67747c0360ac4e990b8dc4e82
|
|
| MD5 |
18d171a4fd480cf991009b3dd2dc5f6a
|
|
| BLAKE2b-256 |
8cd867bc44562c01f96b248532d2fbfcb3c7fd3be778ef4a84fbf1374482f437
|
File details
Details for the file codex_pal-0.1.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 918.3 kB
- Tags: Python 3, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
229d77984498c2230845e9897f561fff91d3291133290463041d4dc1f22fa7b5
|
|
| MD5 |
597268abe92ba3a2681b09d4af78b70e
|
|
| BLAKE2b-256 |
bd2ff4eddea8869c94323f184874710b564c7e949539b4a1f22ce31cf006a2a9
|
File details
Details for the file codex_pal-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 865.6 kB
- Tags: Python 3, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41da8070b54f94adc50ad548e10075dde4cbf9883eccfae31cf56fd930456e38
|
|
| MD5 |
9618be12f8f25fd11af61e917d54d071
|
|
| BLAKE2b-256 |
c6540f59b2dc9b842879e29f27554f63e44c4054d47201a986afb81edc36fe55
|
File details
Details for the file codex_pal-0.1.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 774.8 kB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5e912f0e8e1a9c8e2d158809468877c2b92917069176f96d2072f1bd823a753
|
|
| MD5 |
e7408e471eb90780a1b12e9103620402
|
|
| BLAKE2b-256 |
3b010f2370542273226a55a68afd3a7235380e263b824facb1c1b85ea733750b
|
File details
Details for the file codex_pal-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 784.3 kB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec64bc7ff7c27480a6c35d777226cafa825d82bbf4fb34d995cca4df9ba98cb
|
|
| MD5 |
fe79cea893e6e8f50f0846073638ae86
|
|
| BLAKE2b-256 |
2436e7b41a88da22c7374e3e8ef7f132b07787014fdedc52ec8e39256317b0c4
|
File details
Details for the file codex_pal-0.1.2-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 735.0 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82ad2f7a2c2e083795da8c106d7247b9f73b814a0803c7341c4baea4bb3534c7
|
|
| MD5 |
940c04b3a7d9054230824015bd1f8a1e
|
|
| BLAKE2b-256 |
28aca9a5045ce7b3f2deb98fbd6c63ae20059ea78e766086918d389c548b79b9
|
File details
Details for the file codex_pal-0.1.2-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: codex_pal-0.1.2-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 757.6 kB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d081ceb46bae5b74bbd571d6095a13708280170ca87aef4a6dcd2f64969a352b
|
|
| MD5 |
e0c9de898ab3c4d1e18528f72cf4877b
|
|
| BLAKE2b-256 |
4bd37623b8d3c5e4194b2b335c0a94cf2e4095df6bb06869eaf2605b2a89fb6a
|