GitHub Models Retires July 30, 2026: How to Migrate Your Code and CI Workflows
GitHub Models Retires July 30, 2026: How to Migrate Your Code and CI Workflows
If any of your code, scripts, or GitHub Actions workflows call GitHub Models, they stop working on July 30, 2026. GitHub confirmed the playground, the model catalog, the inference API, and bring-your-own-key (BYOK) support are all being retired completely — not deprecated, not moved to maintenance mode, just gone. Two brief service interruptions already happened on July 16 and July 23 to warn integrators; the 30th is the full shutdown.
The official changelog announcement is light on migration specifics — it points you to "Microsoft Foundry" and "GitHub Copilot" as replacements and links out to docs, but doesn't tell you what actually changes in your code. This post covers that gap: the exact endpoints involved, what breaks in CI, and the concrete steps to move to a working replacement before the cutoff.
What GitHub Models actually was
Launched in 2024, GitHub Models let you call hosted LLMs (GPT-4o, Llama, Mistral, Phi, DeepSeek, and others) using nothing but a GitHub personal access token — no Azure account, no separate billing setup, free within rate limits. That low-friction setup is exactly why it ended up wired into places beyond quick prototyping: CI pipelines, PR-review bots, and internal tooling that never got migrated to a production-grade provider once it worked.
Two different endpoints are in play, depending on when your code was written:
https://models.inference.ai.azure.com— the original endpoint, used with the Azure AI Inference SDK (azure-ai-inferencefor Python,@azure-rest/ai-inferencefor JS).https://models.github.ai/inference— the newer GitHub Models REST API, used by the officialactions/ai-inferenceGitHub Action.
Both endpoints go dark on July 30. If you're not sure which one you're on, grep your codebase and workflow files for either domain now — that's your actual blast radius.
1grep -rn "models.inference.ai.azure.com\|models.github.ai" --include="*.py" --include="*.js" --include="*.ts" --include="*.yml" --include="*.yaml" .
What breaks in CI specifically
The most common production use of GitHub Models isn't a standalone script — it's a workflow step using actions/ai-inference, which defaults to openai/gpt-4o and calls models.github.ai/inference under a models: read permission. A typical usage looks like this:
1- name: Run AI inference
2 uses: actions/ai-inference@v1
3 with:
4 prompt: "Summarize the changes in this PR: ${{ github.event.pull_request.body }}"
5 model: openai/gpt-4o
After July 30, this step fails outright — there's no graceful fallback, no deprecation warning in the response, just a failed HTTP call to a domain that no longer serves requests. If you have PR-summary bots, AI-assisted release-note generators, or changelog-drafting steps built on this action, they will start failing silently in workflow logs that nobody watches until someone notices the summaries stopped appearing.
Migration path 1: Azure AI Foundry (the "upgrade" path)
This is the path GitHub and Microsoft are steering you toward, and it's the least code churn if you're already on the Azure AI Inference SDK, because the SDK and request shape don't change — only the endpoint, key, and billing account do.
- Go to github.com/marketplace/models, open the model you're using, and click Use this model from the playground.
- In the "Configure authentication" step, select Get Microsoft Foundry key under the Azure AI section.
- Sign in to (or create) an Azure account. A free account has to be upgraded to a standard/paid plan first — GitHub Models was free-with-rate-limits, Foundry is billed per token to your Azure subscription.
- You land in the Foundry portal. Deploy the model you need — unlike GitHub Models, nothing is pre-configured, so add every model you plan to call before you go live.
- Copy the new endpoint and key from Project settings > Keys and endpoints.
The code change is a two-line swap:
1# Before — GitHub Models
2endpoint = "https://models.inference.ai.azure.com"
3token = os.environ["GITHUB_TOKEN"]
4
5# After — Azure AI Foundry
6endpoint = "https://<your-project>.services.ai.azure.com/models"
7token = os.environ["AZURE_AI_FOUNDRY_KEY"]
The rest of the ChatCompletionsClient call — SystemMessage, UserMessage, model, temperature, max_tokens — is unchanged. If you want to avoid managing a static key entirely, Foundry also supports Entra ID token auth, which GitHub Models never offered.
Migration path 2: fix your GitHub Actions workflows
actions/ai-inference has no announced replacement action from GitHub as of this writing, and its own repo has no reference to the July 30 retirement. Don't wait for one. Two realistic options:
Option A — call Azure AI Foundry directly with curl in the workflow step:
1- name: Run AI inference
2 env:
3 FOUNDRY_ENDPOINT: ${{ secrets.FOUNDRY_ENDPOINT }}
4 FOUNDRY_KEY: ${{ secrets.FOUNDRY_KEY }}
5 run: |
6 curl -s "$FOUNDRY_ENDPOINT/chat/completions?api-version=2026-01-01-preview" \
7 -H "Content-Type: application/json" \
8 -H "api-key: $FOUNDRY_KEY" \
9 -d '{
10 "model": "gpt-4o",
11 "messages": [{"role": "user", "content": "Summarize this PR"}]
12 }'
Option B — swap to your existing provider's official action, if your team already pays for OpenAI or Anthropic API access outside of GitHub Models. This is usually the lower-maintenance choice if the workflow only ever needed one specific model rather than GitHub Models' free multi-model catalog.
Either way, store the new endpoint and key as repo or org secrets — don't hardcode them, and don't reuse the old GITHUB_TOKEN pattern, since that authentication mechanism is specific to GitHub Models and won't work against Foundry or a direct provider endpoint.
Migration path 3: skip Azure, go straight to a provider API
If you don't want an Azure dependency at all, both OpenAI and Anthropic have direct APIs with comparable SDKs. This is the right call if you were only using GitHub Models for one model family and the free tier was the only reason you weren't already on the provider directly:
1# Anthropic direct
2import anthropic
3client = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
4response = client.messages.create(
5 model="claude-sonnet-5",
6 max_tokens=1000,
7 messages=[{"role": "user", "content": "What is the capital of France?"}]
8)
You lose the multi-model catalog GitHub Models gave you for free, but you gain a stable, directly-billed relationship with the provider instead of routing through an intermediary that can retire the whole product with six weeks' notice.
Best practices
- Migrate CI before local scripts. A broken local prototype wastes your time; a broken CI step fails silently in logs nobody reads and erodes trust in the whole pipeline.
- Move secrets to the same place your other API keys live (GitHub Actions secrets, a vault, whatever you already use) rather than improvising a one-off storage location for this migration.
- Pin the model explicitly once you're on Foundry or a direct provider. GitHub Models' catalog UI made model-swapping trivial; production code shouldn't silently change model behavior because someone changed a dropdown.
Common mistakes to avoid
- Assuming
actions/ai-inferencewill get a compatibility shim. Nothing in the action's repo or GitHub's own changelog suggests one is coming. Treat July 30 as a hard deadline for this action specifically. - Reusing
GITHUB_TOKENagainst the new endpoint. It authenticated against GitHub Models specifically; Foundry needs an Azure key or Entra ID token, and direct provider APIs need their own key. - Migrating the endpoint but not the billing expectation. GitHub Models was free within rate limits. Foundry and direct provider APIs are billed per token from day one — budget for it before you flip the switch, especially on high-volume CI steps that run on every PR.
Troubleshooting
401/403 after swapping the endpoint. You're almost certainly still sending the old GITHUB_TOKEN — Foundry and direct provider APIs reject it outright rather than falling back.
Model not found error in Foundry. Unlike GitHub Models, Foundry doesn't pre-configure every model. Go to Model catalog in the Foundry portal and deploy the specific model your code references before calling it.
Workflow step suddenly failing with a generic connection error after July 30. Check whether it's still hitting models.github.ai or models.inference.ai.azure.com — both domains are expected to stop resolving or start refusing connections once the retirement completes.
FAQ
Does GitHub Copilot replace GitHub Models? Not directly for API access — Copilot is an IDE/CLI assistant experience, not a callable inference API for your own code or CI steps. If you need programmatic model access, Azure AI Foundry or a direct provider API is the actual replacement.
Do I need an Azure subscription to keep using the same models I had on GitHub Models? Only if you migrate to Azure AI Foundry. If you move to a direct provider API (OpenAI, Anthropic) instead, you don't need Azure at all — you need an account and API key with that provider.
Is there a grace period after July 30? Nothing in GitHub's announcement indicates one. The stated timeline is brief interruptions on July 16 and July 23, then full retirement on July 30 — plan for a hard cutoff, not a soft one.
What happens to prompt files I wrote for actions/ai-inference?
The .prompt.yml files themselves aren't GitHub Models-specific — they're a portable prompt format. You'll likely still be able to reuse the prompt content once you point the calling code or action at a new endpoint; it's the transport layer that breaks, not your prompts.
Will this affect GitHub Copilot Chat or Copilot code completions? No — Copilot's own model access runs through a separate arrangement, not through GitHub Models' public inference API. This retirement is specifically about the standalone playground/catalog/API product.
Key takeaways
| What's retiring | Replace with |
|---|---|
models.inference.ai.azure.com (Azure AI Inference SDK calls) | Azure AI Foundry endpoint + key, same SDK |
models.github.ai/inference (REST API) | Azure AI Foundry REST endpoint, or a direct provider API |
actions/ai-inference GitHub Action | Direct curl to Foundry in the workflow step, or your provider's official action |
GitHub PAT / GITHUB_TOKEN auth | Azure key, Entra ID token, or provider-specific API key |
| Free rate-limited usage | Paid, per-token billing on Azure or your chosen provider |
Further Reading
- Amazon Bedrock Agents Classic Enters Maintenance Mode: What to Do Before July 30, 2026
- MCP Goes Stateless on July 28, 2026: What Breaks and How to Migrate Your Server
- GitHub Actions Checkout v7: Fixing the Pwn Request Vulnerability Before July 16
- GitHub Models is being fully retired on July 30, 2026 (official changelog)
- Upgrade from GitHub Models to Microsoft Foundry Models (official docs)