> ## 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.

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.

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:

<Steps>
  <Step title="Name your preset">
    Give it a short, descriptive name. This is for your reference only.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Set parameters (optional)">
    Configure defaults like `temperature`, `max_tokens`, `top_p`, and other generation parameters. These apply automatically to every request unless overridden.
  </Step>

  <Step title="Set visibility">
    Choose **Private** (default) or **Public**. Public presets can be used by anyone with the preset ID.
  </Step>
</Steps>

***

## 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.

<Tabs>
  <Tab title="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>

  <Tab title="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>

  <Tab title="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"}
        ]
      }'
    ```
  </Tab>
</Tabs>

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.

***

## 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.
</Warning>

***

## When to Use Presets

<CardGroup cols={2}>
  <Card title="Ship locked personas" icon="user-check">
    Define a customer support agent, coding assistant, or brand voice once and reference it by ID across all your apps.
  </Card>

  <Card title="Version your prompts" icon="git-branch">
    Create a new preset when you iterate on a system prompt instead of updating in-place, so you can roll back.
  </Card>

  <Card title="Share with teammates" icon="users">
    Public presets let anyone on your team (or your users) call a consistent configuration without needing to manage the prompt themselves.
  </Card>

  <Card title="Keep clients simple" icon="code">
    Offload model selection and prompt engineering to the dashboard. Client code only needs the preset ID.
  </Card>
</CardGroup>
