← all repositories
caozhiyuan/copilot-api

A local Rosetta Stone for Copilot, Codex, and Claude Code

It routes GitHub Copilot, Codex, and third-party models through one local endpoint that speaks both OpenAI and Anthropic protocols.

copilot-api
Velocity · 7d
+2.7
★ / day
collecting data…
star history

What it does

copilot-api is a local TypeScript gateway that sits between your coding agents and upstream AI providers. It exposes a single localhost server with OpenAI-compatible Chat Completions, Responses, and Anthropic Messages endpoints, routing traffic to GitHub Copilot, a built-in Codex provider, or third-party backends like Kimi and DeepSeek. An optional Electron desktop app wraps the server in a GUI with OAuth, token usage, and one-click controls.

The interesting bit

The real value is client-specific diplomacy. The README documents exactly how Claude Code strips thinking blocks when it sees a codex/ prefix and how its attribution headers invalidate prompt caches; the gateway offers modelMappings and environment overrides to keep the agent happy. It is less a dumb proxy than a protocol translator that knows its neighbors’ quirks.

Key highlights

  • Serves OpenAI Chat Completions, Responses, and Anthropic Messages from one local port.
  • Supports GitHub Copilot, built-in Codex, and third-party providers (Kimi, DeepSeek, OpenRouter, etc.).
  • Includes an Electron desktop app for Windows, macOS, and Linux with usage tracking.
  • First-class integrations for Claude Code, OpenCode, and Codex with tier-based model auto-detection.
  • Protocol adapters let non-native providers satisfy Responses or Messages via translation.

Caveats

  • Token-usage persistence requires Node.js >= 22.13.0 or Bun; without them, that feature is unavailable.
  • Claude Code setup is finicky: the codex/ prefix triggers client-side bugs, and several environment variables must be tuned to prevent cache invalidation and unnecessary quota burn.

Verdict

Worth a look if you run Claude Code, OpenCode, or Codex and want to pool GitHub Copilot or third-party credits behind one local endpoint. Skip it if you already have a simple, single-provider workflow that doesn’t need protocol translation.

Frequently asked

What is caozhiyuan/copilot-api?
It routes GitHub Copilot, Codex, and third-party models through one local endpoint that speaks both OpenAI and Anthropic protocols.
Is copilot-api open source?
Yes — caozhiyuan/copilot-api is open source, released under the MIT license.
What language is copilot-api written in?
caozhiyuan/copilot-api is primarily written in TypeScript.
How popular is copilot-api?
caozhiyuan/copilot-api has 1k stars on GitHub.
Where can I find copilot-api?
caozhiyuan/copilot-api is on GitHub at https://github.com/caozhiyuan/copilot-api.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.