Aliases
Aliases let you use semantic names like smart or fast instead of specific model names. Relai automatically routes to the best model matching that profile.
Available Aliases
| Alias | Description | Typical Model |
|---|---|---|
| smart | Best quality-to-cost ratio | claude-sonnet-4.6 |
| fast | Lowest latency | gpt-5.5-mini |
| cheap | Lowest cost per token | gemini-2.5-flash |
| best | Highest capability | claude-opus-4.7 |
| code | Optimized for code generation | claude-sonnet-4.6 |
Using Aliases
Simply use the alias as your model name:
{
"model": "smart",
"messages": [
{"role": "user", "content": "Explain quantum computing"}
]
}Benefits
Future-Proof Code
When better models become available, your smart requests automatically upgrade:
// Your code doesn't change
const response = await client.chat.completions.create({
model: "smart",
messages: [...],
});
// But you get the latest best-in-class modelCost Optimization
The cheap alias automatically routes to the most cost-effective model that can handle your request:
// Perfect for high-volume, simple tasks
const response = await client.chat.completions.create({
model: "cheap",
messages: [{ role: "user", content: "Summarize: ..." }],
});Latency Optimization
The fast alias prioritizes response time:
// Ideal for real-time applications
const response = await client.chat.completions.create({
model: "fast",
messages: [{ role: "user", content: "Quick question..." }],
});Response Headers
When using aliases, the response includes headers showing the actual model used:
X-Relai-Model: claude-sonnet-4.6
X-Relai-Alias: smartCustom Aliases (Coming Soon)
Organization-specific aliases will let you define your own routing rules:
# Example future config
aliases:
internal-chat:
models: [gpt-5.5-mini, claude-haiku-4]
strategy: lowest-cost
max_tokens: 4096