Skip to main content

Configuration

What shapes a generation: the model and sampling parameters, the agent profile in effect, conversation-level settings, and how history is kept within the context window.

Generation Config

Control how the AI generates responses by updating the default generation config.

curl -X POST https://api.travila.ai/api/v1/llm/gateway/update-default-generation-config \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001",
"default_generation_config": {
"model": "anthropic/claude-sonnet-5",
"temperature": 0.7,
"max_output_tokens": 2048,
"top_p": 0.9
}
}'

The four fields above are the ones most conversations need:

FieldDescriptionDefault
modelModel to generate with — see Available ModelsPlatform default
temperatureRandomness (0.0 = deterministic, 2.0 = creative)1.0
max_output_tokensMaximum tokens in the responseModel default
top_pNucleus sampling threshold1.0
That's a small slice of the config

GenerationConfig carries far more than these four — model fallback lists and routing filters, provider preferences and price ceilings, reasoning options, tool definitions and execution policy, response format, plugins, timeouts, and more.

Browse the complete schema, field by field, on Update Default Generation Config in the API reference — expand generation_config to see every field with its type and constraints.

Available Models

Set model — or the models fallback list — to a model from the platform allowlist. The canonical list, with the exact rejection error and the rule for OpenRouter variant suffixes, lives in Model Routing → Allowed models.

The platform accepts a curated set, not the full OpenRouter catalog: requesting anything outside it fails immediately with MODEL_INVALID. See Model Routing & Pre-Filter for capability-based filtering within that set.

Reasoning

Models that support chain-of-thought reasoning (e.g., google/gemini-3.1-pro-preview, anthropic/claude-sonnet-5) can expose their internal thinking process. Configure reasoning via the reasoning_options field on the generation config:

curl -X POST https://api.travila.ai/api/v1/llm/gateway/update-default-generation-config \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001",
"default_generation_config": {
"model": "google/gemini-3.1-pro-preview",
"reasoning_options": {
"effort": "EFFORT_MEDIUM",
"include_reasoning_history": true
}
}
}'
FieldDescriptionDefault
effortHow much reasoning the model should perform. Values: EFFORT_NONE, EFFORT_MINIMAL, EFFORT_LOW, EFFORT_MEDIUM, EFFORT_HIGH, EFFORT_XHIGHEFFORT_UNSPECIFIED (provider default)
max_tokensMaximum tokens the model may use for reasoningModel default
excludeIf true, reasoning content is not included in the responsefalse
include_reasoning_historyInclude reasoning from previous turns in multi-turn requests for provider continuitytrue

When reasoning is enabled, assistant messages may contain content parts with type: CONTENT_PART_TYPE_REASONING alongside the normal CONTENT_PART_TYPE_TEXT parts. The reasoning parts contain the model's internal thinking process.

Agent Profiles

An agent profile is a saved, versioned bundle of agent configuration — system prompt, model, tools — that you point a conversation at instead of assembling the same generation config on every call.

Profiles are created in the console, not through the API

As of now, agent profiles can only be created, edited, versioned, and deleted from the admin console. None of that is exposed on the public gateways — there is no create-agent-profile endpoint you can call.

What the public API gives you is selection: point a conversation at a profile that already exists, by id. Have your profiles set up in the console first, then reference them from the calls below.

Set the profile when the thread is created:

{
"title": "Nutrition check-in",
"active_profile_id": "profile_abc"
}

Or switch profiles mid-conversation. set_active_profile_id on send-message or send-message-sync applies to that turn and every turn after it, until you set a different one:

{
"conversation_key": "thread_abc",
"user_message": { "role": "ROLE_USER", "content": [{"type": "CONTENT_PART_TYPE_TEXT", "content": "..."}] },
"set_active_profile_id": "profile_escalation"
}
note

A profile's mcp_servers replaces the conversation's MCP server list rather than merging with it — including when the profile's list is empty. If a profile is active and defines no MCP servers, the conversation has none for that turn.

Conversation Settings

Update the conversation's system prompt, interrupt policy, and other settings.

curl -X POST https://api.travila.ai/api/v1/llm/gateway/update-settings \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001",
"settings": {
"system_prompt": "You are a helpful customer support agent for Acme Corp.",
"interrupt_policy": "QUEUE"
}
}'

System Prompt

The system_prompt is prepended to every LLM request for this conversation. Use it to set the AI's persona, rules, and context.

Interrupt Policy

Controls what happens when a user sends a new message while a generation run is already in progress:

PolicyBehavior
QUEUEQueue the new message and process it after the current run completes
INTERRUPTCancel the current run and start a new one with the latest message

Context Management

For long conversations, the message history can exceed the model's context window. Context management settings control how this is handled.

curl -X POST https://api.travila.ai/api/v1/llm/gateway/update-context-management-settings \
-H "X-API-Key: sk_your_key_here" \
-H "X-On-Behalf-Of: user_123" \
-H "Content-Type: application/json" \
-d '{
"conversation_key": "support-chat-001",
"context_management_settings": {
"strategy": "SLIDING_WINDOW",
"max_history_messages": 50
}
}'
StrategyDescription
SLIDING_WINDOWKeep the most recent N messages
SUMMARIZESummarize older messages to preserve context while reducing token count