1
0
mirror of synced 2025-12-19 09:57:42 -05:00

Bring your own key for Copilot (Public preview) (#58549)

Co-authored-by: Jaryl <jarylw@github.com>
Co-authored-by: Sarah Vessels <82317+cheshire137@users.noreply.github.com>
Co-authored-by: Melanie Yarbrough <11952755+myarb@users.noreply.github.com>
This commit is contained in:
Felix Guntrip
2025-11-20 18:37:03 +00:00
committed by GitHub
parent c49ee418ff
commit 216df31b26
16 changed files with 179 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -13,6 +13,7 @@ children:
- /manage-agents
- /manage-spark
- /view-usage-and-adoption
- /use-your-own-api-keys
redirect_from:
- /copilot/managing-copilot/managing-copilot-for-your-enterprise
- /copilot/how-tos/administer/enterprises

View File

@@ -0,0 +1,54 @@
---
title: Using your LLM provider API keys with Copilot
shortTitle: Use your own API keys
intro: 'Learn how to integrate your preferred custom models with {% data variables.product.prodname_copilot %} by using your own LLM API keys, and make them available for organizations in your enterprise account.'
versions:
feature: copilot-byok
topics:
- Copilot
contentType: how-tos
allowTitleToDifferFromFilename: true
---
{% data reusables.copilot.byok-intro %}
## Why bring your own API keys?
As an enterprise owner, you may have specific requirements for governance, data security, and compliance. Setting up your own API keys allows you to address:
{% data reusables.copilot.byok-why %}
## Adding your key to an enterprise account
> [!IMPORTANT] We highly recommend adhering to the principle of least privilege by assigning only the minimum necessary scopes to your API keys.
After you've added your key and selected one or more models, you and members of your organizations will be able to use them with {% data variables.copilot.copilot_byok_supported_features %}. Your models will appear at the bottom of the model picker, under the enterprise name.
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.ai-controls-tab %}
1. In the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
1. Click **Configure allowed models**.
{% data reusables.copilot.byok-add %}
## Managing availability of custom models in your organizations
You can choose whether the models you have added are available to organizations in your enterprise account.
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.ai-controls-tab %}
1. In the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
1. Click **Configure allowed models**.
1. Click the **Custom models** tab.
1. Above the list of API keys, click the **Added models** tab.
1. Next to a model, click **Configure**. If any organizations already have access to the model, instead of "Configure", you will need to click **All organizations** or **X organizations**.
1. In the modal that opens, click the **Access** tab.
>[!NOTE] The model must be set to 'Enabled' before the "Access" tab will be available.
1. Choose how the model should be made available to organizations:
* To make the model available to all organizations in your enterprise account, select **Allow for all organizations**.
* To only make the model available for specific organizations, select **Choose per organization**, and check or uncheck the organizations listed below.
1. Click **Save**.
## Further reading
* [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys) in our documentation for organizations.
* [AUTOTITLE](/copilot/concepts/chat)

View File

@@ -19,5 +19,6 @@ children:
- /add-copilot-coding-agent
- /prepare-for-custom-agents
- /review-activity
- /use-your-own-api-keys
contentType: how-tos
---

View File

@@ -0,0 +1,36 @@
---
title: Using your LLM provider API keys with Copilot
shortTitle: Use your own API keys
intro: 'Learn how to integrate your preferred custom models with {% data variables.product.prodname_copilot %} by using your own LLM API keys, and make them available to your organization members.'
versions:
feature: copilot-byok
topics:
- Copilot
contentType: how-tos
allowTitleToDifferFromFilename: true
---
{% data reusables.copilot.byok-intro %}
## Why bring your own API keys?
As an organization owner, you may have specific requirements for governance, data security, and compliance. Setting up your own API keys allows you to address:
{% data reusables.copilot.byok-why %}
## Adding your key to an organization account
> [!IMPORTANT] We highly recommend adhering to the principle of least privilege by assigning only the minimum necessary scopes to your API keys.
After you've added your key and selected one or more models, you and your organization members will be able to use them with {% data variables.copilot.copilot_byok_supported_features %}. Your models will appear at the bottom of the model picker, under the organization name.
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
1. In the sidebar, under "Code, planning, and automation", click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**.
1. Under "Copilot", click **Models**.
{% data reusables.copilot.byok-add %}
## Further reading
* [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys) in our documentation for enterprise accounts.
* [AUTOTITLE](/copilot/concepts/chat)

View File

@@ -12,7 +12,7 @@ redirect_from:
- /copilot/how-tos/ai-models/configure-access-to-ai-models
- /github-models/use-github-models/integrating-ai-models-into-your-development-workflow
contentType: how-tos
category:
category:
- Configure Copilot
---
@@ -47,3 +47,9 @@ You can enable access in two ways:
As an enterprise or organization owner, you can enable or disable access to AI models for everyone who has been assigned a {% data variables.copilot.copilot_enterprise_short %} or {% data variables.copilot.copilot_business_short %} seat through your enterprise or organization. See [AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization) and [AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise).
> [!NOTE] Models available in {% data variables.copilot.copilot_auto_model_selection %} will follow the policies set for an organization or enterprise. See [AUTOTITLE](/copilot/concepts/auto-model-selection).
{% ifversion copilot-byok %}
You can also integrate your preferred custom models from supported LLM providers by bringing your own API keys. Organization owners can make custom models available for members of their organization and enterprise owners can add custom models and choose which organizations can make use of them. See [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-organization/use-your-own-api-keys) for organizations and [AUTOTITLE](/copilot/how-tos/administer-copilot/manage-for-enterprise/use-your-own-api-keys) for enterprise accounts.
{% endif %}

View File

@@ -149,6 +149,8 @@ Depending on the question you ask, {% data variables.copilot.copilot_chat %} can
When leveraging Bing, {% data variables.product.prodname_copilot_short %} will use the content of your prompt, as well as additional available context, to generate a Bing search query on your behalf that is sent to the Bing Search API. {% data variables.product.prodname_copilot_short %} will provide a link to the search results with its response. The search query sent to Bing is governed by [Microsoft's Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement).
{% data reusables.rai.copilot.byok-transparency-note %}
## Next steps
For details of how to use {% data variables.copilot.copilot_chat_dotcom %}, see:

View File

@@ -39,6 +39,8 @@ When you use the `@github` chat participant, {% data variables.copilot.copilot_c
{% data reusables.rai.copilot.copilot-chat-ide-leveraging-web-search %}
{% data reusables.rai.copilot.byok-transparency-note %}
{% data reusables.rai.copilot.copilot-chat-ide-use-cases %}
### Answering coding questions
@@ -81,6 +83,8 @@ When you use the `@github` chat participant, {% data variables.copilot.copilot_c
{% data reusables.rai.copilot.copilot-chat-ide-leveraging-web-search %}
{% data reusables.rai.copilot.byok-transparency-note %}
{% data reusables.rai.copilot.copilot-chat-ide-use-cases %}
### Answering coding questions
@@ -115,6 +119,8 @@ This can be a useful tool for programmers, as it can provide guidance and suppor
{% data reusables.rai.copilot.copilot-chat-ide-output-formatting %}
{% data reusables.rai.copilot.byok-transparency-note %}
{% data reusables.rai.copilot.copilot-chat-ide-use-cases %}
### Answering coding questions
@@ -149,6 +155,8 @@ This can be a useful tool for programmers, as it can provide guidance and suppor
{% data reusables.rai.copilot.copilot-chat-ide-output-formatting %}
{% data reusables.rai.copilot.byok-transparency-note %}
## Use cases for {% data variables.copilot.copilot_chat %}
{% data variables.copilot.copilot_chat %} can provide coding assistance in a variety of scenarios.

View File

@@ -0,0 +1,5 @@
# BYOK for Copilot (not Copilot Models) #18486
versions:
fpt: '*'
ghec: '*'

View File

@@ -0,0 +1,17 @@
1. Click the **Custom models** tab.
1. Above the list of API keys, click **Add API key**.
1. Under "Provider", select the LLM provider you want to use.
1. Under "Name", type a name for this key. This will be shown in the model picker.
1. Under "API key", type or paste your key.
1. Depending on which provider you are using, select or add models.
* If you're using OpenAI, Anthropic, or xAI, click {% octicon "sync" aria-label="Fetch new models" %} in the API key text field to fetch the models associated with your key. Next, under "Available models", select the models you want to use.
![Screenshot of the "Add API key" form. The "Fetch new models" button is highlighted with an orange outline.](/assets/images/help/copilot/byok-add.png)
* If you're using Microsoft Foundry, type your deployment URL in the field under "Deployment URL". Next, in the field under "Available models", type a Model ID and click {% octicon "check" aria-label="Add model" %} to add it.
If your models have different deployment URLs, they cannot be added to the same API key. Create a separate API key for each deployment URL.
![Screenshot of the "Add API key" form. The model text field and "Add model" button is highlighted with an orange outline.](/assets/images/help/copilot/byok-add-foundry.png)
1. After you select or add the models you want to make available, click **Save**.

View File

@@ -0,0 +1,15 @@
>[!NOTE]
>{% data reusables.copilot.byok-preview-note %}
>
>Some models require the Responses API which is not currently supported.
You can bring your own API keys to {% data variables.product.prodname_copilot %}, and enable teams to use your preferred large language model (LLM) providers with {% data variables.copilot.copilot_byok_supported_features %}.
API keys from the following providers are supported:
* Anthropic
* Microsoft Foundry
* OpenAI
* xAI
Fine-tuned models are also supported, but functionality and quality of results can vary depending on the fine-tuning setup. You should test your model and review its outputs carefully before using it in production.

View File

@@ -0,0 +1 @@
The ability to bring your own API keys to {% data variables.product.prodname_copilot %} is in {% data variables.release-phases.public_preview %} and subject to change.

View File

@@ -0,0 +1,4 @@
* **Governance and compliance:** Choose LLM providers that comply with your organization's policies and regulatory requirements.
* **Cost management:** Align with your existing payment methods, contracts, credits, or negotiated rates, and avoid usage overages.
* **Visibility and control:** Manage which models your team can access, and monitor usage through your provider's existing dashboards and billing.
* **Flexibility:** Support custom or specialized models that your organization already uses.

View File

@@ -0,0 +1,25 @@
# Using Bring Your Own Key (BYOK) with {% data variables.product.prodname_copilot %}
When you use Bring Your Own Key with {% data variables.copilot.copilot_chat %}, you can connect the chat experience to large language models from supported providers beyond the default {% data variables.product.prodname_copilot_short %} model. Examples of supported providers include Anthropic, Azure AI, OpenAI, and xAI. You add your API key for the chosen provider directly in your {% data variables.product.prodname_copilot_short %} settings.
When BYOK is active:
* **Feature scope**: Your chosen model is used within {% data variables.copilot.copilot_chat %}. In Agent mode, BYOK powers the main conversation, but certain actions such as code application or other tool calls may still use {% data variables.product.github %}-hosted models optimized for those tasks. These built-in models do not run through your BYOK provider.
* **Safety processes**: Regardless of which provider is active, responses still pass through {% data variables.product.github %}'s safety systems, including content filtering, before results are shown to you.
* **Quality considerations**: Suggestions may vary depending on the strengths and training coverage of your chosen provider.
* **Data handling**: When using BYOK, your prompts and responses are transmitted to your selected provider and may be subject to that provider's data retention and privacy policies. {% data variables.product.github %} temporarily processes this data for safety filtering but does not retain BYOK conversation content beyond session duration.
* **Your responsibilities**: You are responsible for the following:
* Provider API key security
* Usage costs or quotas
* Output validation
* Evaluating whether your chosen model meets your safety and quality requirements
* Compliance with your selected provider's terms
* Determining whether your chosen model complies with applicable laws
* Ensuring that a human reviews any output before using it to make decisions that affect people
* **Export restrictions**: Certain AI models may be subject to export controls. Verify your selected provider and model are authorized for use in your jurisdiction.
BYOK empowers your organization to choose the language model that best fits your needs while benefiting from {% data variables.product.github %}'s safety infrastructure. Note that model performance and safety characteristics are provider-dependent.

View File

@@ -179,3 +179,6 @@ copilot_workspace_pr: 'GitHub Copilot Workspace for pull requests'
copilot_workspace_pr_short: 'Copilot Workspace for PRs'
copilot_workspace: 'Copilot Workspace'
copilot_workspace_short: 'Workspace'
# BYOK
copilot_byok_supported_features: '{% data variables.copilot.copilot_chat %}'