> ## 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.

# Quickstart: run Copilot API in minutes

> Install, authenticate with GitHub, start the proxy server, and make your first API call — everything you need to be up and running fast.

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

<Steps>
  <Step title="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`.

    ```bash theme={null}
    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.

    <Tip>
      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:

      ```bash theme={null}
      npx @nick3/copilot-api@latest --oauth-app=opencode auth
      ```
    </Tip>
  </Step>

  <Step title="Start the proxy">
    Start the proxy server. By default it listens on port `4141`.

    ```bash theme={null}
    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:

    ```bash theme={null}
    npx @nick3/copilot-api@latest start --port 8080
    ```
  </Step>

  <Step title="Make your first API call">
    With the proxy running, confirm it's working by listing the available models:

    <CodeGroup>
      ```bash List models theme={null}
      curl http://localhost:4141/v1/models
      ```

      ```bash Chat completion theme={null}
      curl http://localhost:4141/v1/chat/completions \
        -H "Content-Type: application/json" \
        -d '{
          "model": "gpt-4o",
          "messages": [
            { "role": "user", "content": "Say hello in one sentence." }
          ]
        }'
      ```
    </CodeGroup>

    The `/v1/models` response lists every Copilot model your account has access to. Use any of those model IDs in subsequent requests.

    <Note>
      If you have enabled API key authentication (see [Authentication](/authentication)), include the key in every request:

      ```bash theme={null}
      curl http://localhost:4141/v1/models \
        -H "x-api-key: your_api_key"
      ```
    </Note>
  </Step>

  <Step title="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.

    * **Claude Code** — see [Claude Code integration](/integrations/claude-code) for the full configuration
    * **OpenCode** — see [OpenCode integration](/integrations/opencode) for the `opencode.json` setup
  </Step>
</Steps>

## What's next

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Add multiple accounts, use GitHub Enterprise, and protect the proxy with API keys.
  </Card>

  <Card title="Admin UI" icon="chart-bar" href="/guides/admin-ui">
    Monitor usage, browse request history, and inspect account quota from the built-in dashboard.
  </Card>
</CardGroup>
