> ## Documentation Index
> Fetch the complete documentation index at: https://copilot-api.nick3.top/llms.txt
> Use this file to discover all available pages before exploring further.

# Copilot API: GitHub Copilot as OpenAI/Anthropic server

> Copilot API turns your GitHub Copilot subscription into a fully compatible OpenAI and Anthropic API server you can point any AI tool at.

Copilot API is a proxy server that exposes GitHub Copilot as an OpenAI-compatible and Anthropic-compatible API. Point Claude Code, OpenCode, or any tool that speaks the OpenAI Chat Completions or Anthropic Messages API at `http://localhost:4141` and start using your existing Copilot subscription immediately.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="bolt" href="/quickstart">
    Run the proxy in under two minutes using npx — no build step required.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Authenticate with GitHub OAuth or provide a token directly.
  </Card>

  <Card title="Claude Code" icon="terminal" href="/integrations/claude-code">
    Configure Claude Code to use Copilot as its AI backend.
  </Card>

  <Card title="OpenCode" icon="code" href="/integrations/opencode">
    Point OpenCode at the proxy via the Anthropic SDK provider.
  </Card>

  <Card title="API Endpoints" icon="plug" href="/reference/openai-endpoints">
    Full reference for OpenAI-compatible and Anthropic-compatible endpoints.
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration/config-file">
    Customize models, API keys, rate limits, and more via config.json.
  </Card>
</CardGroup>

## How it works

Copilot API sits between your AI tools and GitHub Copilot. It translates OpenAI and Anthropic requests into Copilot API calls, handles authentication token refresh automatically, and streams responses back in the format your tool expects.

<Steps>
  <Step title="Install and authenticate">
    Run `npx @nick3/copilot-api@latest auth` to authenticate your GitHub account through the standard OAuth device flow.
  </Step>

  <Step title="Start the proxy">
    Run `npx @nick3/copilot-api@latest start` to launch the local proxy server on port 4141.
  </Step>

  <Step title="Point your tool at the proxy">
    Set your AI tool's base URL to `http://localhost:4141` and use any placeholder value as the API key (unless you configure API key auth).
  </Step>

  <Step title="Use your Copilot subscription">
    Your tool now routes requests through Copilot. Monitor usage in the built-in Admin UI at `http://localhost:4141/admin`.
  </Step>
</Steps>

<Note>
  Copilot API is a reverse-engineered proxy and is not supported by GitHub. Excessive automated or bulk use of Copilot may trigger GitHub's abuse-detection systems. Use responsibly and review [GitHub's Acceptable Use Policies](https://docs.github.com/site-policy/acceptable-use-policies/github-acceptable-use-policies).
</Note>
