Connect GitHub Copilot with Zeldoc.ai
GitHub Copilot supports bring your own key (BYOK): instead of GitHub-hosted models, Copilot sends chat and agent requests to a model provider you configure. Zeldoc.ai's OpenAI-compatible API works as such a provider in three Copilot surfaces:
In all three cases you need a Zeldoc.ai API key — see Generate an API key.
BYOK applies to Copilot Chat and agent sessions. Inline code completions in the editor still use GitHub-hosted models. When you use your own provider, prompts and repository context go to that provider — Zeldoc.ai — instead of GitHub.
Organisation administrators can turn off the Bring Your Own Language Model Key policy. If Zeldoc.ai doesn't show up after following the steps below, ask your administrator to enable the policy for your organisation.
VS Code
Copilot Chat in VS Code connects to any OpenAI-compatible endpoint through its Custom Endpoint provider.
-
Open the model picker in the Chat view and select Manage Language Models (or run the Chat: Manage Language Models command from the Command Palette).
-
Select Add Models → Custom Endpoint.
-
Enter a group name (for example
Zeldoc.ai), a display name, and your API key when prompted. -
Select Chat Completions as the API type.
-
VS Code opens
chatLanguageModels.json. Make the entry look like this:[{"name": "Zeldoc.ai","vendor": "customendpoint","apiKey": "${input:zeldocApiKey}","apiType": "chat-completions","models": [{"id": "zdev","name": "ZDev","url": "https://api.zeldoc.ai/v1/chat/completions","toolCalling": true,"vision": true,"maxInputTokens": 1000000,"maxOutputTokens": 131072}]}] -
Save the file and pick ZDev from the model picker in the Chat view.
The ${input:zeldocApiKey} value makes VS Code prompt you for the key and store it in
its secure storage, so the key never ends up in the JSON file. To expose more Zeldoc.ai
models, add more entries to the models array with the model ID in id.
Earlier versions of Copilot Chat used the github.copilot.chat.customOAIModels setting
for OpenAI-compatible models. That setting is deprecated in favour of the Custom Endpoint
provider above.
GitHub Copilot app
The GitHub Copilot app is GitHub's standalone desktop app for running Copilot agent sessions on macOS, Windows, and Linux. You need to sign in with a GitHub account, but you don't need a Copilot plan to use your own model provider.
-
Open the GitHub Copilot app.
-
Open the app settings and select Model providers.
-
Click Add provider.
-
Choose the OpenAI-compatible provider type.
-
Enter the provider details:
Field Value Display name Zeldoc.aiBase URL https://api.zeldoc.ai/v1API key Your Zeldoc.ai API key Model zdev(add more model IDs if you want other Zeldoc.ai models) -
Click Add provider.
ZDev now appears in the model picker alongside any GitHub-hosted models. Select it when you start a session. Your API key is stored in the system credential store and is never shown in the UI again.
GitHub Copilot CLI
GitHub Copilot CLI reads its provider from environment variables:
export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_BASE_URL=https://api.zeldoc.ai/v1
export COPILOT_PROVIDER_API_KEY=your-api-key
export COPILOT_MODEL=zdev
copilot
COPILOT_PROVIDER_TYPE=openai is the default and covers any OpenAI Chat Completions
endpoint. You can also pass the model per run with --model zdev.
GitHub requires BYOK models to support tool calling and streaming, and recommends a context window of at least 128k tokens. ZDev meets all three.