Skip to main content
Copilot API runs entirely on your machine via npx — no installation step required. This page walks you through authenticating with GitHub, starting the proxy, and verifying that it works with a real API call.

Prerequisites

  • A GitHub account with an active Copilot subscription (individual, business, or enterprise)
  • Node.js >= 20 or Bun >= 1.2.x
1

Authenticate with GitHub

Run the authentication command. It starts a GitHub OAuth device flow and prompts you to enter a short code at github.com/login/device.
npx @nick3/copilot-api@latest auth
The command opens the device authorization URL and waits for you to approve the login in your browser. Once approved, your GitHub token is saved locally and reused on subsequent starts.
If you use OpenCode, authenticate with the OpenCode OAuth app instead. This is identical to OpenCode’s built-in Copilot provider and carries no additional Terms of Service risk:
npx @nick3/copilot-api@latest --oauth-app=opencode auth
2

Start the proxy

Start the proxy server. By default it listens on port 4141.
npx @nick3/copilot-api@latest start
You should see a list of available Copilot models and a confirmation that the server is running. The built-in Admin UI is available at http://localhost:4141/admin.To use a different port, pass the --port flag:
npx @nick3/copilot-api@latest start --port 8080
3

Make your first API call

With the proxy running, confirm it’s working by listing the available models:
curl http://localhost:4141/v1/models
The /v1/models response lists every Copilot model your account has access to. Use any of those model IDs in subsequent requests.
If you have enabled API key authentication (see Authentication), include the key in every request:
curl http://localhost:4141/v1/models \
  -H "x-api-key: your_api_key"
4

Connect an AI tool

Point your AI tool’s base URL at http://localhost:4141 and use any placeholder value (such as dummy) as the API key — unless you have configured API key authentication on the proxy, in which case use a real key.

What’s next

Authentication

Add multiple accounts, use GitHub Enterprise, and protect the proxy with API keys.

Admin UI

Monitor usage, browse request history, and inspect account quota from the built-in dashboard.