Agent
The agent endpoints let you send messages to the AI agent and receive responses. You can use the synchronous chat endpoint or the streaming endpoint for real-time events.
POST
/agent/chatAuthenticatedSend a message and receive a complete response.
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The message to send to the agent |
session_id | string | No | Resume an existing session |
model | string | No | Override the LLM model |
system | string | No | Override the system prompt |
max_tokens | number | No | Token generation limit |
tools | string[] | No | Tool IDs to enable for this request |
curl -X POST http://127.0.0.1:7741/agent/chat \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Summarize my open GitHub issues"}'200Response
{
"ok": true,
"data": {
"response": "You have 3 open issues...",
"tokensIn": 256,
"tokensOut": 128,
"sessionId": "a1b2c3d4"
}
}POST
/agent/streamAuthenticatedSend a message and stream agent events via Server-Sent Events.
| Parameter | Type | Required | Description |
|---|---|---|---|
message | string | Yes | The message to send to the agent |
session_id | string | No | Resume an existing session |
model | string | No | Override the LLM model |
system | string | No | Override the system prompt |
max_tokens | number | No | Token generation limit |
tools | string[] | No | Tool IDs to enable for this request |
The response is a text/event-stream. Each event has a type field:
| Event Type | Data Fields | Description |
|---|---|---|
text_delta | content | Streaming text chunk |
tool_call | id, name, arguments | Agent invoking a tool |
tool_result | toolCallId, result, isError | Tool execution result |
thinking | content | Extended thinking output |
compaction | beforeTokens, afterTokens | Context window was compacted |
turn_complete | tokensIn, tokensOut | Agent finished its turn |
done | sessionId | Stream complete |
error | message | Error occurred |
curl -N -X POST http://127.0.0.1:7741/agent/stream \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Hello"}'GET
/agent/listAuthenticatedList all active agent sessions.
200Response
{
"ok": true,
"data": [
{
"id": "a1b2c3d4",
"model": "claude-sonnet-4-20250514",
"status": "active",
"created_at": "2026-03-03T10:00:00Z",
"message_count": 12
}
]
}POST
/agent/spawnAuthenticatedSpawn a new agent session with an initial prompt.
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Initial prompt for the new session |
model | string | No | LLM model override |
tools | string[] | No | Tool IDs to enable |
200Response
{
"ok": true,
"data": {
"session_id": "e5f6g7h8"
}
}