Copilot / GitHub Models
GitHub Copilot's Core API isn't opened up as a public REST API. Instead GitHub Models or Azure AI Inference can be used through an OpenAI-compatible endpoint.
text
POST https://models.inference.ai.azure.com/chat/completions
Authorization: Bearer <GITHUB_TOKEN>
Content-Type: application/json
{
"model": "gpt-4o-mini",
"messages": [{"role":"user","content":"Hello"}]
}Note Endpoints/permissions can vary by org or subscription. Check what's appropriate for your setup.