API key
Your API key authenticates every direct HTTP request to the API. Pass it in thexi-api-key header:
XUNA_AI_API_KEY automatically:
Signed URLs (WebSocket)
A signed URL is a pre-authenticatedwss:// address your server generates on demand. Pass it to a browser or mobile client so it can open a WebSocket connection without needing your API key.
Get a signed URL
GET /v1/convai/conversation/get-signed-url?agent_id={agent_id}
The ID of the agent you want to start a conversation with.
A pre-authenticated WebSocket URL (
wss://). Valid for a short window — generate one per session.Conversation tokens (WebRTC)
A conversation token serves the same purpose as a signed URL but for WebRTC-based connections. Your server exchanges your API key for a short-lived token and hands it to the client.Get a conversation token
GET /v1/convai/conversation/token?agent_id={agent_id}
The ID of the agent to start a conversation with.
A short-lived token your client passes when initiating a WebRTC connection.
Choosing an auth method
| Use case | Method |
|---|---|
| Server-to-server API calls | API key in xi-api-key header |
| Browser WebSocket connection | Signed URL |
| Browser / mobile WebRTC connection | Conversation token |

