Widget Gateway
The widget gateway is used by the embedded web widget and can also be called directly for custom chat interfaces.
POST /api/v1/widget/run
POST https://api.auteryn.ai/api/v1/widget/runAuthorization: Bearer afk_widget_your_keyContent-Type: application/jsonOrigin: https://yoursite.com{ "query": "How do I reset my password?", "session_id": "optional-stable-session-id", "user": { "id": "optional-user-id", "name": "Alice", "metadata": {} }}Widget API keys
Widget keys (afk_widget_...) are separate from org API keys:
- Scoped to a single agent
- Restricted to requests from your allowed domains
- Safe to expose in client-side JavaScript — domain restriction prevents misuse
Create them in Console → Agent → Deploy → Web Widget → API Keys.
Session continuity
Pass a stable session_id (e.g., from localStorage) to maintain conversation context across page loads:
{ "query": "What about the Pro plan?", "session_id": "sess_abc123"}Domain restriction
Requests are only accepted from domains whitelisted in your widget’s Allowed Domains setting. Requests from other origins return 403 Forbidden.