GitHub Models
by docs.github.com
AI models and chat
Added on October 31st, 2026
Checked and working on November 1st, 2026
Visit docs.github.com →
What it does
GitHub Models lets developers try and compare AI models from OpenAI, Meta, Microsoft, Mistral, DeepSeek and others, in a playground on GitHub and through an API that uses a GitHub personal access token. It is meant for prototyping and experiments, for example to test prompts before building an app. Free for every GitHub account, with daily and per-minute request limits per model that depend on your Copilot plan; paid usage is available for more.
At a glance
- API key
- Needed, free · More APIs with a free key
- Pricing
- Free for every GitHub account, with daily and per-minute request limits per model that depend on your Copilot plan; paid usage is available for more.
- From the browser
- Yes (CORS)
- Formats
- JSON
- Interface
- REST
- Provider
- docs.github.com
- Last checked
- Working on November 1st, 2026
More information: https://docs.github.com/en/github-models
Compare: OpenRouter vs GitHub Models
Used in: Build a chatbot on free AI API tiers
Is this your service? Show that it is listed
Put this badge on your website or in your README; it links to this page. About the badge
Example request
curl
curl -X POST 'https://models.github.ai/inference/chat/completions' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"model": "openai/gpt-4.1-mini", "messages": [{"role": "user", "content": "hello"}]}'
JavaScript
const response = await fetch("https://models.github.ai/inference/chat/completions", {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"hello"}]}),
});
const data = await response.json();
console.log(data);
Python
import requests
response = requests.post(
"https://models.github.ai/inference/chat/completions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "openai/gpt-4.1-mini",
"messages": [
{
"role": "user",
"content": "hello",
},
],
},
timeout=30,
)
print(response.json())
Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.