Agents
Create agent
Creates a new agent with the specified configuration, including model selection, instructions, tools, and knowledge bases. Agents are intelligent assistants that can execute tasks, interact with tools, and maintain context through memory stores. The agent can be configured with a primary model and optional fallback models for automatic failover, custom instructions for behavior control, and various settings to control execution limits and tool usage.
post/v2/agents
Request body
Example request
{
"path": "Default",
"model": {
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}
},
"fallback_models": [
{
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}
}
],
"settings": {
"tools": [
{
"type": "mcp",
"id": "01KA84ND5J0SWQMA2Q8HY5WZZZ",
"tool_id": "01KXYZ123456789",
"requires_approval": false
}
]
},
"knowledge_bases": [
{
"knowledge_id": "customer-knowledge-base"
}
]
}Response
Agent successfully created and ready for use. Returns the complete agent manifest including the generated ID, configuration, and all settings.
Example response
{
"path": "Default",
"knowledge_bases": [
{
"knowledge_id": "customer-knowledge-base"
}
],
"model": {
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
},
"fallback_models": [
{
"parameters": {
"fallbacks": [
{
"model": "openai/gpt-4o-mini"
}
],
"cache": {
"ttl": 3600
},
"load_balancer": {
"type": "weight_based",
"models": [
{
"model": "openai/gpt-4o",
"weight": 0.7
},
{
"model": "anthropic/claude-3-5-sonnet",
"weight": 0.3
}
]
},
"timeout": {
"call_timeout": 30000
}
},
"retry": {
"count": 3,
"on_codes": [
429,
500,
502,
503,
504
]
}
}
]
}
}