Start a chat with a model, with its first message when one is sent.
POST /ai/chats
POST https://dev.zanhosting.com/ai/chats
| ID da operação |
ai.chats.post
|
|---|---|
| Acesso | Signed in through ZanAuth: the access token cookie, with its ID token and refresh token companions. Ou: An access token the site's ZanAuth issuer minted for its app, or a static key. |
Corpo da requisição
Obrigatório, enviado como application/x-www-form-urlencoded, application/json.
Esquema: NewChatBody
| Propriedade | Tipo | Descrição | |
|---|---|---|---|
ai_chats_model_id
| string (snowflake) | Obrigatório | |
ai_chat_messages_content
| string, or null | Opcional | The first message; without one the chat starts empty. |
Respostas
| Status | Descrição | Esquema | Tipo de conteúdo |
|---|---|---|---|
| 201 | Chat started. | ChatAnswer | application/json |
| 422 | The input was rejected; errors names each failure. | ValidationProblem | application/json |
| Qualquer outro status | The request was refused. The problem's type names why, and its detail explains it for people to read. | Problem | application/json |
201 Chat started.
| Propriedade | Tipo | Descrição | |
|---|---|---|---|
ai_chats_id
| string (snowflake) | Obrigatório | |
ai_chats_title
| string | Obrigatório | |
ai_chats_model_id
| string (snowflake) | Obrigatório | |
model_label
| string, or null | Obrigatório | Null when the model is no longer offered. |
ai_chats_overrides
| LlmSettings | Obrigatório | |
conversation
| ChatConversation | Obrigatório | |
chats
| list of ChatSummary | Obrigatório | Newest first. |
models
| list of LlmModelOption | Obrigatório | The models one may pick. |
422 The input was rejected; errors names each failure.
| Propriedade | Tipo | Descrição | |
|---|---|---|---|
type
| string | Obrigatório | A URL that identifies the kind of problem. Its last segment, such as auth_required or input_invalid, is the code your app should check. |
title
| string | Obrigatório | The HTTP status as text, such as Not Found. |
status
| integer (int32) | Obrigatório | The HTTP status code of the response. |
detail
| string | Obrigatório | An explanation of what went wrong, written for people to read. |
instance
| string | Obrigatório | The path the request was sent to. |
errors
| InputErrors | Obrigatório | What is wrong with each refused value. Parameters come as a list, and body errors as a tree shaped like the body. |
Qualquer outro status: The request was refused. The problem's type names why, and its detail explains it for people to read.
| Propriedade | Tipo | Descrição | |
|---|---|---|---|
type
| string | Obrigatório | A URL that identifies the kind of problem. Its last segment, such as auth_required or input_invalid, is the code your app should check. |
title
| string | Obrigatório | The HTTP status as text, such as Not Found. |
status
| integer (int32) | Obrigatório | The HTTP status code of the response. |
detail
| string | Obrigatório | An explanation of what went wrong, written for people to read. |
instance
| string | Obrigatório | The path the request was sent to. |
Exemplo
curl -X POST 'https://dev.zanhosting.com/ai/chats' \
-H 'Authorization: Bearer <access token>' \
-H 'Content-Type: application/json' \
-d '{
"ai_chats_model_id": "<string (snowflake)>"
}'