> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Copilot CLI

> Point GitHub Copilot CLI at the Orq.ai AI Gateway with BYOK environment variables to use any catalog model with tracing and cost tracking.

[GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli) brings Copilot to the terminal. Its bring-your-own-key (BYOK) configuration points the CLI at any OpenAI-compatible, Azure OpenAI, or Anthropic endpoint, so every model in the **AI Gateway** catalog is reachable from a few environment variables, with unified tracing, cost tracking, and access controls through **Orq.ai**.

<Warning>
  Always use the `provider/model_id` format for the `COPILOT_MODEL` value (e.g. `anthropic/claude-sonnet-5`, not `claude-sonnet-5`). Bare IDs return a `400 invalid model format` error.
</Warning>

## Prerequisites

* [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) installed
* Active **Orq.ai** account
* [Orq.ai API key](/ai-studio/organization/api-keys)

### Model requirements

The selected model must support **tool calling** (function calling) and **streaming**. Copilot CLI returns an error for models missing either capability. For best results, choose a model with a context window of at least 128k tokens.

## Setup

Configure the provider with environment variables before launching Copilot CLI. Export the API key first:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export ORQ_API_KEY="<orq-api-key>"
```

Replace `<orq-api-key>` with the key from [Workspace Settings → API Keys](https://my.orq.ai/settings/api-keys).

<Tabs>
  <Tab title="OpenAI-compatible (recommended)" icon="https://mintcdn.com/orqai/gORBxDuy-IDX4qWx/images/logos/openai.svg?fit=max&auto=format&n=gORBxDuy-IDX4qWx&q=85&s=3832d1d0771bc95bf05b09a569c9d090" width="395" height="400" data-path="images/logos/openai.svg">
    The OpenAI-compatible router reaches the full **AI Gateway** catalog. This is the default provider type, so `COPILOT_PROVIDER_TYPE` can be omitted.

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    export COPILOT_PROVIDER_BASE_URL=https://my.orq.ai/v3/router
    export COPILOT_PROVIDER_API_KEY=$ORQ_API_KEY
    export COPILOT_MODEL=openai/gpt-5.6-sol
    copilot
    ```

    Replace `openai/gpt-5.6-sol` with any identifier from the **AI Gateway** catalog (e.g. `anthropic/claude-sonnet-5`, `google/gemini-3.5-flash`).
  </Tab>

  <Tab title="Anthropic" icon="https://mintcdn.com/orqai/E6QxcuOkIZbPb-u-/images/logos/anthropic.svg?fit=max&auto=format&n=E6QxcuOkIZbPb-u-&q=85&s=b443dfd330fdacba898eed9a9d3f82c4" width="61" height="43" data-path="images/logos/anthropic.svg">
    Route Claude models through the Anthropic-compatible endpoint.

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    export COPILOT_PROVIDER_TYPE=anthropic
    export COPILOT_PROVIDER_BASE_URL=https://my.orq.ai/v3/anthropic
    export COPILOT_PROVIDER_API_KEY=$ORQ_API_KEY
    export COPILOT_MODEL=anthropic/claude-sonnet-5
    copilot
    ```

    Replace `anthropic/claude-sonnet-5` with any Claude identifier from the **AI Gateway** catalog.
  </Tab>
</Tabs>

## Configuration Reference

| Environment variable        | Required | Description                                                                                                                                          |
| --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `COPILOT_PROVIDER_BASE_URL` | Yes      | Gateway endpoint. Use `https://my.orq.ai/v3/router` for the OpenAI-compatible router or `https://my.orq.ai/v3/anthropic` for the Anthropic endpoint. |
| `COPILOT_PROVIDER_TYPE`     | No       | Provider type: `openai` (default) or `anthropic`.                                                                                                    |
| `COPILOT_PROVIDER_API_KEY`  | Yes      | **Orq.ai** [API key](/ai-studio/organization/api-keys).                                                                                              |
| `COPILOT_MODEL`             | Yes      | **AI Gateway** model identifier in `provider/model_id` format. Also settable with the `--model` flag.                                                |

<Tip>
  See the [Anthropic Messages API](/ai-gateway/features/anthropic-messages-api) for endpoint details, authentication, and cache\_control breakpoints.
</Tip>

## Skills

**Orq Skills** add pre-built agentic workflows to Copilot CLI for the full Build, Evaluate, Optimize lifecycle.

### Installation

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
npx skills add orq-ai/assistant-plugins --agent github-copilot
```

Set an [API key and connect the Orq MCP server](/ai-studio/integrations/code-assistants/orq-skills#prerequisites) first. Skills are then triggered by describing what is needed.

<Card title="Orq Skills" icon="wand-magic-sparkles" href="/ai-studio/integrations/code-assistants/orq-skills">
  The full catalogue of skills and slash commands.
</Card>

<Note>
  Slash commands (`/orq:quickstart`, `/orq:traces`, and others) are only available in Claude Code.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Requests failing with 401 Unauthorized">
    Confirm `COPILOT_PROVIDER_API_KEY` is exported in the current shell and holds a valid **Orq.ai** [API key](/ai-studio/organization/api-keys) (not a GitHub, OpenAI, or Anthropic key). Run `echo $ORQ_API_KEY` to verify.
  </Accordion>

  <Accordion title="400 invalid model format">
    Set `COPILOT_MODEL` to the `provider/model_id` format (e.g. `anthropic/claude-sonnet-5`). Bare model IDs are rejected by the router.
  </Accordion>

  <Accordion title="Model returns a capability error">
    The selected model must support tool calling and streaming. Choose a different model from [Workspace Settings → Models](https://my.orq.ai/settings/models).
  </Accordion>

  <Accordion title="No Traces appearing in Orq.ai">
    Confirm `COPILOT_PROVIDER_BASE_URL` points to `https://my.orq.ai/v3/router` or `https://my.orq.ai/v3/anthropic` and the API key is a valid **Orq.ai** key. Requests sent to the wrong endpoint will not appear in [**Orq.ai** Traces](/ai-studio/observability/traces).
  </Accordion>
</AccordionGroup>

## Verification

Launch Copilot CLI with the provider variables set and send a prompt. The response appears in the session and the trace appears in [**Orq.ai** Traces](/ai-studio/observability/traces) with the model identifier set in `COPILOT_MODEL`.
