For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
ModelsChatRankingsDocs
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
DocsAPI ReferenceClient SDKsAgent SDKCookbookChangelog
  • API Guides
    • Overview
    • Streaming
    • Embeddings
    • Limits
    • Authentication
    • Parameters
    • Errors and Debugging
  • API Reference
      • POSTCreate a preset from a chat-completions request body
      • POSTCreate a preset from a messages request body
      • POSTCreate a preset from a responses request body
LogoLogo
ModelsChatRankingsDocs
API ReferencePresets

Create a preset from a responses request body

POST
https://openrouter.ai/api/v1/presets/:slug/responses
POST
/api/v1/presets/:slug/responses
$curl -X POST https://openrouter.ai/api/v1/presets/my-preset/responses \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "input": "Hello!",
> "instructions": "You are a helpful assistant.",
> "model": "openai/gpt-5.4"
>}'
1{
2 "data": {
3 "created_at": "2026-04-20T10:00:00Z",
4 "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000",
5 "description": null,
6 "designated_version": {
7 "config": {
8 "model": "openai/gpt-5.4"
9 },
10 "created_at": "2026-04-20T10:00:00Z",
11 "creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
12 "id": "550e8400-e29b-41d4-a716-446655440000",
13 "preset_id": "650e8400-e29b-41d4-a716-446655440001",
14 "system_prompt": "You are a helpful assistant.",
15 "updated_at": "2026-04-20T10:00:00Z",
16 "version": 1
17 },
18 "designated_version_id": "550e8400-e29b-41d4-a716-446655440000",
19 "id": "650e8400-e29b-41d4-a716-446655440001",
20 "name": "my-preset",
21 "slug": "my-preset",
22 "status": "active",
23 "status_updated_at": null,
24 "updated_at": "2026-04-20T10:00:00Z",
25 "workspace_id": "750e8400-e29b-41d4-a716-446655440002"
26 }
27}

Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. messages, stream, prompt) are silently ignored.

Was this page helpful?
Previous

List all providers

Next
Built with

Authentication

AuthorizationBearer
API key as bearer token in Authorization header

Path parameters

slugstringRequired>=1 character

URL-safe slug identifying the preset. Created if it does not exist.

Request

This endpoint expects an object.
backgroundboolean or nullOptional
cache_controlobjectOptional
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
frequency_penaltydouble or nullOptional
image_configstring or double or list of anyOptional
includelist of enums or nullOptional
Allowed values:
inputstring or list of objectsOptional

Input for a response request - can be a string or array of items

instructionsstring or nullOptional
max_output_tokensinteger or nullOptional
max_tool_callsinteger or nullOptional
metadatamap from strings to stringsOptional

Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed.

modalitieslist of enumsOptional
Output modalities for the response. Supported values are "text" and "image".
Allowed values:
modelstringOptional
modelslist of stringsOptional
parallel_tool_callsboolean or nullOptional
pluginslist of objectsOptional
Plugins you want to enable for this request, including their settings.
presence_penaltydouble or nullOptional
previous_response_idstring or nullOptional
promptobjectOptional
prompt_cache_keystring or nullOptional
providerobjectOptional
When multiple model providers are available, optionally indicate your routing preference.
reasoningobjectOptional
Configuration for reasoning mode in the response
routeanyOptional
safety_identifierstring or nullOptional
service_tierenum or nullOptionalDefaults to auto
Allowed values:
session_idstringOptional<=256 characters

A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.

stop_server_tools_whenlist of objectsOptional

Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides max_tool_calls.

storefalseOptional
streambooleanOptionalDefaults to false
temperaturedouble or nullOptional
textobjectOptional
Text output configuration including format and verbosity
tool_choiceenum or objectOptional
toolslist of objectsOptional
top_kintegerOptional
top_logprobsinteger or nullOptional
top_pdouble or nullOptional
traceobjectOptional

Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.

truncationenumOptional
Allowed values:
userstringOptional<=256 characters

A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters.

Response

Preset created or updated successfully.
dataobject
A preset with its currently designated version.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error