Send message
The user message to send.
Target session. Uses current session if omitted.
Auto-approve all tool calls.
curl -X POST http://localhost:8000/chat \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "What meetings do I have today?"}' \
--no-buffer
Returns an SSE stream. See Streaming for event types.
Approve or reject a pending tool call.
curl -X POST http://localhost:8000/tool-result \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"run_id": "run_abc",
"tool_id": "tc_abc123",
"result": "Approved",
"approved": true
}'
Cancel
Cancel a running agent loop.
curl -X POST http://localhost:8000/cancel \
-H "Authorization: Bearer $API_KEY"
Context usage
Get current token usage for the session.
curl http://localhost:8000/context \
-H "Authorization: Bearer $API_KEY"
{
"total_tokens": 12500,
"model_limit": 200000,
"message_count": 15,
"tool_count": 8
}
Compact context
Compress conversation history to free token space.
curl -X POST http://localhost:8000/compact \
-H "Authorization: Bearer $API_KEY"