codai docs
Integrations

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:

chatLanguageModels.json
[
  {
    "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: true is required for agent mode.
  • maxInputTokens + maxOutputTokens must not exceed the context window. The numbers above are a conservative 200k window; the served config at https://ai.codai.ro/vscode/chatLanguageModels.json is 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

mcp.json
{
  "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'
copilot

With 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/mcp

To keep the key out of config files, use the stdio memory bridge described on clients.

What works and what does not

FeatureWith codai
Chat, agent mode, tools (VS Code)Work
Copilot CLI sessionsWork
Inline suggestions, semantic search, embeddingsStay on GitHub
Titles and commit messagesGitHub models, unless you set chat.utilityModel / chat.byokUtilityModelDefault
Restricted ModeShows 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 a 404; use the root URL.
  • codai is missing from the picker — restart VS Code; check that the org policy allows your own keys.
  • Agent mode is greyed out — toolCalling is not true on the model entry.
  • Agent Host sessions do not list codai — enable chat.agentHost.byokModels.enabled.

Sources

Checked 2026-10-02.

Last updated:

On this page