> ## Documentation Index
> Fetch the complete documentation index at: https://docs.routeway.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Presets

> Save a model, system prompt, and parameters as a reusable preset — then call it like a model ID, or attach it to an API key.

Presets let you bundle a model, system prompt, and generation parameters into a single reusable configuration. Once created, you reference a preset exactly like a model ID — no extra code, no repeated config.

You can also [attach a preset to an API key](#attaching-a-preset-to-an-api-key), so its settings apply to every request made with that key. This is the way to control parameters like prompt caching or reasoning effort from apps where you can't change the request body or the model name.

Presets can be **private** (only your API key can use them) or **public** (shareable with anyone).

***

## Creating a Preset

Go to [Dashboard → Presets → Create Preset](https://routeway.ai/dashboard/presets) and fill in the fields:

**1. Name your preset**

Give it a short, descriptive name. This is for your reference only.

**2. Choose a model**

Select any supported model, or choose **Any Model** to leave the model open at request time. With Any Model, callers must specify the model using the `@` syntax — see [Overriding the model](#overriding-the-model) below.

**3. Write a system prompt**

Enter the system prompt that should apply to every request using this preset. This is the main reason to use presets — ship a locked, versioned persona or instruction set without exposing the prompt in client code.

**4. Set parameters (optional)**

Configure defaults like `temperature`, `max_tokens`, `top_p`, `reasoning_effort`, `service_tier`, and prompt caching. These apply automatically to every request unless overridden. See [Preset settings](#preset-settings) for the full list.

**5. Lock the settings (optional)**

By default, a value sent in the request wins over the preset's. Turn on **Locked** to make the preset's values win instead.

**6. Set visibility**

Choose **Private** (default) or **Public**. Public presets can be used by anyone with the preset ID.

***

## Using a Preset

After creating a preset, copy its ID from the dashboard. It looks like:

```
presets/0ede00c3-b202-4102-bda7-ec9a4b398767
```

Paste it into the `model` field of any Chat Completions request — everything else stays the same.

> [tab] Python
>
> ```python theme={null}
> import os
> from openai import OpenAI
>
> client = OpenAI(
>     base_url="https://api.routeway.ai/v1",
>     api_key=os.getenv("ROUTEWAY_API_KEY")
> )
>
> response = client.chat.completions.create(
>     model="presets/0ede00c3-b202-4102-bda7-ec9a4b398767",
>     messages=[
>         {"role": "user", "content": "hi"}
>     ],
> )
>
> print(response.choices[0].message.content)
> ```

> [tab] Node.js
>
> ```javascript theme={null}
> import OpenAI from "openai";
>
> const client = new OpenAI({
>   baseURL: "https://api.routeway.ai/v1",
>   apiKey: process.env.ROUTEWAY_API_KEY,
> });
>
> async function main() {
>   const response = await client.chat.completions.create({
>     model: "presets/0ede00c3-b202-4102-bda7-ec9a4b398767",
>     messages: [
>       { role: "user", content: "hi" }
>     ],
>   });
>
>   console.log(response.choices[0].message.content);
> }
>
> main().catch(console.error);
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl https://api.routeway.ai/v1/chat/completions \
>   -H "Authorization: Bearer $ROUTEWAY_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "model": "presets/0ede00c3-b202-4102-bda7-ec9a4b398767",
>     "messages": [
>       {"role": "user", "content": "hi"}
>     ]
>   }'
> ```

The preset's system prompt and parameters are applied server-side — your request payload only needs `model` and `messages`.

***

## Overriding the Model

If a preset was created with **Any Model**, the model must be specified at request time using `@` after the preset ID:

```
presets/0ede00c3-b202-4102-bda7-ec9a4b398767@gpt-4o
```

```python theme={null}
response = client.chat.completions.create(
    model="presets/0ede00c3-b202-4102-bda7-ec9a4b398767@gpt-4o",
    messages=[
        {"role": "user", "content": "hi"}
    ],
)
```

This is useful when you want a shared system prompt and parameter set but need the caller to decide which underlying model to use — for example, letting users pick between `gpt-4o` and `gpt-4o-mini` while keeping the same persona.

***

## Attaching a Preset to an API Key

Some apps — chat front-ends, roleplay platforms, IDE plugins — only let you enter an API key and pick a model. You can't add parameters to the request or a suffix to the model name. Attach a preset to the key instead, and its settings apply to every request made with that key.

**1. Create a preset**

Create a preset as described [above](#creating-a-preset) with the settings you want, for example prompt caching set to **Off**.

**2. Attach it to a key**

Go to [Dashboard → API Keys](https://routeway.ai/dashboard/keys), create a new key or click **Edit** on an existing one, and select the preset.

**3. Use the key as usual**

Keep calling regular model IDs like `claude-opus-4-6`. The app needs no changes.

A key preset works on `/v1/chat/completions`, `/v1/responses`, and `/v1/messages`.

**The preset's model sets which requests it covers.** A preset with **Any Model** applies to every request on the key. A preset with a specific model only applies to requests for that model, and requests for other models are left untouched.

**Settings a model doesn't support are skipped, not rejected.** For example, `reasoning_effort` is ignored on models without reasoning, and a `service_tier` the model doesn't offer is ignored. This lets one **Any Model** preset serve every model on the key without causing errors.

> [!NOTE]
>
> The system prompt is only applied when you call the preset as a model (`presets/<id>`). A preset attached to a key applies its parameters, not its system prompt.

> [!NOTE]
>
> On `/v1/messages`, `max_tokens` is required in every request, so a key preset's `max_tokens` only replaces it when the preset is **Locked**.

***

## Preset Settings

| Setting | Values | Notes |
| - | - | - |
| `temperature`, `top_p` | numbers | Sampling. Dropped on models that reject them, such as current Claude models. |
| `frequency_penalty`, `presence_penalty` | numbers | Chat Completions and Responses only. |
| `max_tokens` | integer | Output limit. Sent as `max_output_tokens` on Responses. |
| `stop_sequences` | strings | Chat Completions only. |
| `reasoning_effort` | `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` | Applied only if the model supports that level. Each model's levels are in `capabilities.supported_reasoning_efforts` of the [`/v1/models`](https://docs.routeway.ai/getting-started/models) response. |
| `service_tier` | `default`, `flex`, `priority` | Applied only if the model offers that tier. |
| `prompt_cache` | `off`, `5m`, `1h` | See below. Leave unset to keep the default. |
| `locked` | `true` / `false` | When on, preset values win over values sent in the request. |

### Prompt caching

For models where Routeway places cache breakpoints for you (Claude models), Routeway caches with a 1-hour lifetime by default. `prompt_cache` changes that:

* **`off`** — no cache breakpoints are sent, including any your app adds itself. You pay no cache-write cost, but you also get no cheap cache reads. Choose this when consecutive requests rarely share the same opening, for example when you often edit earlier messages, regenerate, or reply with long pauses.
* **`5m`** — 5-minute cache. Cache writes cost less than with 1h. Good when you send the next request within a few minutes.
* **`1h`** — 1-hour cache, the default.

Models that cache automatically on the provider's side, such as DeepSeek, aren't affected by this setting. See [Prompt Caching](https://docs.routeway.ai/features/prompt-caching.md) for pricing details.

***

## Streaming with Presets

Presets work with all standard Chat Completions parameters, including `stream`:

```python theme={null}
stream = client.chat.completions.create(
    model="presets/0ede00c3-b202-4102-bda7-ec9a4b398767",
    messages=[
        {"role": "user", "content": "Tell me a short story."}
    ],
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
```

***

## Public vs Private Presets

| | Private | Public |
| - | - | - |
| Who can use it | Only your API key | Anyone with the preset ID |
| Visible in dashboard | Yes | Yes |
| System prompt exposed | No | Yes |
| Use case | Internal apps, personal tooling | Shared assistants, published integrations |

> [!WARNING]
>
> Public presets expose the system prompt to anyone who has the preset ID. Don't include secrets, internal instructions, or sensitive information in the system prompt of a public preset.

***

## When to Use Presets

> [card] Ship locked personas
>
> Define a customer support agent, coding assistant, or brand voice once and reference it by ID across all your apps.

> [card] Version your prompts
>
> Create a new preset when you iterate on a system prompt instead of updating in-place, so you can roll back.

> [card] Share with teammates
>
> Public presets let anyone on your team (or your users) call a consistent configuration without needing to manage the prompt themselves.

> [card] Keep clients simple
>
> Offload model selection and prompt engineering to the dashboard. Client code only needs the preset ID.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.