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.2.tar.gz (222.0 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.2-py3-none-any.whl (255.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for coder2api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a3083a006a0d472a8b10762498b76b73de74e8400b7a6033c7f05c22d9bcc214
MD5 aa8f2146f2a28a2c00e565ae0a899a4e
BLAKE2b-256 35e1be7c2ebaa0294426a65ebc7c3c6f8e3efcb392e97dd2821b45eccdf76da7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for coder2api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef57850ab48a89b851446f6fc93fff27e43a371e442c469810c0690e36d900c7
MD5 4e695f0767ce8e2cd137175ffd63676e
BLAKE2b-256 c7ffeaf3f3cf5089ab94d0a36f90356a8ccf864a4cdb40b5e947fed4c923b07e

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