Unified chat endpoint for the Handa Uncle assistant.
Authentication modes (select one in the playground)
Option 1: Registered users (bearerAuth)
Obtain an Auth0 access token (e.g. via /api/v1/auth/signup or /api/v1/auth/signin).
Include Authorization: Bearer <token> on every chat request.
Option 2: Guest/device users (deviceAuth)
Call GET /app/launch with x-device-id and x-platform to receive a synthetic userId.
Send x-device-id, x-platform, and optionally x-user-id (from launch) on /api/v1/ai/chat until FREE_MESSAGE_THRESHOLD is hit.
The (threshold + 1) request returns 429 FREE_LIMIT_EXCEEDED with error.details.is_guest = true and requires_signup = true; show the signup prompt.
After signup, switch to the Authorization header—conversations continue under the same userId. Optional x-user-email / x-user-phone hints help link devices to existing accounts.
Streaming vs buffered
Set X-Stream-Response: true (alias Stream: true) to receive text/event-stream chunks (token, tool_call, tool_result, done).
Omit the header or set it to false for the default buffered JSON response.
Unified endpoint for sending a user message to the Handa Uncle assistant. Supports
both JSON responses and server-sent events (SSE) streaming with the same payload.
Authentication & headers
Select your authentication method in the playground above using the security dropdown.
X-Stream-Response: false or Stream: false to disable streaming (streaming is ON by default)
The two authentication methods (bearerAuth and deviceAuth) are mutually exclusive—choose one based on whether the user is registered or a guest. The playground will show the appropriate fields based on your selection.
Streaming is enabled by default. If you want a buffered JSON response instead of SSE,
explicitly set X-Stream-Response: false or Stream: false in your request headers.
Every request is also subject to the chat rate limit (20 req/min) and the free-tier
message counter enforced by usageLimitMiddleware.
Guest/device auth flow (deviceAuth option)
When using deviceAuth in the playground, provide these headers:
x-device-id (required): Unique device identifier
x-platform (required): One of android, ios, or web
x-user-id (optional): User ID returned from GET /app/launch
x-user-email (optional): Email hint for linking
x-user-phone (optional): Phone hint in E.164 format
The complete guest experience flow:
Launch – call GET /app/launch with x-device-id and x-platform. The
response returns a synthetic userId (e.g. U-813e62a0-...) even when no
Auth0 account exists.
Chat as guest – send POST /api/v1/ai/chat with the device headers plus
x-user-id returned from the launch step. Requests work immediately until
the free counter reaches the configured FREE_MESSAGE_THRESHOLD (default 100).
Hit the limit – on the (threshold + 1) request the API responds with
429 FREE_LIMIT_EXCEEDED and the payload includes
error.details.isGuest = true and error.details.requiresSignup = true.
Frontends should show the signup modal at this point.
Continue after signup – once the user signs up and receives an Auth0
access token, switch to the bearer header. The userId and conversation
history stay intact because the backend links the identity via the stored
device metadata.
Device headers are treated with the same chat-rate limiting and audit trails as
JWTs. Spoofed or missing headers are rejected with 401 UNAUTHORIZED.
Request body
Field
Type
Required
Notes
message
string
✅
1–2000 characters of user input.
conversationId
string
⛔
MongoDB ObjectId; omit to create a new conversation.
model
string
⛔
Overrides the configured default (subject to allowlists).
attachments[].fileId
string
⛔
Reference to a file uploaded via the File Upload service.
attachments[].data
string
⛔
Base64 payload for inline uploads (max 20MB after decoding).
attachments[].mimeType
string
⛔
Required when data is provided.
attachments[].filename
string
⛔
Required when data is provided.
prepromptKey
string
⛔
Optional identifier for a backend-managed pre-prompt. When present, the chat pipeline injects the masked instructions tied to this key right after the system prompt.
Attachments must contain either fileId or (data + mimeType + filename). The
backend validates file size, ownership, and converts supported media into the AI SDK
multimodal format before invoking the LLM.
Masked pre-prompts
Administrators can define reusable “masked” instructions (e.g., persona tweaks or
guardrails) via the Management API (POST /api/v1/preprompts, protected by the backend
secret). Client applications should fetch the user-facing catalog from
GET /api/v1/public/preprompts and send the selected prepromptKey alongside the chat
payload. Users only see the friendly label, while the backend silently injects the
corresponding hidden prompt into the LLM context.
Guest vs registered usage messaging
usageLimitMiddleware inspects c.get('isGuest') and returns tailored limit
errors:
{ "success": false, "error": { "message": "Please sign up to continue chatting and unlock more features!", "code": "FREE_LIMIT_EXCEEDED", "details": { "currentCount": 100, "threshold": 100, "remaining": 0, "isGuest": true, "requiresSignup": true } }, "meta": { "...": "..." }}
Registered users see "Please upgrade your account..." plus
"isGuest": false, "requiresSignup": false. Use the flags to decide whether
to show a signup modal or upsell screen.
Note: No X-Stream-Response header needed—streaming is the default behavior.
Guest/device auth with streaming (default)
curl -N -X POST https://api.handauncle.com/api/v1/ai/chat \ -H 'x-device-id: ios-device-3f92' \ -H 'x-user-id: U-813e62a0-a3fc-4c7e-bf4e-3f915d9e9f10' \ -H 'x-platform: ios' \ -H 'Content-Type: application/json' \ -d '{ "message": "Hello from a guest!" }'
Non-streaming (buffered JSON response)
To get a complete JSON response instead of SSE streaming, explicitly disable streaming:
curl -X POST https://api.handauncle.com/api/v1/ai/chat \ -H 'Authorization: Bearer <ACCESS_TOKEN>' \ -H 'X-Stream-Response: false' \ -H 'Content-Type: application/json' \ -d '{ "message": "What is a mutual fund?" }'
Both calls share the same response envelope; the only difference is how the caller
authenticates and whether streaming is explicitly disabled.
Authorizations
bearerAuthdeviceAuth
Authorization
string
header
required
Auth0 access token for registered users.
Headers
x-device-id
string
Required when Authorization header is omitted. Stable identifier for the calling device.
Minimum string length: 1
x-platform
enum<string>
Client platform. Required with device auth.
Available options:
android,
ios,
web
x-user-id
string
Optional hint for mapping the device to an existing user (returned by GET /app/launch). Strongly recommended so conversations persist once the guest signs up.
x-user-email
string<email>
Optional email hint for device-auth flows.
x-user-phone
string
Optional phone hint in E.164 format for device-auth flows.
Pattern: ^\+?[1-9]\d{7,14}$
X-Stream-Response
enum<string>
default:true
Streaming is ON by default. Set to false to receive buffered JSON instead of SSE streaming.
Available options:
true,
false
Stream
enum<string>
default:true
Alias for X-Stream-Response. Streaming is ON by default. Set to false to disable.
Available options:
true,
false
Body
application/json
message
string
required
Required string length: 1 - 2000
conversationId
string
Existing conversation ID. Omit to start a new thread.
Pattern: ^[0-9a-fA-F]{24}$
model
string
Optional override for the default model.
prepromptKey
string
Optional identifier for a backend-managed pre-prompt. When supplied, the associated masked instructions are injected right after the system prompt.
Required string length: 2 - 64
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{1,63}$
inputType
enum<string>
Optional hint for how the conversation was initiated. Use 'voice' for voice input, 'file' for file uploads (auto-detected if attachments present), or 'text' for plain messages (default).
Available options:
text,
file,
voice
attachments
object[]
Option 1
Option 2
Show child attributes
Response
Chat response streamed or buffered.
success
enum<boolean>
required
Available options:
true
data
object
required
Show child attributes
meta
object
required
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Handa Uncle Platform","colors":{"primary":"#c2410c","light":"#fdba74","dark":"#ea580c"},"logo":{"light":"https://mintcdn.com/hijlilabs/DcNbifTSn9EZkUYR/logo/light.svg?fit=max\u0026auto=format\u0026n=DcNbifTSn9EZkUYR\u0026q=85\u0026s=bd18939393af20a436b0e2cd41546ccc","dark":"https://mintcdn.com/hijlilabs/DcNbifTSn9EZkUYR/logo/dark.svg?fit=max\u0026auto=format\u0026n=DcNbifTSn9EZkUYR\u0026q=85\u0026s=53e39929bbda00ebcfb98c1cc7df9c2f"},"favicon":"/favicon.svg","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"}},"navbar":{"links":[{"label":"Support","href":"mailto:hello@handauncle.com"}],"primary":{"type":"button","label":"Open App","href":"https://chat.handauncle.com"}},"footer":{"socials":{"x":"https://twitter.com/handauncle","github":"https://github.com/handauncle","linkedin":"https://www.linkedin.com/company/handauncle"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"]},"navigation":{"global":{"anchors":[{"anchor":"Handa Uncle","icon":"globe","href":"https://www.handauncle.com"},{"anchor":"Status","icon":"chart-mixed","href":"https://status.handauncle.com"},{"anchor":"Prod API Base URL","icon":"globe","href":"https://handauncle-backend-prod-205012263523.asia-south1.run.app"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hijlilabs","hasAudioNarration":false,"actualSubdomain":"hijlilabs","customDomains":["docs.handauncle.com"],"gitSource":{"type":"github","owner":"handauncle","repo":"-deprecated-handauncle-backend-new","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10c7559ffae5051c4077bb"},"entitlements":{},"buildId":"6ae942d24b6956dad9eee2fb:success","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"API reference","count":72},{"language":"default","tag":"Guides","count":21},{"language":"default","tag":"Auth service","count":12},{"language":"default","tag":"Conversations","count":9},{"language":"default","tag":"Chat Share","count":8},{"language":"default","tag":"Visual Embeds","count":8},{"language":"default","tag":"Mobile app","count":7},{"language":"default","tag":"Second Opinion","count":7},{"language":"default","tag":"Codebase","count":7},{"language":"default","tag":"Prompt management","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/ai/chat","slug":"/api-reference/ai/chat","pageMetadata":{"title":"Send Chat Message","openapi":"POST /api/v1/ai/chat","description":"Unified chat endpoint for the Handa Uncle assistant.\n\n### Authentication modes (select one in the playground)\n\n**Option 1: Registered users (bearerAuth)**\n1. Obtain an Auth0 access token (e.g. via `/api/v1/auth/signup` or `/api/v1/auth/signin`).\n2. Include `Authorization: Bearer \u003ctoken>` on every chat request.\n\n**Option 2: Guest/device users (deviceAuth)**\n1. Call `GET /app/launch` with `x-device-id` and `x-platform` to receive a synthetic `userId`.\n2. Send `x-device-id`, `x-platform`, and optionally `x-user-id` (from launch) on `/api/v1/ai/chat` until `FREE_MESSAGE_THRESHOLD` is hit.\n3. The `(threshold + 1)` request returns `429 FREE_LIMIT_EXCEEDED` with `error.details.is_guest = true` and `requires_signup = true`; show the signup prompt.\n4. After signup, switch to the Authorization header—conversations continue under the same `userId`. Optional `x-user-email` / `x-user-phone` hints help link devices to existing accounts.\n\n### Streaming vs buffered\n- Set `X-Stream-Response: true` (alias `Stream: true`) to receive text/event-stream chunks (`token`, `tool_call`, `tool_result`, `done`).\n- Omit the header or set it to `false` for the default buffered JSON response.","href":"/api-reference/ai/chat"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n h3: \"h3\",\n li: \"li\",\n ol: \"ol\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Unified chat endpoint for the Handa Uncle assistant.\"\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Authentication modes (select one in the playground)\"\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Option 1: Registered users (bearerAuth)\"\n })\n }), \"\\n\", _jsxs(_components.ol, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Obtain an Auth0 access token (e.g. via \", _jsx(_components.code, {\n children: \"/api/v1/auth/signup\"\n }), \" or \", _jsx(_components.code, {\n children: \"/api/v1/auth/signin\"\n }), \").\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Include \", _jsx(_components.code, {\n children: \"Authorization: Bearer \u003ctoken>\"\n }), \" on every chat request.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Option 2: Guest/device users (deviceAuth)\"\n })\n }), \"\\n\", _jsxs(_components.ol, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Call \", _jsx(_components.code, {\n children: \"GET /app/launch\"\n }), \" with \", _jsx(_components.code, {\n children: \"x-device-id\"\n }), \" and \", _jsx(_components.code, {\n children: \"x-platform\"\n }), \" to receive a synthetic \", _jsx(_components.code, {\n children: \"userId\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Send \", _jsx(_components.code, {\n children: \"x-device-id\"\n }), \", \", _jsx(_components.code, {\n children: \"x-platform\"\n }), \", and optionally \", _jsx(_components.code, {\n children: \"x-user-id\"\n }), \" (from launch) on \", _jsx(_components.code, {\n children: \"/api/v1/ai/chat\"\n }), \" until \", _jsx(_components.code, {\n children: \"FREE_MESSAGE_THRESHOLD\"\n }), \" is hit.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"The \", _jsx(_components.code, {\n children: \"(threshold + 1)\"\n }), \" request returns \", _jsx(_components.code, {\n children: \"429 FREE_LIMIT_EXCEEDED\"\n }), \" with \", _jsx(_components.code, {\n children: \"error.details.is_guest = true\"\n }), \" and \", _jsx(_components.code, {\n children: \"requires_signup = true\"\n }), \"; show the signup prompt.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"After signup, switch to the Authorization header—conversations continue under the same \", _jsx(_components.code, {\n children: \"userId\"\n }), \". Optional \", _jsx(_components.code, {\n children: \"x-user-email\"\n }), \" / \", _jsx(_components.code, {\n children: \"x-user-phone\"\n }), \" hints help link devices to existing accounts.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Streaming vs buffered\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Set \", _jsx(_components.code, {\n children: \"X-Stream-Response: true\"\n }), \" (alias \", _jsx(_components.code, {\n children: \"Stream: true\"\n }), \") to receive text/event-stream chunks (\", _jsx(_components.code, {\n children: \"token\"\n }), \", \", _jsx(_components.code, {\n children: \"tool_call\"\n }), \", \", _jsx(_components.code, {\n children: \"tool_result\"\n }), \", \", _jsx(_components.code, {\n children: \"done\"\n }), \").\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Omit the header or set it to \", _jsx(_components.code, {\n children: \"false\"\n }), \" for the default buffered JSON response.\"]\n }), \"\\n\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={blockquote:`blockquote`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Unified endpoint for sending a user message to the Handa Uncle assistant. Supports\nboth JSON responses and server-sent events (SSE) streaming with the same payload.`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication-\u0026-headers`,children:`Authentication \u0026 headers`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Select your authentication method in the playground above`}),` using the security dropdown.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Scenario`}),_jsx(_components.th,{children:`Required headers`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Option 1: Registered user (bearerAuth)`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization: Bearer \u003cAuth0 access token>`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Option 2: Guest / device flow (deviceAuth)`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`x-device-id`}),` (required), `,_jsx(_components.code,{children:`x-platform`}),` (required: android/ios/web), `,_jsx(_components.code,{children:`x-user-id`}),` (optional), `,_jsx(_components.code,{children:`x-user-email`}),` (optional), `,_jsx(_components.code,{children:`x-user-phone`}),` (optional)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Streaming toggle`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`X-Stream-Response: false`}),` or `,_jsx(_components.code,{children:`Stream: false`}),` to disable streaming (`,_jsx(_components.strong,{children:`streaming is ON by default`}),`)`]})]})]})]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsx(_components.p,{children:`The two authentication methods (bearerAuth and deviceAuth) are mutually exclusive—choose one based on whether the user is registered or a guest. The playground will show the appropriate fields based on your selection.`}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Streaming is enabled by default.`}),` If you want a buffered JSON response instead of SSE,\nexplicitly set `,_jsx(_components.code,{children:`X-Stream-Response: false`}),` or `,_jsx(_components.code,{children:`Stream: false`}),` in your request headers.`]})}),`\n`,_jsxs(_components.p,{children:[`Every request is also subject to the chat rate limit (20 req/min) and the free-tier\nmessage counter enforced by `,_jsx(_components.code,{children:`usageLimitMiddleware`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`guest/device-auth-flow-deviceauth-option`,children:`Guest/device auth flow (deviceAuth option)`}),`\n`,_jsxs(_components.p,{children:[`When using `,_jsx(_components.strong,{children:`deviceAuth`}),` in the playground, provide these headers:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`x-device-id`}),` (required): Unique device identifier`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`x-platform`}),` (required): One of `,_jsx(_components.code,{children:`android`}),`, `,_jsx(_components.code,{children:`ios`}),`, or `,_jsx(_components.code,{children:`web`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`x-user-id`}),` (optional): User ID returned from `,_jsx(_components.code,{children:`GET /app/launch`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`x-user-email`}),` (optional): Email hint for linking`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`x-user-phone`}),` (optional): Phone hint in E.164 format`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`The complete guest experience flow:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Launch`}),` – call `,_jsx(_components.code,{children:`GET /app/launch`}),` with `,_jsx(_components.code,{children:`x-device-id`}),` and `,_jsx(_components.code,{children:`x-platform`}),`. The\nresponse returns a synthetic `,_jsx(_components.code,{children:`userId`}),` (e.g. `,_jsx(_components.code,{children:`U-813e62a0-...`}),`) even when no\nAuth0 account exists.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chat as guest`}),` – send `,_jsx(_components.code,{children:`POST /api/v1/ai/chat`}),` with the device headers plus\n`,_jsx(_components.code,{children:`x-user-id`}),` returned from the launch step. Requests work immediately until\nthe free counter reaches the configured `,_jsx(_components.code,{children:`FREE_MESSAGE_THRESHOLD`}),` (default 100).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Hit the limit`}),` – on the `,_jsx(_components.code,{children:`(threshold + 1)`}),` request the API responds with\n`,_jsx(_components.code,{children:`429 FREE_LIMIT_EXCEEDED`}),` and the payload includes\n`,_jsx(_components.code,{children:`error.details.isGuest = true`}),` and `,_jsx(_components.code,{children:`error.details.requiresSignup = true`}),`.\nFrontends should show the signup modal at this point.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Continue after signup`}),` – once the user signs up and receives an Auth0\naccess token, switch to the bearer header. The `,_jsx(_components.code,{children:`userId`}),` and conversation\nhistory stay intact because the backend links the identity via the stored\ndevice metadata.`]}),`\n`]}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[`Device headers are treated with the same chat-rate limiting and audit trails as\nJWTs. Spoofed or missing headers are rejected with `,_jsx(_components.code,{children:`401 UNAUTHORIZED`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`message`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`✅`}),_jsx(_components.td,{children:`1–2000 characters of user input.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`conversationId`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsx(_components.td,{children:`MongoDB ObjectId; omit to create a new conversation.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsx(_components.td,{children:`Overrides the configured default (subject to allowlists).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attachments[].fileId`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsx(_components.td,{children:`Reference to a file uploaded via the File Upload service.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attachments[].data`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsx(_components.td,{children:`Base64 payload for inline uploads (max 20MB after decoding).`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attachments[].mimeType`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsxs(_components.td,{children:[`Required when `,_jsx(_components.code,{children:`data`}),` is provided.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`attachments[].filename`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsxs(_components.td,{children:[`Required when `,_jsx(_components.code,{children:`data`}),` is provided.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prepromptKey`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`⛔`}),_jsx(_components.td,{children:`Optional identifier for a backend-managed pre-prompt. When present, the chat pipeline injects the masked instructions tied to this key right after the system prompt.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Attachments must contain either `,_jsx(_components.code,{children:`fileId`}),` or (`,_jsx(_components.code,{children:`data`}),` + `,_jsx(_components.code,{children:`mimeType`}),` + `,_jsx(_components.code,{children:`filename`}),`). The\nbackend validates file size, ownership, and converts supported media into the AI SDK\nmultimodal format before invoking the LLM.`]}),`\n`,_jsx(Heading,{level:`3`,id:`masked-pre-prompts`,children:`Masked pre-prompts`}),`\n`,_jsxs(_components.p,{children:[`Administrators can define reusable “masked” instructions (e.g., persona tweaks or\nguardrails) via the Management API (`,_jsx(_components.code,{children:`POST /api/v1/preprompts`}),`, protected by the backend\nsecret). Client applications should fetch the user-facing catalog from\n`,_jsx(_components.code,{children:`GET /api/v1/public/preprompts`}),` and send the selected `,_jsx(_components.code,{children:`prepromptKey`}),` alongside the chat\npayload. Users only see the friendly label, while the backend silently injects the\ncorresponding hidden prompt into the LLM context.`]}),`\n`,_jsx(Heading,{level:`3`,id:`guest-vs-registered-usage-messaging`,children:`Guest vs registered usage messaging`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`usageLimitMiddleware`}),` inspects `,_jsx(_components.code,{children:`c.get('isGuest')`}),` and returns tailored limit\nerrors:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Please sign up to continue chatting and unlock more features!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"FREE_LIMIT_EXCEEDED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"details\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"currentCount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"threshold\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"remaining\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"isGuest\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"requiresSignup\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"meta\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Registered users see `,_jsx(_components.code,{children:`\"Please upgrade your account...\"`}),` plus\n`,_jsx(_components.code,{children:`\"isGuest\": false`}),`, `,_jsx(_components.code,{children:`\"requiresSignup\": false`}),`. Use the flags to decide whether\nto show a signup modal or upsell screen.`]}),`\n`,_jsx(Heading,{level:`2`,id:`responses`,children:`Responses`}),`\n`,_jsx(Heading,{level:`3`,id:`buffered-json`,children:`Buffered JSON`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`22`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"conversationId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"665f5e6fcb6e4c73dc6dca01\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"messageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"665f5e91cb6e4c73dc6dca05\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Equity funds carry higher volatility...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o-mini\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tokenCount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`812`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"toolCalls\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"toolName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"portfolio_lookup\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"args\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"accountId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"holdings\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"meta\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2025-12-01T12:00:00.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"requestId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"req_abc\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`streaming-sse`,children:`Streaming (SSE)`}),`\n`,_jsxs(_components.p,{children:[`Each chunk is sent as `,_jsx(_components.code,{children:`data: \u003cjson>\\\\n\\\\n`}),`. Expect the following shapes:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{\"type\":\"token\",\"content\":\"...\"}`}),` – incremental tokens.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{\"type\":\"toolCall\",\"toolName\":\"...\",\"args\":{...}}`}),` – tool invocation start.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{\"type\":\"toolResult\",\"toolName\":\"...\",\"result\":{...}}`}),` – tool output.`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`{\"type\":\"done\",\"conversationId\":\"...\",\"messageId\":\"...\",\"tokenCount\":123,\"meta\":{\"timestamp\":\"...\",\"streaming\":true,\"durationMs\":1400}}`})}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`{\"type\":\"error\",\"message\":\"Streaming failed\",\"error\":\"...\"}`}),` – terminal failures.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Clients should treat the stream as finished when a `,_jsx(_components.code,{children:`done`}),` or `,_jsx(_components.code,{children:`error`}),` event arrives.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-codes`,children:`Error codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`When it fires`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`UNAUTHORIZED`})}),_jsx(_components.td,{children:`Missing bearer token and device headers.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`429`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`RATE_LIMIT_EXCEEDED`})}),_jsx(_components.td,{children:`More than 20 requests/min per user/device.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`429`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`FREE_LIMIT_EXCEEDED`})}),_jsxs(_components.td,{children:[`Guest or free-tier user exhausted the free quota (`,_jsx(_components.code,{children:`details.requiresSignup`}),` will be `,_jsx(_components.code,{children:`true`}),` for guests).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`INTERNAL_ERROR`})}),_jsx(_components.td,{children:`Upstream failure (LLM, storage, RAG, etc.).`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Retries should respect backoff when rate limited. When `,_jsx(_components.code,{children:`FREE_LIMIT_EXCEEDED`}),`, surface a\nsignup or upgrade prompt before re-sending traffic.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example-calls`,children:`Example calls`}),`\n`,_jsx(Heading,{level:`3`,id:`authenticated-user-with-streaming-default`,children:`Authenticated user with streaming (default)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -N`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.handauncle.com/api/v1/ai/chat`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cACCESS_TOKEN>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"message\": \"Please summarise my portfolio\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversationId\": \"665f5e6fcb6e4c73dc6dca01\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Note:`}),` No `,_jsx(_components.code,{children:`X-Stream-Response`}),` header needed—streaming is the default behavior.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`guest/device-auth-with-streaming-default`,children:`Guest/device auth with streaming (default)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -N`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.handauncle.com/api/v1/ai/chat`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-device-id: ios-device-3f92'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-user-id: U-813e62a0-a3fc-4c7e-bf4e-3f915d9e9f10'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-platform: ios'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{ \"message\": \"Hello from a guest!\" }'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`non-streaming-buffered-json-response`,children:`Non-streaming (buffered JSON response)`}),`\n`,_jsx(_components.p,{children:`To get a complete JSON response instead of SSE streaming, explicitly disable streaming:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.handauncle.com/api/v1/ai/chat`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003cACCESS_TOKEN>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-Stream-Response: false'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{ \"message\": \"What is a mutual fund?\" }'`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Both calls share the same response envelope; the only difference is how the caller\nauthenticates and whether streaming is explicitly disabled.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Send Chat Message","openapi":"POST /api/v1/ai/chat","description":"Unified chat endpoint for the Handa Uncle assistant.\n\n### Authentication modes (select one in the playground)\n\n**Option 1: Registered users (bearerAuth)**\n1. Obtain an Auth0 access token (e.g. via `/api/v1/auth/signup` or `/api/v1/auth/signin`).\n2. Include `Authorization: Bearer \u003ctoken>` on every chat request.\n\n**Option 2: Guest/device users (deviceAuth)**\n1. Call `GET /app/launch` with `x-device-id` and `x-platform` to receive a synthetic `userId`.\n2. Send `x-device-id`, `x-platform`, and optionally `x-user-id` (from launch) on `/api/v1/ai/chat` until `FREE_MESSAGE_THRESHOLD` is hit.\n3. The `(threshold + 1)` request returns `429 FREE_LIMIT_EXCEEDED` with `error.details.is_guest = true` and `requires_signup = true`; show the signup prompt.\n4. After signup, switch to the Authorization header—conversations continue under the same `userId`. Optional `x-user-email` / `x-user-phone` hints help link devices to existing accounts.\n\n### Streaming vs buffered\n- Set `X-Stream-Response: true` (alias `Stream: true`) to receive text/event-stream chunks (`token`, `tool_call`, `tool_result`, `done`).\n- Omit the header or set it to `false` for the default buffered JSON response.","href":"/api-reference/ai/chat"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authentication \u0026 headers","slug":"authentication-\u0026-headers","depth":2,"children":[{"title":"Guest/device auth flow (deviceAuth option)","slug":"guest/device-auth-flow-deviceauth-option","depth":3,"children":[]}]},{"title":"Request body","slug":"request-body","depth":2,"children":[{"title":"Masked pre-prompts","slug":"masked-pre-prompts","depth":3,"children":[]},{"title":"Guest vs registered usage messaging","slug":"guest-vs-registered-usage-messaging","depth":3,"children":[]}]},{"title":"Responses","slug":"responses","depth":2,"children":[{"title":"Buffered JSON","slug":"buffered-json","depth":3,"children":[]},{"title":"Streaming (SSE)","slug":"streaming-sse","depth":3,"children":[]}]},{"title":"Error codes","slug":"error-codes","depth":2,"children":[]},{"title":"Example calls","slug":"example-calls","depth":2,"children":[{"title":"Authenticated user with streaming (default)","slug":"authenticated-user-with-streaming-default","depth":3,"children":[]},{"title":"Guest/device auth with streaming (default)","slug":"guest/device-auth-with-streaming-default","depth":3,"children":[]},{"title":"Non-streaming (buffered JSON response)","slug":"non-streaming-buffered-json-response","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["AI"],"operationId":"aiChat","summary":"Send chat message (streaming or buffered)","description":"Unified chat endpoint for the Handa Uncle assistant.\n\n### Authentication modes (select one in the playground)\n\n**Option 1: Registered users (bearerAuth)**\n1. Obtain an Auth0 access token (e.g. via `/api/v1/auth/signup` or `/api/v1/auth/signin`).\n2. Include `Authorization: Bearer \u003ctoken>` on every chat request.\n\n**Option 2: Guest/device users (deviceAuth)**\n1. Call `GET /app/launch` with `x-device-id` and `x-platform` to receive a synthetic `userId`.\n2. Send `x-device-id`, `x-platform`, and optionally `x-user-id` (from launch) on `/api/v1/ai/chat` until `FREE_MESSAGE_THRESHOLD` is hit.\n3. The `(threshold + 1)` request returns `429 FREE_LIMIT_EXCEEDED` with `error.details.is_guest = true` and `requires_signup = true`; show the signup prompt.\n4. After signup, switch to the Authorization header—conversations continue under the same `userId`. Optional `x-user-email` / `x-user-phone` hints help link devices to existing accounts.\n\n### Streaming vs buffered\n- Set `X-Stream-Response: true` (alias `Stream: true`) to receive text/event-stream chunks (`token`, `tool_call`, `tool_result`, `done`).\n- Omit the header or set it to `false` for the default buffered JSON response.","security":["2dbca87e-003a-4935-8281-33f53d7d53b8","ea368168-77e5-4465-837b-47353c101796"],"parameters":["c3777cf0-beb6-411d-9758-95f9d27e459c","581ee887-287f-402a-82d6-eea4b89768d2","2c513deb-febe-44c1-bcee-95a01edcc581","1aa86ed2-34dd-45fb-bc9a-a40f1308c5c5","8ae1fed2-f6b9-4013-804d-471e0e75393d","512234f7-c1c6-4ebe-bee4-35ea3ea7edee","6b612aa6-76e4-4192-88f5-7ec2ef91518d"],"requestBody":"2455da1a-43ab-461a-9faf-7476ed26f679","responses":{"200":"4236e73a-451e-4f30-abe3-ce22eb570bdf","400":"e8dc1c2a-3647-43e6-a9a6-42ec496b6556","401":"de7eb75f-f6a3-43cc-8693-eb8ebb726dca","429":"07ca011c-b693-44a7-a259-795ae6399546","500":"da77769e-b035-4e10-b38a-a26f9514ab79"},"method":"post","type":"path","servers":["5622216f-c30d-4dba-85a5-57b014314175","bff5e472-5d0b-4a4a-9ca0-1e863b6dc700","e5417b44-7454-48b6-9fba-1d25f15ebca3","2235fc76-7020-4dfe-b799-4c0c823d049b"],"path":"/api/v1/ai/chat","baseUrlOptions":["https://handauncle-backend-prod-205012263523.asia-south1.run.app","https://api.handauncle.com","https://staging-api.handauncle.com","http://localhost:8080"],"title":"Send chat message (streaming or buffered)","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"c3777cf0-beb6-411d-9758-95f9d27e459c":{"name":"x-device-id","in":"header","required":false,"description":"Required when Authorization header is omitted. Stable identifier for the calling device.","schema":{"type":"string","minLength":1,"isRequired":false,"description":"Required when Authorization header is omitted. Stable identifier for the calling device.","uniqueKey":"","typeLabel":"string"}},"581ee887-287f-402a-82d6-eea4b89768d2":{"name":"x-platform","in":"header","required":false,"description":"Client platform. Required with device auth.","schema":{"type":"string","enum":["android","ios","web"],"isRequired":false,"description":"Client platform. Required with device auth.","uniqueKey":"","typeLabel":"enum\u003cstring>"}},"2c513deb-febe-44c1-bcee-95a01edcc581":{"name":"x-user-id","in":"header","required":false,"description":"Optional hint for mapping the device to an existing user (returned by `GET /app/launch`). Strongly recommended so conversations persist once the guest signs up.","schema":{"type":"string","isRequired":false,"description":"Optional hint for mapping the device to an existing user (returned by `GET /app/launch`). Strongly recommended so conversations persist once the guest signs up.","uniqueKey":"","typeLabel":"string"}},"1aa86ed2-34dd-45fb-bc9a-a40f1308c5c5":{"name":"x-user-email","in":"header","required":false,"description":"Optional email hint for device-auth flows.","schema":{"type":"string","format":"email","isRequired":false,"description":"Optional email hint for device-auth flows.","uniqueKey":"","typeLabel":"string\u003cemail>"}},"8ae1fed2-f6b9-4013-804d-471e0e75393d":{"name":"x-user-phone","in":"header","required":false,"description":"Optional phone hint in E.164 format for device-auth flows.","schema":{"type":"string","pattern":"^\\+?[1-9]\\d{7,14}$","isRequired":false,"description":"Optional phone hint in E.164 format for device-auth flows.","uniqueKey":"","typeLabel":"string"}},"512234f7-c1c6-4ebe-bee4-35ea3ea7edee":{"name":"X-Stream-Response","in":"header","required":false,"description":"**Streaming is ON by default.** Set to `false` to receive buffered JSON instead of SSE streaming.","schema":{"type":"string","enum":["true","false"],"default":"true","isRequired":false,"description":"**Streaming is ON by default.** Set to `false` to receive buffered JSON instead of SSE streaming.","uniqueKey":"","typeLabel":"enum\u003cstring>"}},"6b612aa6-76e4-4192-88f5-7ec2ef91518d":{"name":"Stream","in":"header","required":false,"description":"Alias for `X-Stream-Response`. **Streaming is ON by default.** Set to `false` to disable.","schema":{"type":"string","enum":["true","false"],"default":"true","isRequired":false,"description":"Alias for `X-Stream-Response`. **Streaming is ON by default.** Set to `false` to disable.","uniqueKey":"","typeLabel":"enum\u003cstring>"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","minLength":1,"maxLength":2000,"isRequired":true,"uniqueKey":"message","typeLabel":"string"},"conversationId":{"type":"string","pattern":"^[0-9a-fA-F]{24}$","description":"Existing conversation ID. Omit to start a new thread.","uniqueKey":"conversationId","typeLabel":"string"},"model":{"type":"string","description":"Optional override for the default model.","uniqueKey":"model","typeLabel":"string"},"prepromptKey":{"type":"string","description":"Optional identifier for a backend-managed pre-prompt. When supplied, the associated masked instructions are injected right after the system prompt.","minLength":2,"maxLength":64,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]{1,63}$","uniqueKey":"prepromptKey","typeLabel":"string"},"inputType":{"type":"string","enum":["text","file","voice"],"description":"Optional hint for how the conversation was initiated. Use 'voice' for voice input, 'file' for file uploads (auto-detected if attachments present), or 'text' for plain messages (default).","uniqueKey":"inputType","typeLabel":"enum\u003cstring>"},"attachments":{"type":"array","items":{"oneOf":[{"type":"object","required":["fileId"],"properties":{"fileId":{"type":"string","description":"Reference to an uploaded file (MongoDB ObjectId).","pattern":"^[0-9a-fA-F]{24}$","isRequired":true,"uniqueKey":"attachments.items.[INDEX].oneOf.0.fileId","typeLabel":"string"},"data":{"type":"string","description":"Base64 encoded file contents.","uniqueKey":"attachments.items.[INDEX].oneOf.0.data","typeLabel":"string"},"mimeType":{"type":"string","description":"Required when inline data is provided.","uniqueKey":"attachments.items.[INDEX].oneOf.0.mimeType","typeLabel":"string"},"filename":{"type":"string","description":"Required when inline data is provided.","uniqueKey":"attachments.items.[INDEX].oneOf.0.filename","typeLabel":"string"}},"uniqueKey":"attachments.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["data","mimeType","filename"],"properties":{"data":{"type":"string","description":"Base64 encoded file contents.","isRequired":true,"uniqueKey":"attachments.items.[INDEX].oneOf.1.data","typeLabel":"string"},"mimeType":{"type":"string","description":"Required when inline data is provided.","isRequired":true,"uniqueKey":"attachments.items.[INDEX].oneOf.1.mimeType","typeLabel":"string"},"filename":{"type":"string","description":"Required when inline data is provided.","isRequired":true,"uniqueKey":"attachments.items.[INDEX].oneOf.1.filename","typeLabel":"string"},"fileId":{"type":"string","description":"Reference to an uploaded file (MongoDB ObjectId).","pattern":"^[0-9a-fA-F]{24}$","uniqueKey":"attachments.items.[INDEX].oneOf.1.fileId","typeLabel":"string"}},"uniqueKey":"attachments.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"attachments.items.[INDEX]","typeLabel":"object"},"uniqueKey":"attachments","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>","conversationId":"\u003cstring>","model":"\u003cstring>","prepromptKey":"\u003cstring>","attachments":[{"fileId":"\u003cstring>","data":"\u003cstring>","mimeType":"\u003cstring>","filename":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"4236e73a-451e-4f30-abe3-ce22eb570bdf":{"description":"Chat response streamed or buffered.","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"data":{"type":"object","required":["conversationId","messageId","role","content","model","tokenCount"],"properties":{"conversationId":{"type":"string","isRequired":true,"uniqueKey":"data.conversationId","typeLabel":"string"},"messageId":{"type":"string","isRequired":true,"uniqueKey":"data.messageId","typeLabel":"string"},"role":{"type":"string","enum":["assistant"],"isRequired":true,"uniqueKey":"data.role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","isRequired":true,"uniqueKey":"data.content","typeLabel":"string"},"model":{"type":"string","isRequired":true,"uniqueKey":"data.model","typeLabel":"string"},"tokenCount":{"type":"integer","isRequired":true,"uniqueKey":"data.tokenCount","typeLabel":"integer"},"toolCalls":{"type":"array","items":{"type":"object","required":["toolName","args"],"properties":{"toolName":{"type":"string","isRequired":true,"uniqueKey":"data.toolCalls.items.[INDEX].toolName","typeLabel":"string"},"args":{"type":"object","additionalProperties":true,"isRequired":true,"uniqueKey":"data.toolCalls.items.[INDEX].args","typeLabel":"object"},"result":{"type":"object","additionalProperties":true,"uniqueKey":"data.toolCalls.items.[INDEX].result","typeLabel":"object"}},"uniqueKey":"data.toolCalls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data.toolCalls","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"data","typeLabel":"object"},"meta":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"meta.timestamp","typeLabel":"string\u003cdate-time>"},"requestId":{"type":"string","description":"Server generated correlation identifier.","isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"}},"required":["timestamp","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":true,"data":{"conversationId":"\u003cstring>","messageId":"\u003cstring>","role":"assistant","content":"\u003cstring>","model":"\u003cstring>","tokenCount":123,"toolCalls":[{"toolName":"\u003cstring>","args":{},"result":{}}]},"meta":{"timestamp":"2023-11-07T05:31:56Z","requestId":"\u003cstring>"}}}},"exampleType":"generated"},"text/event-stream":{"schema":{"oneOf":[{"type":"object","required":["type","content"],"properties":{"type":{"type":"string","enum":["token"],"isRequired":true,"uniqueKey":"oneOf.0.type","typeLabel":"enum\u003cstring>"},"content":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.content","typeLabel":"string"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["type","toolName","args"],"properties":{"type":{"type":"string","enum":["tool_call"],"isRequired":true,"uniqueKey":"oneOf.1.type","typeLabel":"enum\u003cstring>"},"toolName":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.toolName","typeLabel":"string"},"args":{"type":"object","additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.args","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"},{"type":"object","required":["type","toolName","result"],"properties":{"type":{"type":"string","enum":["tool_result"],"isRequired":true,"uniqueKey":"oneOf.2.type","typeLabel":"enum\u003cstring>"},"toolName":{"type":"string","isRequired":true,"uniqueKey":"oneOf.2.toolName","typeLabel":"string"},"result":{"type":"object","additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.2.result","typeLabel":"object"}},"uniqueKey":"oneOf.2","typeLabel":"object"},{"type":"object","required":["type","conversationId","messageId","role","model","tokenCount","meta"],"properties":{"type":{"type":"string","enum":["done"],"isRequired":true,"uniqueKey":"oneOf.3.type","typeLabel":"enum\u003cstring>"},"conversationId":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.conversationId","typeLabel":"string"},"messageId":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.messageId","typeLabel":"string"},"role":{"type":"string","enum":["assistant"],"isRequired":true,"uniqueKey":"oneOf.3.role","typeLabel":"enum\u003cstring>"},"model":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.model","typeLabel":"string"},"tokenCount":{"type":"integer","isRequired":true,"uniqueKey":"oneOf.3.tokenCount","typeLabel":"integer"},"meta":{"type":"object","required":["timestamp","streaming","durationMs"],"properties":{"timestamp":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"oneOf.3.meta.timestamp","typeLabel":"string\u003cdate-time>"},"streaming":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.3.meta.streaming","typeLabel":"boolean"},"durationMs":{"type":"integer","isRequired":true,"uniqueKey":"oneOf.3.meta.durationMs","typeLabel":"integer"}},"isRequired":true,"uniqueKey":"oneOf.3.meta","typeLabel":"object"},"toolCalls":{"type":"array","items":{"type":"object","required":["toolName","args"],"properties":{"toolName":{"type":"string","isRequired":true,"uniqueKey":"oneOf.3.toolCalls.items.[INDEX].toolName","typeLabel":"string"},"args":{"type":"object","additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.3.toolCalls.items.[INDEX].args","typeLabel":"object"},"result":{"type":"object","additionalProperties":true,"uniqueKey":"oneOf.3.toolCalls.items.[INDEX].result","typeLabel":"object"}},"uniqueKey":"oneOf.3.toolCalls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"oneOf.3.toolCalls","typeLabel":"object[]"}},"uniqueKey":"oneOf.3","typeLabel":"object"},{"type":"object","required":["type","message"],"properties":{"type":{"type":"string","enum":["error"],"isRequired":true,"uniqueKey":"oneOf.4.type","typeLabel":"enum\u003cstring>"},"message":{"type":"string","isRequired":true,"uniqueKey":"oneOf.4.message","typeLabel":"string"},"error":{"type":"string","uniqueKey":"oneOf.4.error","typeLabel":"string"}},"uniqueKey":"oneOf.4","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"token","content":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"e8dc1c2a-3647-43e6-a9a6-42ec496b6556":{"description":"The request payload or headers were invalid.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message describing the issue.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Error code for programmatic handling.","example":"VALIDATION_ERROR","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"array","description":"Array of field-specific validation errors (for VALIDATION_ERROR responses).","items":{"type":"object","properties":{"field":{"type":"string","description":"Field name that failed validation.","example":"phone","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"message":{"type":"string","description":"Specific validation error message for this field.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"required":["field","message"],"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"meta.timestamp","typeLabel":"string\u003cdate-time>"},"requestId":{"type":"string","description":"Server generated correlation identifier.","isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"}},"required":["timestamp","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"message":"Please enter a valid 10-digit phone number (e.g., 9876543210)","code":"VALIDATION_ERROR","details":[{"field":"phone","message":"Please enter a valid 10-digit phone number (e.g., 9876543210)"}]},"meta":{"timestamp":"2023-11-07T05:31:56Z","requestId":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"de7eb75f-f6a3-43cc-8693-eb8ebb726dca":{"description":"Authentication failed or is missing.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message describing the issue.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Error code for programmatic handling.","example":"VALIDATION_ERROR","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"array","description":"Array of field-specific validation errors (for VALIDATION_ERROR responses).","items":{"type":"object","properties":{"field":{"type":"string","description":"Field name that failed validation.","example":"phone","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"message":{"type":"string","description":"Specific validation error message for this field.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"required":["field","message"],"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"meta.timestamp","typeLabel":"string\u003cdate-time>"},"requestId":{"type":"string","description":"Server generated correlation identifier.","isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"}},"required":["timestamp","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"message":"Please enter a valid 10-digit phone number (e.g., 9876543210)","code":"VALIDATION_ERROR","details":[{"field":"phone","message":"Please enter a valid 10-digit phone number (e.g., 9876543210)"}]},"meta":{"timestamp":"2023-11-07T05:31:56Z","requestId":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"07ca011c-b693-44a7-a259-795ae6399546":{"description":"Rate limit or usage threshold exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message describing the issue.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Error code for programmatic handling.","example":"VALIDATION_ERROR","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"array","description":"Array of field-specific validation errors (for VALIDATION_ERROR responses).","items":{"type":"object","properties":{"field":{"type":"string","description":"Field name that failed validation.","example":"phone","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"message":{"type":"string","description":"Specific validation error message for this field.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"required":["field","message"],"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"meta.timestamp","typeLabel":"string\u003cdate-time>"},"requestId":{"type":"string","description":"Server generated correlation identifier.","isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"}},"required":["timestamp","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"rateLimit":{"title":"rateLimit","summary":"Per-minute chat rate limit hit","value":{"success":false,"error":{"message":"Rate limit exceeded. Please try again later.","code":"RATE_LIMIT_EXCEEDED","details":{"window":"60s","limit":20}},"meta":{"timestamp":"2025-12-01T12:00:00.000Z","requestId":"req_rate_limit"}}},"guestFreeLimit":{"title":"guestFreeLimit","summary":"Guest user exhausted the free threshold","value":{"success":false,"error":{"message":"Please sign up to continue chatting and unlock more features!","code":"FREE_LIMIT_EXCEEDED","details":{"currentCount":100,"threshold":100,"remaining":0,"isGuest":true,"requiresSignup":true}},"meta":{"timestamp":"2025-12-01T12:05:00.000Z","requestId":"req_guest_limit"}}}},"exampleType":"examples"}},"exampleType":"examples"},"da77769e-b035-4e10-b38a-a26f9514ab79":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message describing the issue.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"type":"string","description":"Error code for programmatic handling.","example":"VALIDATION_ERROR","uniqueKey":"error.code","typeLabel":"string"},"details":{"type":"array","description":"Array of field-specific validation errors (for VALIDATION_ERROR responses).","items":{"type":"object","properties":{"field":{"type":"string","description":"Field name that failed validation.","example":"phone","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"message":{"type":"string","description":"Specific validation error message for this field.","example":"Please enter a valid 10-digit phone number (e.g., 9876543210)","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"required":["field","message"],"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"required":["message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"meta.timestamp","typeLabel":"string\u003cdate-time>"},"requestId":{"type":"string","description":"Server generated correlation identifier.","isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"}},"required":["timestamp","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"success":false,"error":{"message":"Please enter a valid 10-digit phone number (e.g., 9876543210)","code":"VALIDATION_ERROR","details":[{"field":"phone","message":"Please enter a valid 10-digit phone number (e.g., 9876543210)"}]},"meta":{"timestamp":"2023-11-07T05:31:56Z","requestId":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"2dbca87e-003a-4935-8281-33f53d7d53b8":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Auth0 access token for registered users.","scopes":[]}},"ea368168-77e5-4465-837b-47353c101796":{"deviceAuth":{"type":"apiKey","in":"header","name":"x-device-id","description":"Device-based authentication for guest users. Requires x-device-id, x-user-id (optional), and x-platform headers.","scopes":[]}}},"servers":{"5622216f-c30d-4dba-85a5-57b014314175":{"url":"https://handauncle-backend-prod-205012263523.asia-south1.run.app","description":"Prod API base (Cloud Run)"},"bff5e472-5d0b-4a4a-9ca0-1e863b6dc700":{"url":"https://api.handauncle.com","description":"Production"},"e5417b44-7454-48b6-9fba-1d25f15ebca3":{"url":"https://staging-api.handauncle.com","description":"Staging"},"2235fc76-7020-4dfe-b799-4c0c823d049b":{"url":"http://localhost:8080","description":"Local development"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Auth0 access token for registered users.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Auth0 access token for registered users.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-device-id","description":"Device-based authentication for guest users. Requires x-device-id, x-user-id (optional), and x-platform headers.","scopes":[]},"schema":{"title":"x-device-id","type":"string","description":"Device-based authentication for guest users. Requires x-device-id, x-user-id (optional), and x-platform headers.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"deviceAuth","name":"x-device-id"}],"title":"deviceAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"hijlilabs","siteName":"Handa Uncle Platform","title":"Send Chat Message - Handa Uncle Platform","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-12-10T13:15:05.900Z","originalFileLocation":"api-reference/ai/chat.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Unified chat endpoint for the Handa Uncle assistant. ### Authentication modes (select one in the playground) Option 1: Registered users (bearerAuth) 1. Obtain an Auth0 access token (e.g. via /api/v1/auth/signup or /api/v1/auth/signin). 2. Include Authorization: Bearer on every chat request. Option 2: Guest/device users (deviceAuth) 1. Call GET /app/launch with x-device-id and x-platform to receive a synthetic userId. 2. Send x-device-id, x-platform, and optionally x-user-id (from launch) on /api/v1/ai/chat until FREE_MESSAGE_THRESHOLD is hit. 3. The (threshold + 1) request returns 429 FREE_LIMIT_EXCEEDED with error.details.is_guest = true and requires_signup = true; show the signup prompt. 4. After signup, switch to the Authorization header—conversations continue under the same userId. Optional x-user-email / x-user-phone hints help link devices to existing accounts. ### Streaming vs buffered - Set X-Stream-Response: true (alias Stream: true) to receive text/event-stream chunks (token, tool_call, tool_result, done). - Omit the header or set it to false for the default buffered JSON response.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Handa Uncle Platform\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Send Chat Message - Handa Uncle Platform\">\u003cmeta data-mint-head property=\"og:description\" content=\"Unified chat endpoint for the Handa Uncle assistant. ### Authentication modes (select one in the playground) Option 1: Registered users (bearerAuth) 1. Obtain an Auth0 access token (e.g. via /api/v1/auth/signup or /api/v1/auth/signin). 2. Include Authorization: Bearer on every chat request. Option 2: Guest/device users (deviceAuth) 1. Call GET /app/launch with x-device-id and x-platform to receive a synthetic userId. 2. Send x-device-id, x-platform, and optionally x-user-id (from launch) on /api/v1/ai/chat until FREE_MESSAGE_THRESHOLD is hit. 3. The (threshold + 1) request returns 429 FREE_LIMIT_EXCEEDED with error.details.is_guest = true and requires_signup = true; show the signup prompt. 4. After signup, switch to the Authorization header—conversations continue under the same userId. Optional x-user-email / x-user-phone hints help link devices to existing accounts. ### Streaming vs buffered - Set X-Stream-Response: true (alias Stream: true) to receive text/event-stream chunks (token, tool_call, tool_result, done). - Omit the header or set it to false for the default buffered JSON response.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Handa Uncle Platform\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.handauncle.com/api-reference/ai/chat\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hijlilabs.mintlify.site/_mintlify/api/og/v2?division=AI+service\u0026amp;title=Send+Chat+Message\u0026amp;description=Unified+chat+endpoint+for+the+Handa+Uncle+assistant.%0A%0A%23%23%23+Authentication+modes+%28select+one+in+the+playground%29%0A%0A**Option+1%3A+Registered+users+%28bearerAuth%29**%0A1.+Ob\u0026amp;theme=b3b8baabf3084bcb827feeee\u0026amp;signature=f597c96bd560eca80f4938f6e6141efc586872c309848cc4b737b25a43770d2b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Send Chat Message - Handa Uncle Platform\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Unified chat endpoint for the Handa Uncle assistant. ### Authentication modes (select one in the playground) Option 1: Registered users (bearerAuth) 1. Obtain an Auth0 access token (e.g. via /api/v1/auth/signup or /api/v1/auth/signin). 2. Include Authorization: Bearer on every chat request. Option 2: Guest/device users (deviceAuth) 1. Call GET /app/launch with x-device-id and x-platform to receive a synthetic userId. 2. Send x-device-id, x-platform, and optionally x-user-id (from launch) on /api/v1/ai/chat until FREE_MESSAGE_THRESHOLD is hit. 3. The (threshold + 1) request returns 429 FREE_LIMIT_EXCEEDED with error.details.is_guest = true and requires_signup = true; show the signup prompt. 4. After signup, switch to the Authorization header—conversations continue under the same userId. Optional x-user-email / x-user-phone hints help link devices to existing accounts. ### Streaming vs buffered - Set X-Stream-Response: true (alias Stream: true) to receive text/event-stream chunks (token, tool_call, tool_result, done). - Omit the header or set it to false for the default buffered JSON response.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hijlilabs.mintlify.site/_mintlify/api/og/v2?division=AI+service\u0026amp;title=Send+Chat+Message\u0026amp;description=Unified+chat+endpoint+for+the+Handa+Uncle+assistant.%0A%0A%23%23%23+Authentication+modes+%28select+one+in+the+playground%29%0A%0A**Option+1%3A+Registered+users+%28bearerAuth%29**%0A1.+Ob\u0026amp;theme=b3b8baabf3084bcb827feeee\u0026amp;signature=f597c96bd560eca80f4938f6e6141efc586872c309848cc4b737b25a43770d2b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/hijlilabs/xs1gQBPRHqKW2uUb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Handa Uncle Platform\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#c2410c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.handauncle.com/api-reference/ai/chat\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/ai/chat.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.handauncle.com/#organization\",\"name\":\"Handa Uncle Platform\",\"url\":\"https://docs.handauncle.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hijlilabs/DcNbifTSn9EZkUYR/logo/light.svg?fit=max\u0026auto=format\u0026n=DcNbifTSn9EZkUYR\u0026q=85\u0026s=bd18939393af20a436b0e2cd41546ccc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.handauncle.com#website\",\"name\":\"Handa Uncle Platform\",\"url\":\"https://docs.handauncle.com\",\"publisher\":{\"@id\":\"https://docs.handauncle.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.handauncle.com/api-reference/ai/chat#webpage\",\"url\":\"https://docs.handauncle.com/api-reference/ai/chat\",\"name\":\"Send Chat Message\",\"description\":\"Unified chat endpoint for the Handa Uncle assistant. ### Authentication modes (select one in the playground) Option 1: Registered users (bearerAuth) 1. Obtain an Auth0 access token (e.g. via /api/v1/auth/signup or /api/v1/auth/signin). 2. Include Authorization: Bearer on every chat request. Option 2: Guest/device users (deviceAuth) 1. Call GET /app/launch with x-device-id and x-platform to receive a synthetic userId. 2. Send x-device-id, x-platform, and optionally x-user-id (from launch) on /api/v1/ai/chat until FREE_MESSAGE_THRESHOLD is hit. 3. The (threshold + 1) request returns 429 FREE_LIMIT_EXCEEDED with error.details.is_guest = true and requires_signup = true; show the signup prompt. 4. After signup, switch to the Authorization header—conversations continue under the same userId. Optional x-user-email / x-user-phone hints help link devices to existing accounts. ### Streaming vs buffered - Set X-Stream-Response: true (alias Stream: true) to receive text/event-stream chunks (token, tool_call, tool_result, done). - Omit the header or set it to false for the default buffered JSON response.\",\"dateModified\":\"2025-12-10T13:15:05.900Z\",\"isPartOf\":{\"@id\":\"https://docs.handauncle.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.handauncle.com/api-reference/ai/chat#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.handauncle.com/api-reference/ai/chat#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"AI service\",\"item\":\"https://docs.handauncle.com/api-reference/ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send Chat Message\",\"item\":\"https://docs.handauncle.com/api-reference/ai/chat\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.handauncle.com/api-reference/ai/chat#apireference\",\"headline\":\"Send Chat Message\",\"name\":\"Send Chat Message\",\"description\":\"Unified chat endpoint for the Handa Uncle assistant. ### Authentication modes (select one in the playground) Option 1: Registered users (bearerAuth) 1. Obtain an Auth0 access token (e.g. via /api/v1/auth/signup or /api/v1/auth/signin). 2. Include Authorization: Bearer on every chat request. Option 2: Guest/device users (deviceAuth) 1. Call GET /app/launch with x-device-id and x-platform to receive a synthetic userId. 2. Send x-device-id, x-platform, and optionally x-user-id (from launch) on /api/v1/ai/chat until FREE_MESSAGE_THRESHOLD is hit. 3. The (threshold + 1) request returns 429 FREE_LIMIT_EXCEEDED with error.details.is_guest = true and requires_signup = true; show the signup prompt. 4. After signup, switch to the Authorization header—conversations continue under the same userId. Optional x-user-email / x-user-phone hints help link devices to existing accounts. ### Streaming vs buffered - Set X-Stream-Response: true (alias Stream: true) to receive text/event-stream chunks (token, tool_call, tool_result, done). - Omit the header or set it to false for the default buffered JSON response.\",\"url\":\"https://docs.handauncle.com/api-reference/ai/chat\",\"mainEntityOfPage\":{\"@id\":\"https://docs.handauncle.com/api-reference/ai/chat#webpage\"},\"dateModified\":\"2025-12-10T13:15:05.900Z\",\"publisher\":{\"@id\":\"https://docs.handauncle.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.handauncle.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Handa Uncle Platform\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Handa Uncle Platform\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/ai/chat.md","siteName":"Handa Uncle Platform","nav":{"global":{"anchors":[{"anchor":"Handa Uncle","icon":"globe","href":"https://www.handauncle.com"},{"anchor":"Status","icon":"chart-mixed","href":"https://status.handauncle.com"},{"anchor":"Prod API Base URL","icon":"globe","href":"https://handauncle-backend-prod-205012263523.asia-south1.run.app"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","groups":[{"group":"Overview","pages":[{"title":"Handa Uncle API","href":"/api-reference/introduction"}]},{"group":"Auth service","pages":[{"title":"Auth API","href":"/api-reference/auth"},{"title":"Google OAuth (Token Exchange)","openapi":"POST /api/v1/auth/google","href":"/api-reference/auth/google-token"},{"title":"Refresh Access Token","openapi":"POST /api/v1/auth/refresh","href":"/api-reference/auth/refresh"},{"title":"Sign Out","openapi":"POST /api/v1/auth/signout","href":"/api-reference/auth/signout"},{"title":"Current User Profile","openapi":"GET /api/v1/auth/me","href":"/api-reference/auth/me"},{"title":"Update Profile","openapi":"PATCH /api/v1/auth/me","href":"/api-reference/auth/update-me"},{"title":"Auth Service Health","openapi":"GET /api/v1/auth/health","href":"/api-reference/auth/health"},{"title":"Send OTP","openapi":"POST /api/v1/auth/send-otp","href":"/api-reference/auth/send-otp"},{"title":"Resend OTP","openapi":"POST /api/v1/auth/resend-otp","href":"/api-reference/auth/resend-otp"},{"title":"Verify OTP","openapi":"POST /api/v1/auth/verify-otp","href":"/api-reference/auth/verify-otp"},{"title":"Post-Registration Webhook","openapi":"POST /api/v1/auth/webhooks/post-registration","href":"/api-reference/auth/webhook-post-registration"},{"title":"Post-Login Webhook (Legacy)","openapi":"POST /api/v1/auth/post-login","href":"/api-reference/auth/webhook-post-login"}]},{"group":"AI service","pages":[{"title":"AI Chat API","description":"Unified LLM chat service with streaming, attachments, and device-auth guests.","href":"/api-reference/ai"},{"title":"Send Chat Message","openapi":"POST /api/v1/ai/chat","href":"/api-reference/ai/chat"},{"title":"AI Service Health","openapi":"GET /api/v1/ai/health","description":"Returns provider, model, and capability metadata for the AI router.","href":"/api-reference/ai/health"}]},{"group":"Prompt management","pages":[{"title":"PrePrompt Management","href":"/api-reference/preprompts"},{"title":"Create PrePrompt","openapi":"POST /api/v1/preprompts","href":"/api-reference/preprompts/create"},{"title":"List PrePrompts","openapi":"GET /api/v1/preprompts","href":"/api-reference/preprompts/list"},{"title":"Update PrePrompt","openapi":"PUT /api/v1/preprompts/{id}","href":"/api-reference/preprompts/update"},{"title":"Delete PrePrompt","openapi":"DELETE /api/v1/preprompts/{id}","href":"/api-reference/preprompts/delete"},{"title":"List Public PrePrompts","openapi":"GET /api/v1/public/preprompts","href":"/api-reference/preprompts/public"}]},{"group":"Mobile app","pages":[{"title":"App Launch","openapi":"GET /app/launch","href":"/api-reference/endpoint/app-launch"},{"title":"App Service Health","openapi":"GET /app/health","href":"/api-reference/endpoint/app-health"},{"title":"App Configuration","openapi":"GET /app/config","href":"/api-reference/endpoint/app-config"},{"title":"Get System URLs","openapi":"GET /app/config/system-urls","href":"/api-reference/endpoint/app-config-system-urls"},{"title":"Get Social Media URLs","openapi":"GET /app/config/social-media-urls","href":"/api-reference/endpoint/app-config-social-urls"},{"title":"Update System URLs","openapi":"PATCH /app/config/system-urls","href":"/api-reference/endpoint/app-config-update-system-urls"},{"title":"Update Social Media URLs","openapi":"PATCH /app/config/social-media-urls","href":"/api-reference/endpoint/app-config-update-social-urls"}]},{"group":"Platform","pages":[{"title":"Platform Health","openapi":"GET /api/v1/health","href":"/api-reference/endpoint/platform-health"}]},{"group":"Conversations","pages":[{"title":"Conversations API","href":"/api-reference/conversations"},{"title":"List Conversations","openapi":"GET /api/v1/user/conversations","href":"/api-reference/conversations/list"},{"title":"Get Conversation Details","openapi":"GET /api/v1/user/conversations/{conversationId}","href":"/api-reference/conversations/details"},{"title":"List Messages in Conversation","openapi":"GET /api/v1/user/conversations/{conversationId}/messages","href":"/api-reference/conversations/messages"},{"title":"Submit Message Feedback","openapi":"POST /api/v1/user/messages/{messageId}/feedback","href":"/api-reference/conversations/message-feedback"},{"title":"Update Conversation","openapi":"PATCH /api/v1/user/conversations/{conversationId}","href":"/api-reference/conversations/update"},{"title":"Archive Conversation","openapi":"POST /api/v1/user/conversations/{conversationId}/archive","href":"/api-reference/conversations/archive"},{"title":"Restore Conversation","openapi":"POST /api/v1/user/conversations/{conversationId}/restore","href":"/api-reference/conversations/restore"},{"title":"Delete Conversation","openapi":"DELETE /api/v1/user/conversations/{conversationId}","href":"/api-reference/conversations/delete"}]},{"group":"Chat Share","pages":[{"title":"Chat Share API","href":"/api-reference/chat-share"},{"title":"Create Share Link","openapi":"POST /api/v1/share","href":"/api-reference/chat-share/create"},{"title":"List Share Links","openapi":"GET /api/v1/share/list","href":"/api-reference/chat-share/list"},{"title":"Update Share","openapi":"PATCH /api/v1/share/{shareId}","href":"/api-reference/chat-share/update"},{"title":"Revoke Share","openapi":"DELETE /api/v1/share/{shareId}","href":"/api-reference/chat-share/revoke"},{"title":"Share Analytics","openapi":"GET /api/v1/share/{shareId}/analytics","href":"/api-reference/chat-share/analytics"},{"title":"View Shared Conversation","openapi":"GET /api/v1/public/share/{shareId}","href":"/api-reference/chat-share/view"},{"title":"Continue Shared Conversation","openapi":"POST /api/v1/public/share/{shareId}/continue","href":"/api-reference/chat-share/continue"}]},{"group":"Files","pages":[{"title":"File Upload API","href":"/api-reference/files"},{"title":"Upload File","openapi":"POST /api/v1/files/upload","href":"/api-reference/files/upload"},{"title":"List Files","openapi":"GET /api/v1/files","href":"/api-reference/files/list"},{"title":"Get File Metadata","openapi":"GET /api/v1/files/{fileId}","href":"/api-reference/files/get"},{"title":"Delete File","openapi":"DELETE /api/v1/files/{fileId}","href":"/api-reference/files/delete"}]},{"group":"User Profile","pages":[{"title":"User Profile API","href":"/api-reference/user-profile"},{"title":"Get User Profile","openapi":"GET /api/v1/user-profile","href":"/api-reference/user-profile/get"},{"title":"Save Profile Answers","openapi":"POST /api/v1/user-profile/answers","href":"/api-reference/user-profile/save-answers"},{"title":"Start Profile Session","openapi":"POST /api/v1/user-profile/session","href":"/api-reference/user-profile/start-session"},{"title":"Get Current Cards","openapi":"GET /api/v1/user-profile/cards","href":"/api-reference/user-profile/get-cards"}]},{"group":"Visual Embeds","pages":[{"title":"Visual Embeds API","href":"/api-reference/visual-embeds"},{"title":"List Visual Embeds","openapi":"GET /api/v1/visual-embeds","href":"/api-reference/visual-embeds/list"},{"title":"Create Visual Embed","openapi":"POST /api/v1/visual-embeds","href":"/api-reference/visual-embeds/create"},{"title":"Bulk Create Visual Embeds","openapi":"POST /api/v1/visual-embeds/bulk","href":"/api-reference/visual-embeds/bulk-create"},{"title":"Get Visual Embed","openapi":"GET /api/v1/visual-embeds/{id}","href":"/api-reference/visual-embeds/get"},{"title":"Update Visual Embed","openapi":"PATCH /api/v1/visual-embeds/{id}","href":"/api-reference/visual-embeds/update"},{"title":"Delete Visual Embed","openapi":"DELETE /api/v1/visual-embeds/{id}","href":"/api-reference/visual-embeds/delete"},{"title":"List Categories","openapi":"GET /api/v1/visual-embeds/categories","href":"/api-reference/visual-embeds/categories"}]},{"group":"Second Opinion","pages":[{"title":"Second Opinion PrePrompts","href":"/api-reference/second-opinion-preprompts"},{"title":"Create Preprompt (Admin)","openapi":"POST /api/v1/second-opinion/preprompts","href":"/api-reference/second-opinion/create"},{"title":"List Preprompts (Admin)","openapi":"GET /api/v1/second-opinion/preprompts","href":"/api-reference/second-opinion/list"},{"title":"Get Preprompt (Admin)","openapi":"GET /api/v1/second-opinion/preprompts/{id}","href":"/api-reference/second-opinion/get"},{"title":"Update Preprompt (Admin)","openapi":"PUT /api/v1/second-opinion/preprompts/{id}","href":"/api-reference/second-opinion/update"},{"title":"Delete Preprompt (Admin)","openapi":"DELETE /api/v1/second-opinion/preprompts/{id}","href":"/api-reference/second-opinion/delete"},{"title":"Get Public Catalog","openapi":"GET /api/v1/public/second-opinion/preprompts","href":"/api-reference/second-opinion/public"}]}]}]},"basePath":"","title":"Send Chat Message - Handa Uncle Platform","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BuieBNTB.js","snippetPresets-alIv9Yoc.js","utils-BS41p-Nj.js","style-to-object-BY3JEAdk.js","utils-D0Za9LU_.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-Lx7TZ5XR.js","conditional-requirements-CFM0id0Q.js","cloneDeep-4e5CS5ZI.js","_Uint8Array-B2-W7EM3.js","isObject-FP1Yky1u.js","ApiExamples-sCe6z2hN.js","usePlaygroundInputsStore-cU_dFE5n.js","shallow-BwNCr__O.js","isEqual-Cnvzqd4L.js","CodeSnippets-CMIr49P8.js","CodeSnippet-BC-bKzyy.js","use-playground-group-access-c3bgmn-x.js","Page-Acw_JRP6.js","api-description-markdown-1o8U1kkQ.js","DynamicMarkdown-CvOkzads.js","SectionHeading-CJ97Kdt-.js","MethodPill-DynWltjQ.js","getPastedJson-CBCnXiWl.js","Check2Icon-CPHq_WNu.js","axios-CsQoIw0U.js","Markdown-4tjIF-hK.js","AssistantPageLink-BcChI7L3.js","dist-MIf_HGLZ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}