GitHub Models no longer exists. GitHub retired it on 2026-07-30. On 2026-12-02, https://models.github.ai answered every path we tried with HTTP 200, content-type: text/plain and the body OK\r\n. That included /inference/chat/completions, /catalog/models, a made-up path, a request with no token and one with Bearer not-a-token. Neither OpenAI SDK raises on it. client.chat.completions.create(...) returns the Python or JS string "OK\r\n", and a streamed call ends with zero chunks and no error. An agent that learned "free LLM API with a GitHub token" before July 2026 gets no error that says the service is gone.
$ curl -i https://models.github.ai/inference/chat/completions -H "Authorization: Bearer not-a-token" -d '{}'HTTP/2 200content-type: text/plain OK| Client (2026-12-02) | Call | What came back | |---|---|---| | curl, valid PAT / bad token / no auth | any method, any path | 200 text/plain "OK\r\n" (~1.0 s from India) | | openai-python 3.62.2 | chat.completions.create() | returns str 'OK\r\n'; fails later at .choices: AttributeError: 'str' object has no attribute 'choices' | | openai-python | stream=True | iterator yields 0 chunks, no exception | | openai-python | models.list() | AttributeError: 'str' object has no attribute '_set_private_attributes' | | openai-python | embeddings.create() | AttributeError: 'str' object has no attribute 'data' | | openai-node 7.68.0 | chat.completions.create() | resolves to string "OK\r\n"; then TypeError: Cannot read properties of undefined (reading '0') | | openai-node | stream: true / models.list() | 0 chunks / empty list, no error | | gh models (gh-models v0.0.25) | list, run, view | Error: invalid character 'O' looking for beginning of value, exit 1 | | old endpoint models.inference.ai.azure.com | DNS | NXDOMAIN (curl exit 6) |
GitHub's retirement note (2026-07-30)
From the GitHub Changelog, July 30, 2026:
> As of July 30, 2026, GitHub Models is now retired. The playground, model catalog, inference API, and bring your own key (BYOK) are no longer available to any customer, including existing customers with active usage.
What to use instead, in GitHub's words: "For new and existing projects that need AI model access, Microsoft Foundry offers a broad model catalog. To build AI-powered workflows directly on GitHub, GitHub Copilot gives you access to a range of models." The docs page (docs.github.com/en/github-models) says the same and links Azure AI Foundry at ai.azure.com. github.com/marketplace/models now returns 404. GitHub doesn't offer a free OpenAI-compatible replacement. For a free key that works with the OpenAI SDK, see our Groq free tier and OpenRouter :free reviews from the same week.
Why the OpenAI SDKs don't raise on models.github.ai
Both SDKs raise only on non-2xx status codes. For a 2xx response whose content-type isn't JSON, they hand back the body text as the result. So the call "succeeds", and the error shows up later as an AttributeError/TypeError on .choices. That error points at your own code, not at the endpoint. Retry logic never fires, because nothing ever sees a 4xx/5xx. Streaming is worse: the SSE parser finds no data: lines, so the loop ends cleanly with an empty answer.
A fail-fast guard, tested against the endpoint (guard.py):
raw = client.chat.completions.with_raw_response.create(model=m, messages=msgs)if not raw.headers.get("content-type", "").startswith("application/json"): raise RuntimeError(f"{client.base_url} returned HTTP {raw.status_code} {raw.headers.get('content-type')!r}: {raw.text[:80]!r}")resp = raw.parse()Output: RuntimeError: https://models.github.ai/inference/ returned HTTP 200 'text/plain': 'OK\r\n' (not an OpenAI-compatible API).
gh models CLI in December 2026: installs fine, every command fails with a JSON parse error
gh 2.106.0 has no built-in models command (unknown command "models" for "gh"). gh extension install github/gh-models still succeeds and installs v0.0.25, although the repo is archived (last push 2026-09-02). Then gh models list, gh models run openai/gpt-4.1-mini "Say OK." and gh models view all print:
Error: invalid character 'O' looking for beginning of valueThat's Go's JSON decoder choking on the OK body. The error doesn't mention retirement. The extension's help text still shows gh models run openai/gpt-4o-mini "how many types of hyena are there?".
You can still create a token with the "Models" permission
On 2026-12-02, GitHub's fine-grained token form still offered Models: Read-only ("Allows access to GitHub Models."). We created one with no warning that the service is retired, and gh api user with it worked. A working token for a dead service makes a setup look correct, so don't treat a successful auth check as a sign the endpoint is alive.
The old Azure endpoint fails loudly instead
models.inference.ai.azure.com (the pre-2025 GitHub Models base URL) no longer resolves: it's a CNAME to modelmesh-nexus-global-main.trafficmanager.net, and the lookup returns NXDOMAIN. So code pinned to it gets a connection error, not a fake success.
Method and evidence
Every request was made from the testvm VM in India with the review account's own PAT (findsmith, models:read only, 7-day expiry). The token has since been deleted. check-host.net nodes in Iran, Moldova, Serbia and Turkey also got 200 OK from the endpoint. The India node got a 403, so that result is ambiguous. Raw outputs, scripts and the docs snapshots are in repro/NOTES.md.
Tested: 2026-12-02. Outdated if: models.github.ai starts returning a 4xx/410 or redirects, or GitHub drops the "Models" token permission.
Connected posts
Groq API free tier hands-on (Dec 2026): 0.2–0.5 s TTFT from India, but prompts over 8K tokens get 413, qwen3.8-27b hides a 1K output-token/min cap, gpt-oss rejects tool_choice
OpenRouter free models, hands-on Dec 2026: 50 requests/day per account, Gemma 4 31B :free failed 32 of 32 with upstream 429s, and popular :free ids now 404