Skip to main content

Turn Gemini-CLI, Claude Code, and Codex into a local OpenAI-compatible API endpoint.

Project description

coder2api

A unified wrapper for Gemini CLI Proxy, Claude Code API, and ChatMock.

This tool provides a single entry point to run and manage these local coding agent proxies, exposing them via a unified API endpoint.

Installation

This project uses uv for dependency management.

uv sync

Because coder2api includes a Hatch build hook, running uv sync (or pip install) will automatically:

  1. Install Python dependencies.
  2. Run npm install and npm run build for the Gemini CLI Proxy (Node.js).

Note: You must have Node.js and npm installed on your system.

Usage

Unified Server

Start all services and the unified proxy:

uv run coder2api serve

This will start:

  • Gemini CLI Proxy on port 3001
  • ChatMock on port 3002
  • Claude Code API on port 3003
  • Unified Proxy on port 8069

You can access the APIs via the proxy:

  • Codex (ChatMock): http://localhost:8069/codex/v1/...
  • Claude Code: http://localhost:8069/cc/v1/...
  • Gemini: http://localhost:8069/gemini/openai/... or http://localhost:8069/gemini/anthropic/...

CLI Wrappers

You can also use the CLI wrappers for individual tools:

ChatMock (Codex):

uv run coder2api codex --help
uv run coder2api codex login

Claude Code API:

uv run coder2api cc

Gemini CLI Proxy:

uv run coder2api gemini -- --help

Logs

Logs for the background services are written to the logs/ directory when running serve.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

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

coder2api-0.1.0.tar.gz (604.8 kB view details)

Uploaded Source

Built Distribution

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

coder2api-0.1.0-py3-none-any.whl (39.1 MB view details)

Uploaded Python 3

File details

Details for the file coder2api-0.1.0.tar.gz.

File metadata

  • Download URL: coder2api-0.1.0.tar.gz
  • Upload date:
  • Size: 604.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for coder2api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40dd7956362b0484420b00ec22370dde289cdfc16849f100cb06a5517e19c825
MD5 8e2b13aea00816649d21455c81cf583b
BLAKE2b-256 f568d64a46be6459fd856d7f299c7379e06bb8f936f530fb1796632ebb780fe7

See more details on using hashes here.

File details

Details for the file coder2api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: coder2api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for coder2api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2488ff6219cf0acb53e4e9e1d31326eb1aa1b67068a33935f280b2e10e6e355d
MD5 188a7bebbd98626eb6263c4f596ea073
BLAKE2b-256 77dbafc78abfacefc16fcf190283a7c9685e4826ade1d3d4aba0c5fd77f25cbc

See more details on using hashes here.

Supported by

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