Agents API¶
Chat with an agent¶
Request¶
| Field | Type | Required | Description |
|---|---|---|---|
agent_id |
string | ✅ | Agent to invoke |
text |
string | ✅ | User message text |
user_id |
string | — | Stable user/session key. Defaults to api-user. |
username |
string | — | Display name. Defaults to user_id. |
overrides |
object | — | One-run playground/test overrides. Does not mutate SOUL.yaml. |
One-run overrides¶
{
"agent_id": "assistant",
"user_id": "lab",
"text": "Answer deterministically.",
"overrides": {
"provider": "ollama",
"model": "qwen2.5:72b",
"temperature": 0,
"max_tokens": 800,
"max_turns": 4,
"tool_choice": "none"
}
}
Response¶
Streaming¶
Use /api/v1/chat/stream to receive Server-Sent Events.
curl -N -X POST http://localhost:18789/api/v1/chat/stream \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{"agent_id":"assistant","user_id":"u1","text":"Tell me a joke"}'
Events:
List agents¶
Response¶
{
"agents": [
{
"id": "assistant",
"description": "A helpful general-purpose assistant",
"llm": {
"provider": "openai",
"model": "gpt-4o-mini"
},
"channels": ["http", "telegram"],
"builtins": ["web_search"]
},
{
"id": "researcher",
"description": "Deep research agent",
"llm": {
"provider": "openai",
"model": "gpt-4o"
},
"channels": ["http"],
"builtins": ["web_search"]
}
]
}