GitHub Models Free API
github.comFree access to GPT-4o, o-series and more — just a GitHub account.
Opens GitHub Models’s official key page. You create and own the key — FreeLLMKeys never sees or stores it.
Quick facts
https://models.github.ai/inferenceAbout GitHub Models’s free API
GitHub Models lets any GitHub user call top models — including OpenAI’s GPT-4o and o-series — for free using a personal access token. It is the easiest legitimate way to try GPT-4o-class models without an OpenAI bill.
The free limits are deliberately low (meant for experimentation, not production), tiered by how large the model is. You authenticate with a fine-grained PAT that has the models permission.
The endpoint speaks the OpenAI format, so you can prototype against GPT-4o here and later point the same code at the paid OpenAI or Azure endpoint.
How to get a free GitHub Models API key
- 1Go to the official key page: https://github.com/settings/tokens
- 2Create a free account — no credit card needed.
- 3Open the API keys section and generate a new key. Copy it somewhere safe.
- 4In your code, set the base URL to
https://models.github.ai/inferenceand paste your key. - 5Call a model such as
openai/gpt-4ousing the examples below.
Code examples
Replace YOUR_GITHUB_MODELS_KEY with the key you created.
from openai import OpenAI
client = OpenAI(
base_url="https://models.github.ai/inference",
api_key="YOUR_GITHUB_MODELS_KEY"
)
resp = client.chat.completions.create(
model="openai/gpt-4o",
messages=[{"role": "user", "content": "Hello!"}]
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://models.github.ai/inference",
apiKey: process.env.API_KEY, // your free GitHub Models key
});
const resp = await client.chat.completions.create({
model: "openai/gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);curl https://models.github.ai/inference/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role":"user","content":"Hello!"}]
}'Pros & cons
Pros
- Free access to GPT-4o and o-series
- Only needs a GitHub token
- Many labs in one place
- OpenAI-compatible
Cons
- Strict rate limits (prototyping only)
- Not for production load
GitHub Models free API — FAQ
Is the GitHub Models API really free?+
Yes. GitHub Models offers free tier access: Free for any GitHub account via a personal access token — rate-limited by tier. No credit card is required to start.
How do I get a free GitHub Models API key?+
Create a free account at https://github.com/settings/tokens, open the API keys section, generate a key, then set your base URL to https://models.github.ai/inference in your OpenAI-compatible code.
Which models does GitHub Models offer for free?+
GPT-4o, GPT-4o mini, o3-mini, o1, Llama 3.3 70B, Phi-4, Mistral Large, DeepSeek R1, Cohere Command R+.
What are the GitHub Models free-tier rate limits?+
Low free rate limits (per-minute + per-day requests) tiered by model size.
Is GitHub Models OpenAI-compatible?+
Yes. GitHub Models exposes an OpenAI Chat Completions compatible endpoint, so you can reuse your existing OpenAI SDK code and only change the base URL and API key.
Popular free models on GitHub Models
Related free LLM APIs
Google AI Studio (Gemini)
The most generous permanent free tier for a frontier model.
Groq
The fastest free inference on the planet — 500+ tokens/sec.
OpenRouter
One key, 300+ models — dozens are completely free.