copilot-proxy-api CLAUDE.md

A project guide for a reverse-engineered service that lets GitHub Copilot work through interfaces used by OpenAI and Anthropic tools. It covers the code layout, commands, authentication, server, and command-line entry points.

In plain words
What is it for?
Understanding the project structure, starting or debugging the server, authenticating, checking usage, and running builds, type checks, linting, and tests.
Why use it?
It gives a coding agent the repository context needed to work consistently, including how to run checks, tests, and the service.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/voidsteed/copilot-proxy-api/claude-md
Clone the repo
git clone --depth 1 https://github.com/voidsteed/copilot-proxy-api
Per session 3,899 This file is loaded in full into every session.
When invoked 3,899 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.03899 $0.03899
Opus 5 $0.01950 $0.01950
Sonnet 5 $0.00780 $0.00780
Haiku 4.5 $0.00390 $0.00390

Measured yesterday against content hash 832922ac6fcc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

copilot-proxy-api CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 341 lines

How it starts

The opening of the file, as written. The whole thing — 341 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

A reverse-engineered proxy for GitHub Copilot API that exposes it as an OpenAI and Anthropic compatible service. Allows using GitHub Copilot with tools that support OpenAI Chat Completions API (/v1/chat/completions), OpenAI Responses API (/v1/responses), or Anthropic Messages API (/v1/messages), including Claude Code and Codex CLI.

Common Commands

bun run dev          # Development with hot reload
bun run start        # Production
bun run build        # Build for distribution (uses tsdown)
bun run typecheck    # Type checking
bun run lint         # Lint staged files
bun run lint:all     # Lint all files
bun test             # Run all tests
bun test tests/anthropic-request.test.ts  # Run a specific test

Architecture

Entry Points & CLI Structure

  • src/main.ts - CLI entry point using citty for subcommand structure
  • Subcommands: start (server), auth (authentication), check-usage, debug
  • src/start.ts - Main server startup logic
  • src/server.ts - Hono HTTP server with route mounting

Request Flow

  1. OpenAI endpoints (/v1/chat/completions, /v1/responses, /v1/models, /v1/embeddings) - pass through to Copilot API directly
  2. Anthropic endpoints (/v1/messages) - translate Anthropic format to OpenAI, call Copilot, translate response back

Route Structure

src/routes/
├── chat-completions/   # OpenAI compatible - direct passthrough
├── responses/          # OpenAI Responses API - passthrough to Copilot /responses
│   ├── handler.ts              # Main request handler with streaming
│   ├── translation.ts          # Responses <-> Chat Completions conversion (unused by the live path)
│   └── types.ts                # Type definitions
├── messages/           # Anthropic compatible - requires translation
│   ├── handler.ts              # Main request handler
│   ├── non-stream-translation.ts  # Anthropic <-> OpenAI payload/response conversion
│   ├── stream-translation.ts      # Streaming chunk translation
│   └── anthropic-types.ts         # Type definitions
├── models/             # Model listing
├── embeddings/         # Embedding generation
├── usage/              # Copilot usage statistics
└── token/              # Token endpoint

Read the full file on GitHub · 341 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 341 lines · 3,899 tokens per session scan A 832922ac6fcc

Subscribe to this mod's changes

copilot-proxy-api CLAUDE.md is an instructions file published in the GitHub repository voidsteed/copilot-proxy-api (45 stars, last pushed 23d ago), licensed MIT. It adds 3,899 tokens to every session, about $0.0195 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.