Presets

Named configurations for model, parameters, system prompts, and plugins that can be referenced by name in any request.

Overview

Presets are saved configurations that bundle a model, sampling parameters, system prompt, and plugins into a reusable named object. Instead of repeating the same parameters across every API call, reference a preset by name and AllRoutes applies the full configuration automatically.

Using a Preset

Reference a preset by name or ID in any chat completion request:

{
  "preset": "customer-support-v2",
  "messages": [{"role": "user", "content": "How do I reset my password?"}]
}

The preset's model, temperature, max_tokens, system prompt, and plugins are applied to the request. Any fields you explicitly include in the request override the preset's values.

Create a Preset

POST https://api.allroutes.ai/v1/presets

Request Body

FieldTypeRequiredDescription
namestringYesUnique preset name
modelstringYesModel identifier
temperaturefloatNoSampling temperature
max_tokensintegerNoMaximum tokens to generate
top_pfloatNoNucleus sampling parameter
frequency_penaltyfloatNoFrequency penalty
presence_penaltyfloatNoPresence penalty
system_promptstringNoSystem prompt to prepend to messages
pluginsarrayNoPlugins to enable
stoparrayNoStop sequences
response_formatobjectNoStructured output format
sharedbooleanNoShare with all organization members (default: false)

Example

curl -X POST https://api.allroutes.ai/v1/presets \
  -H "Authorization: Bearer allroutes_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "customer-support-v2",
    "model": "gpt-4o",
    "temperature": 0.3,
    "max_tokens": 1000,
    "system_prompt": "You are a helpful customer support agent for Acme Corp. Be concise and friendly.",
    "plugins": [{"id": "pii-redactor"}, {"id": "response-healing"}],
    "shared": true
  }'

Response

{
  "id": "preset_abc123",
  "name": "customer-support-v2",
  "model": "gpt-4o",
  "temperature": 0.3,
  "max_tokens": 1000,
  "system_prompt": "You are a helpful customer support agent for Acme Corp. Be concise and friendly.",
  "plugins": [{"id": "pii-redactor"}, {"id": "response-healing"}],
  "shared": true,
  "version": 1,
  "created_at": "2026-04-05T10:00:00Z",
  "updated_at": "2026-04-05T10:00:00Z"
}

List Presets

GET https://api.allroutes.ai/v1/presets

Returns all presets visible to the authenticated user (personal and org-shared).

curl https://api.allroutes.ai/v1/presets \
  -H "Authorization: Bearer allroutes_sk_..."

Response

{
  "data": [
    {
      "id": "preset_abc123",
      "name": "customer-support-v2",
      "model": "gpt-4o",
      "temperature": 0.3,
      "max_tokens": 1000,
      "shared": true,
      "version": 2,
      "created_at": "2026-04-05T10:00:00Z",
      "updated_at": "2026-04-05T12:00:00Z"
    }
  ],
  "total": 1
}

Update a Preset

PUT https://api.allroutes.ai/v1/presets/:id

Updates a preset. A new version is created automatically -- previous versions are retained in the version history.

curl -X PUT https://api.allroutes.ai/v1/presets/preset_abc123 \
  -H "Authorization: Bearer allroutes_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "temperature": 0.5,
    "system_prompt": "You are a helpful customer support agent. Be concise, friendly, and accurate."
  }'

Delete a Preset

DELETE https://api.allroutes.ai/v1/presets/:id
curl -X DELETE https://api.allroutes.ai/v1/presets/preset_abc123 \
  -H "Authorization: Bearer allroutes_sk_..."

Version History

Every update to a preset creates a new version. You can reference a specific version:

{
  "preset": "customer-support-v2@1",
  "messages": [{"role": "user", "content": "Hello"}]
}

The @1 suffix pins the request to version 1. Without a version suffix, the latest version is used.

Org-Shared Presets

When shared: true, the preset is visible to all members of your organization. This is useful for standardizing configurations across teams:

  • Consistent system prompts for all customer-facing agents
  • Enforced guardrail plugins across the organization
  • Shared model + parameter combinations for quality control

SDK Examples

Python

# List presets
presets = client.list_presets()
for preset in presets:
    print(f"{preset['name']} -> {preset['model']}")

# Use a preset
response = client.chat.completions.create(
    preset="customer-support-v2",
    messages=[{"role": "user", "content": "How do I reset my password?"}],
)

Node.js

// List presets
const presets = await client.listPresets();
for (const preset of presets) {
  console.log(`${preset.name} -> ${preset.model} (temp: ${preset.temperature})`);
}

Go

presets, _ := client.ListPresets(ctx)
for _, p := range presets {
    fmt.Printf("%s -> %s\n", p.Name, p.Model)
}

See Also

  • Chat Completions -- the preset request parameter
  • Model Groups -- alias multiple models under one ID (compare to presets)
  • Plugins -- bundle plugins into a preset for one-line application defaults
  • Guardrails -- pin a compliance profile inside a preset