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

> Capture GitHub Copilot agent usage with OpenTelemetry or route Copilot Chat through the Orq.ai AI Gateway using Bring Your Own Key.

[GitHub Copilot Chat](https://code.visualstudio.com/docs/agent-customization/language-models) in VS Code supports [Bring Your Own Key (BYOK)](https://code.visualstudio.com/docs/agent-customization/language-models#_bring-your-own-language-model-key) through a **Custom Endpoint** provider. Pointing it at the **AI Gateway** routes Chat requests through **Orq.ai**, reaching the full model catalog with unified tracing, cost tracking, and access controls.

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

## Prerequisites

* VS Code 1.122 or later (the Custom Endpoint provider graduated from Insiders to stable in this release) with the GitHub Copilot Chat extension installed
* Active **Orq.ai** account
* [Orq.ai API key](/ai-studio/organization/api-keys)
* Copilot Business or Enterprise orgs: an administrator must enable **Bring Your Own Language Model Key in VS Code** in the Copilot policy settings on GitHub.com

<Note>
  BYOK covers Chat and tool calls only. Inline suggestions, next-edit suggestions, and semantic search still require GitHub sign-in and are not routed through **Orq.ai**.
</Note>

## Capture Copilot usage with OpenTelemetry

Copilot Chat can export agent traces using the OpenTelemetry GenAI semantic conventions. **Orq.ai** records the session hierarchy, model and token usage, tool execution, errors, conversation ID, and available repository and organization metadata. Prompt text, responses, code, tool arguments, and tool results remain excluded when content capture is disabled.

This integration covers Copilot interactions that emit OTel traces. It does not poll GitHub's aggregate Copilot metrics or audit APIs, and the public **Orq.ai** OTLP receiver ingests traces rather than Copilot's separate metrics and events.

<Steps>
  <Step title="Run an OpenTelemetry Collector">
    Start an OTel Collector with an OTLP/HTTP receiver on port `4318`. Configure its trace exporter to send to `https://my.orq.ai/v2/otel` with `Authorization: Bearer <ORQ_API_KEY>`. See the [observability quickstart](/ai-studio/observability/quickstart) for the **Orq.ai** endpoint and authentication requirements.
  </Step>

  <Step title="Enable Copilot OTel export">
    Add these settings to VS Code:

    ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      "github.copilot.chat.otel.enabled": true,
      "github.copilot.chat.otel.exporterType": "otlp-http",
      "github.copilot.chat.otel.otlpEndpoint": "http://localhost:4318",
      "github.copilot.chat.otel.captureContent": false
    }
    ```

    Enterprise administrators can apply the same export centrally through [Copilot managed telemetry settings](https://code.visualstudio.com/docs/agents/guides/monitoring-agents#_manage-otel-configuration-for-your-organization).
  </Step>

  <Step title="Verify the trace">
    Run a Copilot agent task that calls a model and a tool. Open [**Orq.ai** Traces](/ai-studio/observability/traces) and confirm the trace shows the GitHub Copilot source, grouped conversation, model, tokens, and tool spans.
  </Step>
</Steps>

## Route Copilot Chat through the AI Gateway

<Steps>
  <Step title="Open Manage Language Models">
    Run **Chat: Manage Language Models** from the Command Palette, or select the gear icon labeled **Manage Language Models** in the Chat model picker.
  </Step>

  <Step title="Add a Custom Endpoint provider">
    Select **Add Models**, then choose **Custom Endpoint** from the provider list. VS Code prompts for three things in sequence:

    * **Group name**: any label, e.g. `Orq.ai`.
    * **API key**: the **Orq.ai** [API key](/ai-studio/organization/api-keys).
    * **API Type**: **Responses**, **Chat Completions**, or **Messages**, matching one of the tabs below.

    VS Code then opens the global `chatLanguageModels.json` file, in the VS Code user data directory, not the project workspace, with the group already scaffolded. The API key is stored as a secret reference (`"apiKey": "${input:chat.lm.secret...}"`), not the raw key; leave that field as generated.
  </Step>

  <Step title="Add a model to the group">
    `chatLanguageModels.json` is an array of groups. Add an entry to the scaffolded group's `models` array:

    <Tabs>
      <Tab title="Responses (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">
        Matches the API Type selected as **Responses**. Reaches the full **AI Gateway** catalog through **Orq.ai**'s primary API.

        ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
        [
          {
            "name": "Orq.ai",
            "vendor": "customendpoint",
            "apiKey": "${input:chat.lm.secret...}",
            "apiType": "responses",
            "models": [
              {
                "id": "openai/gpt-5.4",
                "name": "GPT-5.4 via Orq",
                "url": "https://my.orq.ai/v3/router/responses",
                "toolCalling": true,
                "vision": true,
                "maxInputTokens": 1050000,
                "maxOutputTokens": 128000
              }
            ]
          }
        ]
        ```

        Replace `openai/gpt-5.4` with any identifier from the **AI Gateway** catalog (e.g. `anthropic/claude-sonnet-5`, `google/gemini-3.5-flash`), and adjust `maxInputTokens`/`maxOutputTokens` to match the chosen model.
      </Tab>

      <Tab title="Chat Completions" 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">
        Matches the API Type selected as **Chat Completions**. Reaches the full **AI Gateway** catalog through the OpenAI-compatible router.

        ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
        [
          {
            "name": "Orq.ai",
            "vendor": "customendpoint",
            "apiKey": "${input:chat.lm.secret...}",
            "apiType": "chat-completions",
            "models": [
              {
                "id": "openai/gpt-5.4",
                "name": "GPT-5.4 via Orq",
                "url": "https://my.orq.ai/v3/router/chat/completions",
                "toolCalling": true,
                "vision": true,
                "maxInputTokens": 1050000,
                "maxOutputTokens": 128000
              }
            ]
          }
        ]
        ```
      </Tab>

      <Tab title="Messages" 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">
        Matches the API Type selected as **Messages**. Routes Claude models through the Anthropic-compatible endpoint.

        ```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
        [
          {
            "name": "Orq.ai Anthropic",
            "vendor": "customendpoint",
            "apiKey": "${input:chat.lm.secret...}",
            "apiType": "messages",
            "models": [
              {
                "id": "anthropic/claude-sonnet-5",
                "name": "Claude Sonnet 5 via Orq",
                "url": "https://my.orq.ai/v3/anthropic/v1/messages",
                "toolCalling": true,
                "vision": true,
                "maxInputTokens": 200000,
                "maxOutputTokens": 64000
              }
            ]
          }
        ]
        ```

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

  <Step title="Select the model in Copilot Chat">
    Open the Chat model picker and select a model from the new group to start using it.

    <Frame caption="The configured model appears in the Chat model picker under its group name.">
      <img src="https://mintcdn.com/orqai/ifpzhO2hwITYtXos/images/copilot-select-model.png?fit=max&auto=format&n=ifpzhO2hwITYtXos&q=85&s=3e547d0a446d4233d40be08efcba2bdb" alt="Chat model picker showing GPT-5.4 via Orq selected under the Orq.ai group, alongside built-in models and a Manage Models option." width="646" height="466" data-path="images/copilot-select-model.png" />
    </Frame>
  </Step>
</Steps>

## Configuration Reference

`chatLanguageModels.json` is an array of provider groups.

| Field                                | Level | Description                                                                                                                                                                                      |
| ------------------------------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `vendor`                             | Group | Must be `"customendpoint"` to enable BYOK.                                                                                                                                                       |
| `apiKey`                             | Group | Set automatically to a secret reference when the **Orq.ai** [API key](/ai-studio/organization/api-keys) is entered in the Add Models prompt. Do not paste the raw key here.                      |
| `apiType`                            | Group | `"responses"` for **Orq.ai**'s primary API, `"chat-completions"` for the OpenAI-compatible router, or `"messages"` for the Anthropic endpoint.                                                   |
| `id`                                 | Model | **AI Gateway** model identifier in `provider/model_id` format.                                                                                                                                   |
| `url`                                | Model | Full endpoint URL, not a base URL: `https://my.orq.ai/v3/router/responses`, `https://my.orq.ai/v3/router/chat/completions`, or `https://my.orq.ai/v3/anthropic/v1/messages`, matching `apiType`. |
| `toolCalling`                        | Model | Set to `true` for models that support function calling.                                                                                                                                          |
| `vision`                             | Model | Set to `true` for models that accept image input.                                                                                                                                                |
| `maxInputTokens` / `maxOutputTokens` | Model | Context window limits for the selected model.                                                                                                                                                    |

<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 GitHub Copilot 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">
    The secret behind `apiKey` is likely wrong or expired. Reopen **Manage Language Models**, remove the group, and re-add it, pasting a valid **Orq.ai** [API key](/ai-studio/organization/api-keys) (not a GitHub, OpenAI, or Anthropic key) at the prompt.
  </Accordion>

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

  <Accordion title="Custom Endpoint model does not appear in the picker">
    Confirm `url` points to a full endpoint path, not just a base URL. `https://my.orq.ai/v3/router` alone is rejected; use `https://my.orq.ai/v3/router/responses` or `https://my.orq.ai/v3/router/chat/completions`.
  </Accordion>

  <Accordion title="No Traces appearing in Orq.ai">
    Confirm `url` matches `apiType`: `responses` must point to `https://my.orq.ai/v3/router/responses`, `chat-completions` must point to `https://my.orq.ai/v3/router/chat/completions`, `messages` must point to `https://my.orq.ai/v3/anthropic/v1/messages`. Requests sent to the wrong endpoint will not appear in [**Orq.ai** Traces](/ai-studio/observability/traces).
  </Accordion>

  <Accordion title="Inline suggestions still use a different model">
    BYOK only applies to Chat and tool calls. Inline suggestions, next-edit suggestions, and semantic search continue to require GitHub sign-in and are not affected by the Custom Endpoint configuration.
  </Accordion>

  <Accordion title="Command Palette opens 'Manage Language Model Access' instead of the Custom Endpoint editor">
    On a Copilot Business or Enterprise account, **Manage Language Models** does not exist as a command until an administrator enables **Bring Your Own Language Model Key in VS Code** in the Copilot policy settings on GitHub.com. The Command Palette falls back to the similarly named **Manage Language Model Access** command instead, which controls extension permissions and is unrelated to BYOK. Ask a workspace administrator to enable the policy, then reload VS Code.
  </Accordion>

  <Accordion title="Custom Endpoint is missing from the Add Models list">
    The Custom Endpoint provider requires VS Code 1.122 or later; earlier versions only show built-in providers (Anthropic, Azure, Google, Ollama, OpenAI, OpenRouter, xAI). Update VS Code via **Code → Check for Updates** (macOS) or **Help → Check for Updates**, then reopen **Manage Language Models**.
  </Accordion>

  <Accordion title="'No utility model is configured' error when sending a message">
    Expected the first time a BYOK model is used as the active main model. Open Settings (<kbd>Cmd+,</kbd>), search **utility**, and set **Chat: Byok Utility Model Default** to one of the configured Custom Endpoint models.
  </Accordion>
</AccordionGroup>

## Verification

Select the configured model in the Chat model picker and send a message. The response appears in Copilot Chat and the trace appears in [**Orq.ai** Traces](/ai-studio/observability/traces) with the model identifier set in `id`.
