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.

Prerequisites

  • Python 3.13+
  • Node.js & npm (Required for Gemini CLI Proxy)

Quick Start

You can run coder2api directly without installing it using uvx (part of uv):

uvx coder2api serve

Or using pipx:

pipx run coder2api serve

This command will:

  1. Download the package.
  2. Automatically install Node.js dependencies for the Gemini proxy (if missing).
  3. Start all services and the unified proxy.

Installation

If you prefer to install it globally:

Using pipx (Recommended)

pipx install coder2api
coder2api serve

Using uv

uv tool install coder2api
coder2api serve

Usage

Unified Server

The primary command starts all backend services and the proxy:

coder2api serve

This starts:

  • 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):

coder2api codex --help
coder2api codex login

Claude Code API:

coder2api cc

Gemini CLI Proxy:

coder2api gemini -- --help

Development

If you want to contribute or run from source:

  1. Clone the repository.
  2. Install dependencies using uv:
uv sync
  1. Run using uv run:
uv run coder2api serve

Logs

Logs for the background services are written to the logs/ directory in the working directory where you run the command.

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.3.tar.gz (222.3 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.3-py3-none-any.whl (255.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for coder2api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c8ed6a2c481697ed579392d6186cc16cb08fdc3f9cd2dfe15b4fe34653da8d9f
MD5 f9fa883c04097e99147777ef5c2a0290
BLAKE2b-256 4a37302d698e25954cb48ae20114f3b6eea3d54d2ce50098e03cc9062b08df4a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for coder2api-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0649a39af4380d7127fab9ddcfede6436c85bfbef3540f548971ee824cb3287a
MD5 dab156a9b2c5cb60af67a10f3647715d
BLAKE2b-256 df83d4cc7a5617010af624595464dae76ebbd4bdc97af03c8999d16e02947ef1

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