跳到导航

Post Chat Completion

以 Markdown 格式查看

身份验证

AuthorizationBearer
Bearer 身份验证,格式为 `Bearer <token>`,其中 token 是您的身份验证令牌。

路径参数

domainstring必需

请求

This endpoint expects an object.
messageslist of objects必需
The messages to use for the chat completion
modelenum or null可选
The model to use for the chat completion
允许的值:
max_tokensinteger or null可选100-3500默认为 3000

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_promptstring or null可选
The system prompt to use for the chat completion
rewrite_queryboolean or null可选默认为 false
Whether to rewrite the query using query decomposition
user_is_authedboolean可选默认为 false
Whether the requesting user is authenticated. When true, authed chunks are included in results.
allowed_roleslist of strings or null可选

Roles the authenticated user has. Used to filter chunks by role-based access control.

sourcestring or null可选

The origin of the request (e.g. ‘web’, ‘slack’, ‘api’).

basepathslist of strings or null可选

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_queryboolean可选默认为 false

Set to true for test or eval traffic. The request is answered (and billed) normally but is excluded from usage analytics.

响应

Successful Response
turnslist of objects
The conversation turns in the chat completion
citationslist of strings
List of citation strings
sourceslist of objects可选
Pages the answer was grounded in, one entry per cited page

错误

422
Unprocessable Entity Error