Skip to main content

Overview

GitHub 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.
Always use the provider/model_id format for the COPILOT_MODEL value (e.g. anthropic/claude-sonnet-4-6, not claude-sonnet-4-6). Bare IDs return a 400 invalid model format error.

Prerequisites

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:
export ORQ_API_KEY="<orq-api-key>"
Replace <orq-api-key> with the key from Workspace Settings → API Keys.

Configuration Reference

Environment variableRequiredDescription
COPILOT_PROVIDER_BASE_URLYesGateway endpoint. Use https://api.orq.ai/v3/router for the OpenAI-compatible router or https://api.orq.ai/v3/anthropic for the Anthropic endpoint.
COPILOT_PROVIDER_TYPENoProvider type: openai (default) or anthropic.
COPILOT_PROVIDER_API_KEYYesOrq.ai API key.
COPILOT_MODELYesAI Gateway model identifier in provider/model_id format. Also settable with the --model flag.

Troubleshooting

Confirm COPILOT_PROVIDER_API_KEY is exported in the current shell and holds a valid Orq.ai API key (not a GitHub, OpenAI, or Anthropic key). Run echo $ORQ_API_KEY to verify.
Set COPILOT_MODEL to the provider/model_id format (e.g. anthropic/claude-sonnet-4-6). Bare model IDs are rejected by the router.
The selected model must support tool calling and streaming. Choose a different model from Workspace Settings → Models.
Confirm COPILOT_PROVIDER_BASE_URL points to https://api.orq.ai/v3/router or https://api.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.

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 with the model identifier set in COPILOT_MODEL.