Create a preset from a responses request body
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.
Authorizations
API key as bearer token in Authorization header
Path Parameters
URL-safe slug identifying the preset. Created if it does not exist.
1"my-preset"
Body
Request schema for Responses endpoint
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.
{ "type": "ephemeral" }Debug options for inspecting request transformations (streaming only)
{ "echo_upstream_body": true }Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.
{ "aspect_ratio": "16:9", "quality": "high" }file_search_call.results, message.input_image.image_url, computer_call_output.output.image_url, reasoning.encrypted_content, code_interpreter_call.outputs Input for a response request - can be a string or array of items
[
{
"content": "What is the weather today?",
"role": "user"
}
]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.
{
"session_id": "abc-def-ghi",
"user_id": "123"
}Output modalities for the response. Supported values are "text" and "image".
text, image ["text", "image"]Plugins you want to enable for this request, including their settings.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
{
"allowed_models": ["anthropic/*", "openai/gpt-4o"],
"cost_quality_tradeoff": 7,
"enabled": true,
"id": "auto-router"
}{
"id": "prompt-abc123",
"variables": { "name": "John" }
}When multiple model providers are available, optionally indicate your routing preference.
{ "allow_fallbacks": true }Configuration for reasoning mode in the response
{
"effort": "medium",
"summary": "auto",
"enabled": true
}DEPRECATED Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
fallback, sort, null "fallback"
auto, default, flex, priority, scale, null 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.
256Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides max_tool_calls.
1A single condition that, when met, halts the server-tool agent loop.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
{ "step_count": 5, "type": "step_count_is" }[
{ "step_count": 5, "type": "step_count_is" },
{
"max_cost_in_dollars": 0.5,
"type": "max_cost"
}
]Text output configuration including format and verbosity
{
"format": { "type": "text" },
"verbosity": "medium"
}auto "auto"
Function tool definition
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
- Option 24
- Option 25
- Option 26
{
"description": "Get the current weather in a location",
"name": "get_weather",
"parameters": {
"properties": {
"location": {
"description": "The city and state",
"type": "string"
},
"unit": {
"enum": ["celsius", "fahrenheit"],
"type": "string"
}
},
"required": ["location"],
"type": "object"
},
"type": "function"
}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.
{
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
}auto, disabled, null "auto"
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.
256Response
Preset created or updated successfully.
Response containing the created preset with its designated version.
A preset with its currently designated version.
{
"created_at": "2026-04-20T10:00:00Z",
"creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000",
"description": null,
"designated_version_id": "550e8400-e29b-41d4-a716-446655440000",
"id": "650e8400-e29b-41d4-a716-446655440001",
"name": "my-preset",
"slug": "my-preset",
"status": "active",
"status_updated_at": null,
"updated_at": "2026-04-20T10:00:00Z",
"workspace_id": "750e8400-e29b-41d4-a716-446655440002",
"designated_version": {
"config": {
"model": "openai/gpt-4o",
"temperature": 0.7
},
"created_at": "2026-04-20T10:00:00Z",
"creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
"id": "550e8400-e29b-41d4-a716-446655440000",
"preset_id": "650e8400-e29b-41d4-a716-446655440001",
"system_prompt": "You are a helpful assistant.",
"updated_at": "2026-04-20T10:00:00Z",
"version": 1
}
}