Aliases, Latest, and Pinned Versions
On this page
Three ways to reference a model
Your request’s model field accepts three naming conventions to designate what is, on the surface, the same model. This isn’t just documentation nitpicking: depending on which convention you choose, your application will receive either the exact same model on every call for months, or a version liable to change without notice. Most unexplained production regressions—“our responses got longer, but nobody changed anything”—stem from this.
Simple alias
The simple alias uses the base model name, without a suffix:
{
"model": "grok-4.20"
}
This points to the latest stable version of the model. xAI can update the underlying version at any time, and you’ll only know by monitoring your own outputs. This flexibility is exactly what you want during development and prototyping: you’re always working with the best available version without having to update anything. As long as you’re iterating on prompts, exploring model capabilities, and exact response reproducibility doesn’t matter, this convention works.
Latest alias
The latest alias points to the most advanced version, one that hasn’t been stabilized yet:
{
"model": "grok-4.20-latest"
}
What you get here can change frequently and include changes still under validation. It’s an evaluation tool, useful for testing upcoming versions before they become the default alias, measuring quality or performance gains, and preparing your migration informed.
It belongs in test environments, never in production. A change can happen overnight, alter your prompt behavior, and reach your users without warning—you won’t have a commit line or ticket to blame to understand what happened.
Pinned version
A pinned version includes a date in the identifier:
{
"model": "grok-4.20-0309"
}
The -0309 suffix corresponds to the release date, here March 9. This version doesn’t move: as long as it remains active, the model responding today will be the one responding in six months. It’s the only defensible option for production, for four solid reasons. Your application behavior becomes reproducible, making your integration and regression tests valid long-term. No silent updates can catch you off guard. Migration timing becomes a planned team decision, not something that happens to you. And if behavior changes anyway, you know the cause is on your end.
One convention per environment
Best practice isn’t choosing between the three, but assigning each to its environment:
import os
ENVIRONMENT = os.getenv("APP_ENV", "development")
MODEL = {
"development": "grok-4.20", # Simple alias: latest stable
"staging": "grok-4.20-latest", # Latest: test new features
"production": "grok-4.20-0309", # Pinned version: maximum stability
}[ENVIRONMENT]
Think of this dictionary as an early warning system. Your staging runs on latest permanently: if an upcoming change breaks a prompt, your integration tests catch it before your users do. Your production stays on a pinned version in the meantime. You discover changes upstream without ever suffering them downstream.
Moving from one pinned version to the next
When a new pinned version appears—say grok-4.20-0612—switching deserves a procedure rather than a simple string change. First deploy the new version to staging via the latest alias, run your prompt test suite there, then compare the results with those from the version currently in production. If the comparison is satisfactory, update the production configuration, monitor metrics for 48 hours—response quality, satisfaction rate, cost—and validate the migration or revert to the previous version.
The comparison step is the core of the system, and it assumes you’ve kept the outputs from the version in place: without this reference, “comparing” reduces to an impression. The observation phase deliberately includes cost. A newer version might be more verbose, generate more output tokens, and increase your bill by several percent for equal perceived quality. Forty-eight hours is usually enough to see this, and reverting to the previous version remains a simple config line.
Key takeaways
- Simple alias (
grok-4.20): latest stable version, for development - Latest alias (
grok-4.20-latest): bleeding edge version, for testing only - Pinned version (
grok-4.20-0309): immutable, the only recommended option for production - Use different conventions per environment (dev/staging/prod)
- Plan a structured migration process when moving from one pinned version to another