[GH-ISSUE #4166] [FEAT]: How to use GitHub Copilot's LLM #2652

Closed
opened 2026-02-22 18:30:37 -05:00 by yindo · 5 comments
Owner

Originally created by @constCD on GitHub (Jul 17, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4166

What would you like to see?

GitHub Copilot provides model usage (https://docs.github.com/en/copilot/how-tos/build-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/using-copilots-llm-for-your-agent), But anythingLLM doesn't seem to work, Cherry studio has provided an integrated way

Originally created by @constCD on GitHub (Jul 17, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4166 ### What would you like to see? GitHub Copilot provides model usage (https://docs.github.com/en/copilot/how-tos/build-copilot-extensions/building-a-copilot-agent-for-your-copilot-extension/using-copilots-llm-for-your-agent), But anythingLLM doesn't seem to work, Cherry studio has provided an integrated way
yindo added the enhancementfeature request labels 2026-02-22 18:30:37 -05:00
yindo closed this issue 2026-02-22 18:30:37 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jul 17, 2025):

You can call Copilot's LLM deployment at https://api.githubcopilot.com/chat/completions with a POST request. Requests and responses should follow the format as the OpenAI API.

You should be able to do this with the Generic OpenAI Provider
Base URL of https://api.githubcopilot.com
Then use the token as the auth token
Then use whatever the model is you wish to use.

Have you tried this?

@timothycarambat commented on GitHub (Jul 17, 2025): > You can call Copilot's LLM deployment at https://api.githubcopilot.com/chat/completions with a POST request. Requests and responses should follow the format as the [OpenAI API](https://platform.openai.com/docs/api-reference/chat/create). You should be able to do this with the `Generic OpenAI Provider` Base URL of `https://api.githubcopilot.com` Then use the token as the auth token Then use whatever the `model` is you wish to use. Have you tried this?
Author
Owner

@pjmartorell commented on GitHub (Oct 8, 2025):

I can confirm that this setup works. Here’s how I configured it:

  • LLM Provider: Generic OpenAI
  • Base URL: https://api.githubcopilot.com
  • API Key: I couldn’t get a GitHub Personal Access Token (PAT) or a Fine-grained token to work. Instead, I extracted a GitHub Copilot access token from my JetBrains IDE, following the steps described here. I’m not sure if this is the recommended or fully compliant method according to Github ToS, but it does work for now.
  • Chat Model Name: I used gpt-5. You can find other available models in the GitHub Models Marketplace or via the GitHub Models extension.
  • Token Context Window: 4096 (adjustable depending on the model)
  • Max Tokens: 1024 (also adjustable based on your needs and model limits)
@pjmartorell commented on GitHub (Oct 8, 2025): I can confirm that this setup works. Here’s how I configured it: * **LLM Provider:** Generic OpenAI * **Base URL:** `https://api.githubcopilot.com` * **API Key:** I couldn’t get a GitHub Personal Access Token (PAT) or a Fine-grained token to work. Instead, I extracted a GitHub Copilot access token from my JetBrains IDE, following the steps described [here](https://aider.chat/docs/llms/github.html). I’m not sure if this is the recommended or fully compliant method according to Github ToS, but it does work for now. * **Chat Model Name:** I used `gpt-5`. You can find other available models in the [GitHub Models Marketplace](https://github.com/marketplace?type=models) or via the [GitHub Models](https://github.com/github/gh-models) extension. * **Token Context Window:** 4096 (adjustable depending on the model) * **Max Tokens:** 1024 (also adjustable based on your needs and model limits)
Author
Owner

@ddeedev commented on GitHub (Nov 28, 2025):

I can confirm that this setup works. Here’s how I configured it:

  • LLM Provider: Generic OpenAI
  • Base URL: https://api.githubcopilot.com
  • API Key: I couldn’t get a GitHub Personal Access Token (PAT) or a Fine-grained token to work. Instead, I extracted a GitHub Copilot access token from my JetBrains IDE, following the steps described [here](https://aider.chat/docs/llms/github.html). I’m not sure if this is the recommended or fully compliant method according to Github ToS, but it does work for now.
  • Chat Model Name: I used gpt-5. You can find other available models in the [GitHub Models Marketplace](https://github.com/marketplace?type=models) or via the [GitHub Models](https://github.com/github/gh-models) extension.
  • Token Context Window: 4096 (adjustable depending on the model)
  • Max Tokens: 1024 (also adjustable based on your needs and model limits)

I followd these stop but...

Could not respond to message.
403 Access to this endpoint is forbidden. Please review our [Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service).
@ddeedev commented on GitHub (Nov 28, 2025): > I can confirm that this setup works. Here’s how I configured it: > > * **LLM Provider:** Generic OpenAI > * **Base URL:** `https://api.githubcopilot.com` > * **API Key:** I couldn’t get a GitHub Personal Access Token (PAT) or a Fine-grained token to work. Instead, I extracted a GitHub Copilot access token from my JetBrains IDE, following the steps described [[here](https://aider.chat/docs/llms/github.html)](https://aider.chat/docs/llms/github.html). I’m not sure if this is the recommended or fully compliant method according to Github ToS, but it does work for now. > * **Chat Model Name:** I used `gpt-5`. You can find other available models in the [[GitHub Models Marketplace](https://github.com/marketplace?type=models)](https://github.com/marketplace?type=models) or via the [[GitHub Models](https://github.com/github/gh-models)](https://github.com/github/gh-models) extension. > * **Token Context Window:** 4096 (adjustable depending on the model) > * **Max Tokens:** 1024 (also adjustable based on your needs and model limits) I followd these stop but... ```text Could not respond to message. 403 Access to this endpoint is forbidden. Please review our [Terms of Service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service). ```
yindo changed title from [FEAT]: How to use GitHub Copilot's LLM to [GH-ISSUE #4166] [FEAT]: How to use GitHub Copilot's LLM 2026-06-05 14:47:45 -04:00
Author
Owner

@MoazAlkharfan commented on GitHub (Mar 25, 2026):

@timothycarambat @pjmartorell This is against the Github TOS, to use copilot it will need to use the Copilot SDK https://github.com/github/copilot-sdk

<!-- gh-comment-id:4124882590 --> @MoazAlkharfan commented on GitHub (Mar 25, 2026): @timothycarambat @pjmartorell This is against the Github TOS, to use copilot it will need to use the Copilot SDK https://github.com/github/copilot-sdk
Author
Owner

@igitur commented on GitHub (Apr 13, 2026):

@timothycarambat Can we reopen this issue or should I log a new one? We'd love to get a Github Copilot compliant solutions working.

<!-- gh-comment-id:4234494893 --> @igitur commented on GitHub (Apr 13, 2026): @timothycarambat Can we reopen this issue or should I log a new one? We'd love to get a Github Copilot compliant solutions working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2652