API Reference
Call a configured agent over plain HTTP from any language. Create or resume a session with your Lobu API token, then send messages and stream events with the returned session token. The reference below documents every endpoint; TypeScript apps can use @lobu/client, which handles this token exchange and SSE parsing for you.
# 1. Create or resume a session.
curl -X POST $LOBU_GATEWAY/lobu/api/v1/agents \
-H "Authorization: Bearer $LOBU_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"agentId":"my-agent","userId":"user-123","thread":"support"}'
# The 201 response includes agentId, token, expiresAt, messagesUrl, and sseUrl.
# 2. Subscribe to the SSE stream before sending so you get the full reply.
curl -N "$SSE_URL" -H "Authorization: Bearer $SESSION_TOKEN"
# 3. In another process, send the message with the session token.
curl -X POST "$MESSAGES_URL" \
-H "Authorization: Bearer $SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content":"What changed this week?","messageId":"weekly-001"}'