Developers
API reference
Integrate published Losono agents via REST chat, WebSocket voice, or the embed widget.
Authentication
Create an API key from your agent's deploy page, then send it as a Bearer token.
Authorization: Bearer losono_sk_...
Chat (streaming)
POST https://losono.xorora.com/api/agents/{agentId}/chat
Content-Type: application/json
Authorization: Bearer losono_sk_...
{
"mode": "chat",
"visitorId": "optional-visitor-id",
"conversationId": "optional-existing-conversation",
"messages": [
{ "role": "user", "parts": [{ "type": "text", "text": "Hello" }] }
]
}Response is an AI SDK UI message stream. The conversation id is returned in the X-Conversation-Id header.
Voice (WebSocket)
GET https://losono.xorora.com/api/agents/{agentId}/voice?mode=deploy&apiKey=losono_sk_...
WebSocket upgrade with PCM audio frames (see playground client).Voice requires a Pro subscription with voice enabled on the agent.
Embed widget
<script src="https://losono.xorora.com/embed.js" data-agent="your-agent-slug"></script>
The loader opens an iframe to https://losono.xorora.com/embed/your-agent-slug. Configure greeting, colors, and allowed origins from the deploy page.