Skip to main content

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-relay sidecar;
  • injects per-invocation Codex config with -c, leaving ~/.codex/config.toml untouched;
  • 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

The PyPI package installs codex-relay as a runtime dependency. codex-pal finds that dependency beside its own executable (including in pipx's private environment) before searching PATH. To expose codex-relay as a standalone shell command too, install with pipx install codex-pal --include-deps.

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

Use an existing remote codex-relay service instead of starting a local sidecar:

codex-pal run \
  --provider deepseek \
  --model deepseek-v4-pro \
  --relay-url https://relay.example.com

codex-pal deepseek --relay-url https://relay.example.com
codex-pal deepseek config --relay-url https://relay.example.com

--relay-url accepts either the relay root URL or its /v1 base URL. When it is set, codex-pal skips local relay process management and points Codex at the remote relay.

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:

  1. Create a GitHub environment named release.
  2. Add an environment secret named CARGO_REGISTRY_TOKEN with a crates.io API token.
  3. On PyPI, create a pending Trusted Publisher for:
    • project: codex-pal
    • owner: MetaFARS
    • repository: codex-pal
    • workflow: release.yml
    • environment: release

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_pal-0.1.4.tar.gz (37.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

codex_pal-0.1.4-py3-none-win_arm64.whl (616.5 kB view details)

Uploaded Python 3Windows ARM64

codex_pal-0.1.4-py3-none-win_amd64.whl (645.5 kB view details)

Uploaded Python 3Windows x86-64

codex_pal-0.1.4-py3-none-musllinux_1_2_x86_64.whl (860.8 kB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

codex_pal-0.1.4-py3-none-musllinux_1_2_aarch64.whl (840.1 kB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

codex_pal-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (796.8 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

codex_pal-0.1.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (779.8 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

codex_pal-0.1.4-py3-none-macosx_11_0_arm64.whl (728.6 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

codex_pal-0.1.4-py3-none-macosx_10_12_x86_64.whl (747.2 kB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file codex_pal-0.1.4.tar.gz.

File metadata

  • Download URL: codex_pal-0.1.4.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ca0f4208a4cd6e936fb46e852c8859cd2a6b777cfc48a712f615b90cae66668e
MD5 951200f78a2a946703341f37673a20f1
BLAKE2b-256 a53e7d640f6f015b37d702e90746ae0b7253e573c3353411f146f0f80cefeec8

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-win_arm64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-win_arm64.whl
  • Upload date:
  • Size: 616.5 kB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 f877ee2498555129ddc468c64310ff0b6c7cd25e9575a195c19a771e5dc1aea8
MD5 7ebf4f6ee27359939e67904715f8741d
BLAKE2b-256 7cf6884f2ca29dc543b151ee8ec4cebb627323fef87cc81bf7cf06cbe2563fcf

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-win_amd64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-win_amd64.whl
  • Upload date:
  • Size: 645.5 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0beb9c77e90e5088601a3bbd998f82cfcfcfd946aeeb6e7eac9d2581679e49c6
MD5 127cd5bba3b31b0c5c2aa05fc8c5b6c3
BLAKE2b-256 7392576ea36ae86e7c42a91e658d64a0bb00a334ae0765117bf558a7032de017

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 860.8 kB
  • Tags: Python 3, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0d0341e5d5967790f0a8c68df7d141696ac172060d70297a76b85859a12efa6f
MD5 2917f4fa792df483bca7ec9467c4dd52
BLAKE2b-256 e35d049a129a6f21c3d4adcb2a01f5760d9ae345b5c7ca9d76ef6d640ca03b28

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-musllinux_1_2_aarch64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 840.1 kB
  • Tags: Python 3, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a6b23055ecaf2c02278cf696abe1f4808669151d7f42d6e72e3deb1fcafcd0ba
MD5 b9383dd9ffcc5b801ed7c7b300a4cf42
BLAKE2b-256 b33d80ad1594ab906fec849498599a35bd5835f05d555f908a0851c4b7c3edd8

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 796.8 kB
  • Tags: Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 46e54a29fcddc5d7748dd8160407a10b464d91980abc2b1ffff0b542010bbfb7
MD5 4aa9e76209e63f8635dfaeaeb9093c79
BLAKE2b-256 181a9d57af49bc9ca618811e857fd74425c852a931b20a843ce3e7a6a44cdd90

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 779.8 kB
  • Tags: Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8a9d98d2bd8ddd5807f6684a88eb2c89a700921df59d16bcc61775a64ec9a9a9
MD5 058837680f1d39ea7058a4505ffbf4be
BLAKE2b-256 60c3ca67084d33ff4a62846b79b36410b6f034d63ffa2613199823251e98e196

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 728.6 kB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 636b175fc07fa6af0fb1844e6f1002741118a3b23e300628c6eeb4572d3a307a
MD5 3667010565b0b8dc2621e296269f596e
BLAKE2b-256 e5b51091aabca406d3f76124d3515f73162d2913d7a1afdfe9695219c37a2ee0

See more details on using hashes here.

File details

Details for the file codex_pal-0.1.4-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: codex_pal-0.1.4-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 747.2 kB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","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

Hashes for codex_pal-0.1.4-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 37c9b002aad865ae2b0c92aafe513f8af1a565affac85fa4aa8962ac5e0df96c
MD5 5b35c62fe0895e051f814c4aaf6d4620
BLAKE2b-256 5a782919c3d3a6d8b51ddcb6c172624262e6e3f16c9403483ab0e1d8e15e91ae

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

9 files

0.2.0

9 files

0.1.6

9 files

0.1.5

9 files

This release

0.1.4 This release

9 files

0.1.3

16 files

0.1.2

16 files

0.1.1

16 files

0.1.0

16 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page