Save a request's settings under a name, and use them by naming the preset as the model.
A preset is a request's settings saved under a name: the model or its fallbacks, the provider routing, the system prompt, the parameters, the helpers and the response cache. A request uses it by naming @preset/<slug> as its model. Every version is kept.
All preset routes are free and take an API key: Authorization: Bearer $OPENDUNES_API_KEY.
| Method | Path | Does |
|---|---|---|
POST | /v1/presets/{slug}/chat/completions | creates a preset, or a new version of it, from a Chat Completions body |
POST | /v1/presets/{slug}/messages | the same, from an Anthropic Messages body |
POST | /v1/presets/{slug}/responses | the same, from a Responses body |
GET | /v1/presets | lists your presets |
GET | /v1/presets/{slug} | reads one, with its current version |
GET | /v1/presets/{slug}/versions | lists its versions |
GET | /v1/presets/{slug}/versions/{version} | reads one version |
Send the body you would send to the route, to the preset route of the same shape. Only the settings are kept; the conversation (messages, input, prompt), stream and user are ignored.
curl https://opendunes.com/v1/presets/souk-bot/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-H "X-OpenDunes-Cache: true" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{ "role": "system", "content": "You answer Souk customers in French and Darja." },
{ "role": "user", "content": "ignored" }
],
"temperature": 0.3,
"provider": { "sort": "price" }
}'The slug is letters, digits, ., _ and -, up to 120 characters. Saving under a slug that exists adds a version and makes it current. model is required.
What a preset keeps:
| Kept | Fields |
|---|---|
| the model and routing | model, models, fallbacks, provider, route |
| the system prompt | the system message (Chat Completions), system (Messages), instructions (Responses) |
| the parameters | temperature, top_p, top_k, top_a, min_p, seed, frequency_penalty, presence_penalty, repetition_penalty, max_tokens, max_completion_tokens, max_output_tokens, stop, stop_sequences, logit_bias, logprobs, top_logprobs, response_format, text, reasoning, reasoning_effort, thinking, output_config, modalities, audio, truncation, parallel_tool_calls |
| the helpers | tools, tool_choice, plugins, max_tool_calls, stop_server_tools_when |
| the prompt cache marks | cache_control, prompt_cache_key |
| the response cache | from the X-OpenDunes-Cache and X-OpenDunes-Cache-TTL headers of the saving request |
The answer is the preset with its new current version:
{
"data": {
"id": "a2d1a0c4-6f0e-4d2b-9d3a-6a1e2b7c9f10",
"slug": "souk-bot",
"name": "souk-bot",
"description": null,
"status": "active",
"status_updated_at": null,
"creator_user_id": "a2d15551-0b7e-4c1a-8e8e-3f0c2a9d1b22",
"designated_version_id": "a2d1a0c5-1b2c-4d3e-8f90-1a2b3c4d5e6f",
"created_at": "2026-09-24T09:12:03Z",
"updated_at": "2026-09-24T09:12:03Z",
"designated_version": {
"id": "a2d1a0c5-1b2c-4d3e-8f90-1a2b3c4d5e6f",
"preset_id": "a2d1a0c4-6f0e-4d2b-9d3a-6a1e2b7c9f10",
"version": 1,
"config": {
"model": "anthropic/claude-sonnet-5",
"temperature": 0.3,
"provider": { "sort": "price" },
"cache": { "enabled": true }
},
"system_prompt": "You answer Souk customers in French and Darja.",
"creator_id": "a2d15551-0b7e-4c1a-8e8e-3f0c2a9d1b22",
"created_at": "2026-09-24T09:12:03Z",
"updated_at": "2026-09-24T09:12:03Z"
}
}
}Name it as the model, on any of the three text routes:
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "@preset/souk-bot",
"messages": [{ "role": "user", "content": "Wach kayen iPhone 16?" }]
}'The preset's settings fill in what the request leaves out; a value the request sets itself wins. The system prompt is placed in each shape's own word. An unknown preset answers 404 before any model runs.
GET /v1/presets and GET /v1/presets/{slug}/versions take offset (default 0) and limit (1 to 100, default 50), and answer { "data": [...], "total_count": n }, oldest first. GET /v1/presets/{slug} answers the preset with its designated_version; GET /v1/presets/{slug}/versions/{version} answers one version. A slug or version that does not exist is a 404.
Presets you saved in the dashboard without a slug stay the dashboard's; they are not listed here.