GitHub Models logo

GitHub Models Free API

github.com

Free access to GPT-4o, o-series and more — just a GitHub account.

Free tier No credit card OpenAI-compatible Verified November 2026
Get your free GitHub Models key

Opens GitHub Models’s official key page. You create and own the key — FreeLLMKeys never sees or stores it.

Quick facts

Base URL
https://models.github.ai/inference
Free access
Free for any GitHub account via a personal access token — rate-limited by tier.
Rate limits
Low free rate limits (per-minute + per-day requests) tiered by model size.
Credit card
Not required
OpenAI-compatible
Yes — reuse your OpenAI SDK
Free models
GPT-4o, GPT-4o mini, o3-mini, o1, Llama 3.3 70B, Phi-4, Mistral Large, DeepSeek R1, Cohere Command R+

About 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

  1. 1Go to the official key page: https://github.com/settings/tokens
  2. 2Create a free account — no credit card needed.
  3. 3Open the API keys section and generate a new key. Copy it somewhere safe.
  4. 4In your code, set the base URL to https://models.github.ai/inference and paste your key.
  5. 5Call a model such as openai/gpt-4o using the examples below.

Code examples

Replace YOUR_GITHUB_MODELS_KEY with the key you created.

Python
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)
JavaScript
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
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