Using Copilot chat API programatically #112339
Replies: 7 comments 3 replies
-
|
Yes, I'm curious about that as well. 🤔 There is a oficial documentation for the Management API, which allows you to manage seats for an organization. However, I haven't found any official documentation for Chat, Autocomplete, or similar features. I did come across an unofficial Python project that provides some insights into the endpoint and necessary payload, but it's not ideal since there's no official API, leaving us uncertain about the possibilities. In addition there are the same question or at least related here And in another sources: |
Beta Was this translation helpful? Give feedback.
-
|
Yes,I also want this feautre. Please Github Copilot team think about that. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Just had some luck with this as a workaround: https://docs.github.com/en/copilot/using-github-copilot/using-github-copilot-in-the-command-line |
Beta Was this translation helpful? Give feedback.
-
|
Well i succeeded , but github still tracks the user' s copilot usage , everything is the same except that you are chatting from anywhere you want not just on github's website. All i did was start github copilot for immersive conversation from my chrome browser, then also open the chrome developer tools , write some silly message to obtain network logs , then switch to you devtools network tab, search for a request called curl 'https://github.com/github-copilot/chat/token' \
-X 'POST' \ -H 'authority: github.com' \
-H 'accept: application/json' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'content-length: 0' \
-H 'content-type: application/json' \
-H 'cookie:
-H 'github-verified-fetch: true' \
-H 'origin: https://github.com' \
-H 'referer: https://github.com/copilot/c/6cf98a09-7c98-4fab-b11e-53a8f914ab7a' \
-H 'sec-ch-ua: "Chromium";v="105", "Not)A;Brand";v="8"' \
-H 'sec-ch-ua-mobile: ?1' \
-H 'sec-ch-ua-platform: "Android"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-o out.txt token=$(jq -r .token out.txt)
curl 'https://api.individual.githubcopilot.com/github/chat/threads/74ur74hirj8rj483heye6egu-ururue7/messages?' \
-H 'authority: api.individual.githubcopilot.com' \
-H 'accept: */*' \
-H 'accept-language: en-US,en;q=0.9' \
-H "authorization: GitHub-Bearer $token" \
-H 'cache-control: max-age=0' \
-H 'content-type: text/event-stream' \
-H 'copilot-integration-id: copilot-chat' \
-H 'origin: https://github.com' \
-H 'referer: https://github.com/' \
-o msg.jsonThe cookies need updating , every like a month. |
Beta Was this translation helpful? Give feedback.
-
|
GitHub Copilot does not offer a public API for direct programmatic access from languages like Python or Java. Copilot is designed to function as an AI coding assistant integrated within supported development environments, providing real-time code suggestions based on context. However, OpenAI provides an alternative through the Codex model, accessible via the OpenAI API. Codex can interpret natural language and generate code in various programming languages, including Python and Java. To utilize Codex programmatically, you can interact with the OpenAI API by sending prompts and receiving code completions in response. To get started with the OpenAI API, you'll need to sign up on the OpenAI platform, obtain an API key, and follow the provided documentation to integrate Codex into your applications. This approach allows you to leverage AI-powered code generation capabilities within your own development workflows. |
Beta Was this translation helpful? Give feedback.
-
|
This would be great for tools like https://microsoft.github.io/genaiscript/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
Hi Team,
Can I call Copilot chat API programmatically i.e. from my Python or Java code. I don't find any documentation for this
Beta Was this translation helpful? Give feedback.
All reactions