Post Chat Completion
Authentication
AuthorizationBearer
Bearer authentication of the form Bearer <token>, where token is your auth token.
Path parameters
domain
Request
This endpoint expects an object.
messages
The messages to use for the chat completion
model
The model to use for the chat completion
Allowed values:
max_tokens
The maximum number of tokens to generate. Note: setting a token count lower than 2000 may result in incomplete responses. You can add a custom system prompt to control the verbosity of the response.
system_prompt
The system prompt to use for the chat completion
rewrite_query
Whether to rewrite the query using query decomposition
user_is_authed
Whether the requesting user is authenticated. When true, authed chunks are included in results.
allowed_roles
Roles the authenticated user has. Used to filter chunks by role-based access control.
source
The origin of the request (e.g. 'web', 'slack', 'api').
basepaths
Restrict retrieval to pages under these URL path prefixes (e.g. ['/my-product']). Matches the scoping the Ask AI widget applies when embedded under a product path. Omit to search the whole site.
skip_save_query
Set to true for test or eval traffic. The request is answered (and billed) normally but is excluded from usage analytics.
Response
Successful Response
turns
The conversation turns in the chat completion
citations
List of citation strings
sources
Pages the answer was grounded in, one entry per cited page
Errors
422
Unprocessable Entity Error