Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
"v3/integrations/cline",
"v3/integrations/codex-cli",
"v3/integrations/continue-dev",
"v3/integrations/github-copilot",
"v3/integrations/opencode"
]
},
Expand Down
178 changes: 178 additions & 0 deletions v3/integrations/github-copilot.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---
title: "GitHub Copilot"
icon: "github"
description: "Configure GitHub Copilot — VS Code chat, agent mode, and the Copilot CLI — to use Eden AI for access to 500+ models behind a single API key."
---

import { TechArticleSchema } from "/snippets/TechArticleSchema.mdx";

<TechArticleSchema
title={"GitHub Copilot"}
description={"Configure GitHub Copilot — VS Code chat, agent mode, and the Copilot CLI — to use Eden AI for access to 500+ models behind a single API key."}
path="v3/integrations/github-copilot"
articleSection="Coding Agents"
about={"AI Coding Assistants"}
proficiencyLevel="Intermediate"
keywords={["Eden AI", "AI API", "GitHub Copilot", "BYOK", "OpenAI compatible"]}
datePublished="2026-06-19T00:00:00Z"
dateModified="2026-06-19T00:00:00Z"
/>

Configure [GitHub Copilot](https://github.com/features/copilot), via its **Bring Your Own Key (BYOK)** support, to use Eden AI for access to 500+ models behind a single API key.

## Overview

GitHub Copilot's BYOK feature lets you point its chat experience at any OpenAI-compatible endpoint. Routing it through Eden AI gives you:

- **500+ models**: switch between Claude, GPT, Gemini, and more without leaving Copilot
- **One API key**: unified billing and monitoring across providers
- **Provider failover**: keep working when an upstream provider has an incident

Check warning on line 29 in v3/integrations/github-copilot.mdx

View check run for this annotation

Mintlify / Mintlify Validation (edenai) - vale-spellcheck

v3/integrations/github-copilot.mdx#L29

Did you really mean 'failover'?

<Warning>
BYOK powers **Copilot Chat**, **agent mode**, and the **Copilot CLI**. It does **not** apply to inline code completions (ghost text), semantic search, or embeddings — those keep running on GitHub's own infrastructure and still require a GitHub account.
</Warning>

## Prerequisites

- An active **GitHub Copilot** subscription (Individual, Business, or Enterprise)
- For the chat path: **VS Code** with the GitHub Copilot extension
- For the CLI path: the **Copilot CLI** ([install & BYOK docs](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models))
- Eden AI API key from [app.edenai.run](https://app.edenai.run) → **API Keys**

## VS Code Copilot Chat

### 1. Open the Language Models editor

Open the Command Palette and run **Chat: Manage Language Models**, or click the model picker in the Chat view and choose **Manage Models…**.

### 2. Add Eden AI as a Custom Endpoint

Select **Add Models → Custom Endpoint**, then:

1. Enter a **group name** (e.g. `Eden AI`)
2. Provide a **display name** and paste your **Eden AI API key**
3. For **API type**, choose **Chat Completions**

The key is stored securely by VS Code — it is not written into the config file.

### 3. Declare your models in `chatLanguageModels.json`

VS Code opens `chatLanguageModels.json` so you can list the Eden AI models to expose. Set each entry's `url` to Eden AI's chat completions endpoint and use the `provider/model` ID format:

<CodeGroup>
```json chatLanguageModels.json
[
{
"id": "anthropic/claude-sonnet-4-5",
"name": "Claude Sonnet 4.5 (Eden AI)",
"url": "https://api.edenai.run/v3/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 200000,
"maxOutputTokens": 8192
},
{
"id": "openai/gpt-4o",
"name": "GPT-4o (Eden AI)",
"url": "https://api.edenai.run/v3/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 128000,
"maxOutputTokens": 16384
}
]
```
</CodeGroup>

Set `"toolCalling": true` for any model you want to use in **agent mode**.

### 4. Use it

Reload the window, open Copilot Chat, and pick your Eden AI model from the model picker. It is now available in chat and agent mode.

## Copilot CLI

The Copilot CLI reads BYOK settings from environment variables. Set them before launching:

<CodeGroup>
```bash bash / zsh
export COPILOT_PROVIDER_TYPE="openai"
export COPILOT_PROVIDER_BASE_URL="https://api.edenai.run/v3"
export COPILOT_PROVIDER_API_KEY="YOUR_EDEN_AI_API_KEY"
export COPILOT_MODEL="anthropic/claude-sonnet-4-5"
Comment on lines +101 to +102

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use guideline-compliant token/header placeholders in code examples.

Replace YOUR_EDEN_AI_API_KEY with the prescribed token placeholders (api_token for production, sandbox_api_token for testing) and use the exact auth header placeholder format Authorization: Bearer <api_key> in the curl example.

Suggested doc patch
-export COPILOT_PROVIDER_API_KEY="YOUR_EDEN_AI_API_KEY"
+export COPILOT_PROVIDER_API_KEY="api_token"
@@
-$env:COPILOT_PROVIDER_API_KEY = "YOUR_EDEN_AI_API_KEY"
+$env:COPILOT_PROVIDER_API_KEY = "api_token"
@@
-  -H "Authorization: Bearer YOUR_EDEN_AI_API_KEY" \
+  -H "Authorization: Bearer <api_key>" \

As per coding guidelines, “Use Authorization: Bearer <api_key> header format” and “Distinguish token types in code examples: api_token for production and sandbox_api_token for testing.”

Also applies to: 108-109, 157-157

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@v3/integrations/github-copilot.mdx` around lines 101 - 102, Replace the
custom placeholder `YOUR_EDEN_AI_API_KEY` in the environment variable export
statements with the guideline-compliant token placeholders: use `api_token` for
production examples and `sandbox_api_token` for testing examples. Additionally,
ensure any curl examples that include authentication headers use the exact
format `Authorization: Bearer <api_key>` as per the documentation guidelines.
Apply these changes consistently across all occurrences at lines 101-102,
108-109, and 157.

Source: Coding guidelines

```

```powershell PowerShell
$env:COPILOT_PROVIDER_TYPE = "openai"
$env:COPILOT_PROVIDER_BASE_URL = "https://api.edenai.run/v3"
$env:COPILOT_PROVIDER_API_KEY = "YOUR_EDEN_AI_API_KEY"
$env:COPILOT_MODEL = "anthropic/claude-sonnet-4-5"
```
</CodeGroup>

Then launch the CLI:

```bash
copilot
```

Keep `COPILOT_PROVIDER_TYPE` set to `openai` because Eden AI is OpenAI-compatible — leave it as `openai` even when the model itself is from Anthropic or Google. The CLI appends `/chat/completions` to the base URL itself, so `COPILOT_PROVIDER_BASE_URL` ends at `/v3`. Use a model that supports **tool calling and streaming** (most chat models on Eden AI do).

## Organization-wide BYOK (Enterprise)

Enterprise and Business administrators can configure an OpenAI-compatible provider for the whole organization (public preview) instead of per-developer setup. Add a provider of type **OpenAI**, set the base URL to `https://api.edenai.run/v3`, and supply your Eden AI key. See GitHub's [BYOK documentation](https://docs.github.com/en/copilot/how-tos/copilot-sdk/authenticate-copilot-sdk/bring-your-own-key).

## Switching models

Eden AI uses the `provider/model` format. In VS Code, add more entries to `chatLanguageModels.json`; in the CLI, change `COPILOT_MODEL`:

<CodeGroup>
```bash Popular choices
export COPILOT_MODEL="anthropic/claude-sonnet-4-5" # strong general coding
export COPILOT_MODEL="openai/gpt-4o" # fast, multimodal
export COPILOT_MODEL="google/gemini-2.5-pro" # long context
```
</CodeGroup>

Browse the full catalog via [List Models](/v3/llms/listing-models) or `GET https://api.edenai.run/v3/models`.

## What BYOK covers

| Feature | Uses Eden AI? |
| ------------------------------- | ----------------------------- |
| Copilot Chat | ✅ |
| Agent mode / custom agents | ✅ (model needs tool calling) |
| Copilot CLI | ✅ |
| Inline completions (ghost text) | ❌ GitHub-hosted |
| Semantic search / embeddings | ❌ GitHub-hosted |

## Troubleshooting

### Authentication errors

Verify your key works against Eden AI directly:

```bash
curl -X POST https://api.edenai.run/v3/chat/completions \
-H "Authorization: Bearer YOUR_EDEN_AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "anthropic/claude-sonnet-4-5", "messages": [{"role": "user", "content": "ping"}]}'
```

### Model not found

Use the full `provider/model` string (e.g. `anthropic/claude-sonnet-4-5`, not `claude-sonnet-4-5`). Confirm the ID is in the catalog returned by `GET /v3/models`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use the full v3 endpoint format in the model-catalog reference.

GET /v3/models should be documented in the required absolute format (https://api.edenai.run/v3/...) to stay consistent with v3 endpoint guidance.

Suggested doc patch
-Use the full `provider/model` string (e.g. `anthropic/claude-sonnet-4-5`, not `claude-sonnet-4-5`). Confirm the ID is in the catalog returned by `GET /v3/models`.
+Use the full `provider/model` string (e.g. `anthropic/claude-sonnet-4-5`, not `claude-sonnet-4-5`). Confirm the ID is in the catalog returned by `GET https://api.edenai.run/v3/models`.

As per coding guidelines, “Use API endpoint format https://api.edenai.run/v3/... for LLM endpoints.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Use the full `provider/model` string (e.g. `anthropic/claude-sonnet-4-5`, not `claude-sonnet-4-5`). Confirm the ID is in the catalog returned by `GET /v3/models`.
Use the full `provider/model` string (e.g. `anthropic/claude-sonnet-4-5`, not `claude-sonnet-4-5`). Confirm the ID is in the catalog returned by `GET https://api.edenai.run/v3/models`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@v3/integrations/github-copilot.mdx` at line 164, The documentation at line
164 references the models catalog endpoint using a relative path format `GET
/v3/models`. Update this reference to use the full absolute URL format
`https://api.edenai.run/v3/models` to maintain consistency with v3 endpoint
documentation guidelines. This applies to all references to the models endpoint
in the github-copilot.mdx file.

Source: Coding guidelines


### Model doesn't appear in VS Code

Make sure you chose **Chat Completions** as the API type, that `chatLanguageModels.json` is valid JSON, and reload the window. **Custom Endpoint** requires a recent VS Code build (it replaced the older "OpenAI Compatible" option) — update VS Code if you don't see it.

### Connection issues

Confirm the base URL is exactly `https://api.edenai.run/v3` (and the VS Code `url` field is `https://api.edenai.run/v3/chat/completions`). Check Eden AI status at [app-edenai.instatus.com](https://app-edenai.instatus.com).

## Next Steps

- [Continue.dev](./continue-dev) — open-source IDE assistant on Eden AI
- [Claude Code](./claude-code) — Anthropic's official CLI on Eden AI

Check warning on line 177 in v3/integrations/github-copilot.mdx

View check run for this annotation

Mintlify / Mintlify Validation (edenai) - vale-spellcheck

v3/integrations/github-copilot.mdx#L177

Did you really mean 'Anthropic's'?
- [Chat Completions](/v3/llms/chat-completions) — full reference for the underlying endpoint
Loading