Model presets
Name a model choice once, such as @text or @embedding, and call it from every product. Change the model, its fallbacks and defaults in the dashboard without touching code.
MarkdownOn this page
A preset is a name for a model choice. Instead of writing openai/gpt-4o-mini into every product, you write @text, and decide in the dashboard which model @text means, which models to fall back to and which defaults to apply. When a better or cheaper model comes out, you change the preset once and every product that calls @text follows, without a deploy.
Call a preset
Put the preset name, with @ in front, where a model id would go:
# "@text" is resolved to the model, fallbacks and defaults configured for your project or company.
curl -i https://api.getlykia.com/v1/chat/completions \
-H "Authorization: Bearer $LYKIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "@text",
"messages": [
{ "role": "user", "content": "Write a one-line welcome message for new customers." }
]
}'import os
from openai import OpenAI
client = OpenAI(base_url="https://api.getlykia.com/v1", api_key=os.environ["LYKIA_API_KEY"])
# The preset name goes where a model id would; the response's model is the real model that answered.
response = client.chat.completions.with_raw_response.create(
model="@text",
messages=[{"role": "user", "content": "Write a one-line welcome message for new customers."}],
)
completion = response.parse()
print(response.headers.get("X-Lykia-Preset"), completion.model)
print(completion.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.getlykia.com/v1", apiKey: process.env.LYKIA_API_KEY });
// The preset name goes where a model id would; the response's model is the real model that answered.
const { data: completion, response } = await client.chat.completions
.create({
model: "@text",
messages: [{ role: "user", content: "Write a one-line welcome message for new customers." }],
})
.withResponse();
console.log(response.headers.get("X-Lykia-Preset"), completion.model);
console.log(completion.choices[0].message.content);The response's model field is the real model that answered, and the X-Lykia-Preset header names the preset. The request record keeps the preset name too, so you can filter logs and break usage down by preset. Presets work in POST /chat/completions, POST /embeddings and the media endpoints (images, videos, speech, voices and transcriptions), and anywhere a model id is accepted, including the models fallback list and the project's default model.
What a preset holds
Name — Lowercase letters, digits and hyphens, starting with a letter, at most 32 characters (text, support-bot, embedding). You call it as @name.
Model — The model the preset points to. Its kind (chat, embedding, image, video, speech or transcription) decides where the preset can be used: a chat request with an embedding preset, or an image request with a chat preset, gets 400 with the code preset_modality_mismatch.
Fallbacks — Up to three models of the same kind, tried in order when the model cannot answer. A request's own models list replaces them. See Model fallbacks.
Defaults — Request fields applied when the request does not set them: temperature, top_p, max_tokens, reasoning, response_format, provider and cache; for media presets also size, aspect_ratio, quality, resolution, duration and voice.
A value in the request always wins over the preset's default. Defaults are merged per top-level field: a provider object in the request replaces the preset's whole provider default. A request that sends max_completion_tokens does not get the max_tokens default, and one that sends reasoning_effort does not get the reasoning default.
Suggested names
You can use any name. The dashboard offers these as quick picks, so that products and teams use the same words:
| Name | Kind | Typical use |
|---|---|---|
text | chat | General text generation |
fast | chat | Short, cheap, quick answers |
reasoning | chat | Harder problems that benefit from thinking |
vision | chat | Requests with images |
assistant | chat | Agent loops with tool calls |
writer | chat | Long-form writing |
translate | chat | Translation |
search | chat | Query rewriting and result summaries in your own search |
embedding | embedding | Vectors for search and retrieval |
image | image | Image generation and editing |
video | video | Video jobs |
tts | speech | Text to speech; also the default model of GET /audio/voices |
stt | transcription | Speech to text |
Company and project presets
Presets are defined for the company and apply to every project in it. A project can define a preset with the same name, which overrides the company's preset for that project only. Lykia looks for @name in the request's project first, then in the company. In the dashboard, a project's preset list shows which presets come from the company and which are overridden in the project, and removing an override brings the company's preset back.
The company owner and company managers manage company presets; project managers manage the overrides in the projects assigned to them. Every member can see them. Each scope holds up to 50 presets. A change reaches the gateway within seconds.
Pin a preset to one provider
When a product's data may only go to one provider, give the preset no fallbacks and set its provider default to that provider with fallbacks off:
model: anthropic/claude-sonnet-4.5
fallbacks: (none)
defaults: provider = { "only": ["anthropic"], "allow_fallbacks": false }Requests to that preset then only go to that provider (your own key for it first, then Lykia's); if it cannot answer, the request fails instead of going elsewhere. See Provider routing.
Errors
| Code | Status | When |
|---|---|---|
preset_not_found | 400 | No preset with that name in the project or the company. The message lists the names that are defined. |
preset_modality_mismatch | 400 | The preset's model does not fit the endpoint, for example an embedding preset in a chat request. |
If the preset's model has since been removed from the catalog, the request fails like a request for that model would; the dashboard marks such presets with a warning.
Next steps
- Tags and usage breakdown: see what each preset costs.
- Model fallbacks: how fallback models are tried.
- JavaScript SDK:
preset()and the suggested names in code.