ModelHubby

← All guides · provider record →

GitHub Models — free tier setup

What you get free

A permanent free prototyping tier for every GitHub account: 45+ models from OpenAI, DeepSeek, Meta, and others behind one OpenAI-compatible endpoint. Catalog quota: "Low models (Copilot Free/Pro): 15 requests/minute, 150 requests/day, 8000 in / 4000 out tokens per request, 5 concurrent. High models (Free/Pro): 10 requests/minute, 50 requests/day, 8000 in / 4000 out tokens per request, 2 concurrent. Limits: Dependent on Copilot subscription tier (Free/Pro/Pro+/Business/Enterprise)." Category: permanent_free. The gotcha that matters: the per-request token caps (8K in / 4K out) apply regardless of a model's advertised context window — a "1M context" model still only accepts 8K input tokens per request here.

Friction check

Credit card no
Phone verification no
Org/membership GitHub account required; no org needed
Est. time to first key 5m
Trains on your prompts unknown ("Responsible use of GitHub Models" policy applies; training/logging specifics not confirmed)

Get a key

Auth is a GitHub fine-grained personal access token (PAT) with the models permission — there is no separate "GitHub Models API key".

  1. Log in at github.com. Click your profile picture (upper-right corner) → Settings.
  2. In the left sidebar, click Developer settings (bottom).
  3. Under Personal access tokens, click Fine-grained tokens, then Generate new token.
  4. Set a Token name (e.g. modelhubby-inference) and an Expiration (pick a real date; you'll rotate anyway).
  5. Resource owner: your user account. Repository access: none/public is fine — Models does not need repo access (unconfirmed — verify on first signup).
  6. In the Permissions section, under account permissions, set Models to Read-only (the quickstart calls this "a PAT with the models scope").
  7. Click Generate token and copy it immediately — it is shown once.

First request

Chat completions against the endpoint confirmed in the official quickstart. Success shape: JSON with choices[0].message.content.

export GITHUB_TOKEN="YOUR_KEY"
curl -L -X POST https://models.github.ai/inference/chat/completions \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"Say OK."}],"max_tokens":16}'

Limits that will bite you

  • Per-request token caps are the binding constraint: 8,000 input / 4,000 output tokens per request on Copilot Free/Pro, for both tiers. Long-context use cases don't fit.
  • Two model tiers (catalog): low tier (e.g. openai/gpt-4.1-mini, deepseek/DeepSeek-R1) = 15 RPM / 150 RPD, 5 concurrent; high tier (e.g. openai/gpt-4.1, openai/gpt-4o, openai/gpt-5) = 10 RPM / 50 RPD, 2 concurrent.
  • Limits scale with your Copilot subscription tier (Free/Pro/Pro+/Business/Enterprise) — the numbers above are Free/Pro.
  • Legacy endpoint models.inference.ai.azure.com is superseded — use https://models.github.ai/inference only.
  • Whether daily quotas are shared across models is unknown in the catalog — budget as if they are.

Key rotation runbook

  • Second key: repeat the PAT steps — GitHub allows many fine-grained tokens; give each a distinct name (modelhubby-inference-2).
  • Revoke: Settings → Developer settings → Personal access tokens → Fine-grained tokens → open the token → delete/revoke it (exact button label unconfirmed — verify on first signup). Revocation is immediate.
  • ModelHubby integration: export GITHUB_TOKEN_2="..." — the key pool picks it up automatically; state machine cools down rate-limited keys per-key.

ModelHubby usage

pnpm mh show github-models
pnpm mh probe --live --provider github-models --apply