Skip to main content

Codex CLI Proxy

Overview

Codex CLI Proxy exposes a signed-in local Codex CLI as a localhost-only REST service. It accepts OpenAI Chat Completions and Anthropic Messages request formats and returns compatible response shapes.

Each request runs in its own empty temporary workspace, which is removed when the Codex turn finishes. The proxy therefore does not provide its own project directory as chat context. It supports text and base64-encoded image inputs.

Installation

Prerequisites:

  • Python 3.12 or later
  • uv
  • A signed-in local codex CLI

Install the project dependencies:

uv sync

Run

uv run codex-cli-proxy

The server listens on http://127.0.0.1:9000 by default.

Endpoints

Method Path Description
GET /healthz, /readyz Proxy and Codex executable health status.
GET /v1/models Models available through the signed-in Codex CLI.
POST /v1/chat/completions OpenAI Chat Completions-compatible chat endpoint.
POST /v1/messages Anthropic Messages-compatible chat endpoint.

Both chat endpoints support stream: true; output is returned as compatibility streaming after the Codex turn completes.

Inputs

  • Text content is supported.
  • Images are supported as base64 payloads:
    • OpenAI: image_url or input_image with a data:image/...;base64,... URL.
    • Anthropic: image with a base64 source block.
    • JPEG, PNG, GIF, and WebP are accepted; up to 10 images and 20 MB per image.
  • Audio and caller-supplied tools/functions are not supported by the local Codex CLI execution path and return a 400 error.

Use the standard model field to select a Codex model. If omitted, Codex uses its configured default. mode is accepted as a compatibility alias.

Configuration

Variable Default Purpose
CODEX_BIN codex Path or command for the local Codex CLI.
CODEX_SANDBOX read-only Codex sandbox mode for each request.
CODEX_TIMEOUT_SECONDS 900 Maximum duration of one Codex turn.
CODEX_MAX_CONCURRENCY 1 Maximum concurrent Codex turns.
HOST / PORT 127.0.0.1 / 9000 Server bind address and port.

Keep the service behind a trusted network boundary.

Examples

curl http://127.0.0.1:9000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"user","content":"What is the capital of France?"}]}'

References

Metadata

Release files for codex-cli-proxy 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codex-cli-proxy 0.0.1
File Size Uploaded Provenance Actions
codex_cli_proxy-0.0.1.tar.gz 14.2 kB Without provenance Details for codex_cli_proxy-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codex-cli-proxy 0.0.1
File Interpreter ABI Platform Actions
codex_cli_proxy-0.0.1-py3-none-any.whl Python 3 none any Details for codex_cli_proxy-0.0.1-py3-none-any.whl

Total release size: 28.0 kB

Release files / codex_cli_proxy-0.0.1.tar.gz

Download URL codex_cli_proxy-0.0.1.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ba5e58ba0e0d7cbb5d01e86452d377df8e9113207f8b6daeb34aceebe8b1e07f
BLAKE2b-256 checksum
How to use checksums
9ab88666d2d597412ad68836ba27866d1dbe3e843193df0cad98291984761fa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.5

Release files / codex_cli_proxy-0.0.1-py3-none-any.whl

Download URL codex_cli_proxy-0.0.1-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daeae252d6ea5ebce0c5db046d1b7918ece433e003183bc7c592df38847157c0
BLAKE2b-256 checksum
How to use checksums
a78cda63423af0847b93f6cd3e18f6160d9d29b3174d4ee0d657d9b3aadc3065
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.5

Security for codex-cli-proxy 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page