GitHub Copilot
Use codai in VS Code Copilot Chat through a Custom Endpoint and in Copilot CLI through BYOK.
VS Code Chat needs a Custom Endpoint entry for codai; Copilot CLI needs four environment variables. Neither needs a Copilot plan or a GitHub sign-in.
Before you start
- A codai key from hub.codai.ro → Keys → Create key (details in the quickstart).
- On Copilot Business or Enterprise, your org must enable the policy Bring Your Own Language Model Key in VS Code.
VS Code Chat (Custom Endpoint)
The fastest path is the prebuilt config the gateway serves at https://ai.codai.ro/vscode/chatLanguageModels.json — three picker entries, the effort dial and tuned headers. Follow the steps on clients.
To write the entry by hand: model picker → Manage Language Models → Add Models → Custom Endpoint, then edit the chatLanguageModels.json that VS Code opens:
[
{
"name": "codai",
"vendor": "customendpoint",
"apiKey": "${input:codaiApiKey}",
"apiType": "chat-completions",
"models": [
{
"id": "codai",
"name": "codai",
"url": "https://ai.codai.ro/v1/chat/completions",
"toolCalling": true,
"vision": true,
"thinking": true,
"maxInputTokens": 168000,
"maxOutputTokens": 32000
}
]
}
]- Give the full endpoint URL, including
/chat/completions. toolCalling: trueis required for agent mode.maxInputTokens + maxOutputTokensmust not exceed the context window. The numbers above are a conservative 200k window; the served config athttps://ai.codai.ro/vscode/chatLanguageModels.jsonis the source of truth and advertises the larger windows the gateway can serve.- For the Anthropic wire format set
"apiType": "messages"and"url": "https://ai.codai.ro/v1/messages".
The older github.copilot.chat.customOAIModels setting and the OpenAI Compatible provider are deprecated. Use Custom Endpoint.
MCP in VS Code
{
"servers": {
"codai": {
"type": "http",
"url": "https://ai.codai.ro/mcp",
"headers": { "Authorization": "Bearer ${input:codai-key}" }
}
},
"inputs": [
{ "type": "promptString", "id": "codai-key", "description": "codai API key", "password": true }
]
}Open the user file with MCP: Open User Configuration, or use .vscode/mcp.json per workspace.
Copilot CLI (BYOK)
$env:COPILOT_PROVIDER_BASE_URL = 'https://ai.codai.ro/v1'
$env:COPILOT_PROVIDER_TYPE = 'openai'
$env:COPILOT_PROVIDER_API_KEY = 'codai_xxxxxxxx'
$env:COPILOT_PROVIDER_WIRE_MODEL = 'codai'
$env:COPILOT_MODEL = 'codai'
copilotWith COPILOT_PROVIDER_TYPE=anthropic, the base URL is the root https://ai.codai.ro — no /v1. The gateway also serves ready-made scripts; see clients.
MCP in Copilot CLI
The CLI does not read .vscode/mcp.json. Add the server from the command line:
copilot mcp add --transport http --header "Authorization: Bearer codai_xxxxxxxx" codai https://ai.codai.ro/mcpTo keep the key out of config files, use the stdio memory bridge described on clients.
What works and what does not
| Feature | With codai |
|---|---|
| Chat, agent mode, tools (VS Code) | Work |
| Copilot CLI sessions | Work |
| Inline suggestions, semantic search, embeddings | Stay on GitHub |
| Titles and commit messages | GitHub models, unless you set chat.utilityModel / chat.byokUtilityModelDefault |
| Restricted Mode | Shows only Auto |
| GitHub-hosted memory and remote delegation (CLI) | Not available in BYOK mode |
Troubleshooting
- CLI reports "Authentication failed (HTTP 401)" with type
anthropic— the base URL ends in/v1. The real error is a404; use the root URL. codaiis missing from the picker — restart VS Code; check that the org policy allows your own keys.- Agent mode is greyed out —
toolCallingis nottrueon the model entry. - Agent Host sessions do not list
codai— enablechat.agentHost.byokModels.enabled.
Sources
Checked 2026-10-02.
Last updated: