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.1.tar.gz (221.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.1-py3-none-any.whl (255.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for coder2api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a44f5fd6cb692cbe10743a9718c6d4aeea58e625ef426606aa28af057b94c4b7
MD5 53b178e8c14b3b2fb9dc53d3125940d6
BLAKE2b-256 cc6c2145c97f14076c50d8956ff7ed8a1d95b93d72c4f7d8c77073ec789cfcf5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for coder2api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a7734028f01ee591c675bf45ecb81886cf7014fd17612788ba25faac94baa1f
MD5 0d42229ff0c1e6f53c7028e6c278ece2
BLAKE2b-256 80f807dec4a69655987f6840196950794ba13d5e51c5c68343f776175848da39

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