---
title: "Get a non-streaming answer"
method: POST
path: "/chat/message"
tags: ["API: Non-Streaming Messaging"]
---

# Get a non-streaming answer

`POST /chat/message`

This is the primary endpoint for starting and continuing a conversation with the AI chatbot in a non-streaming manner.

For most non-streaming flows, use the `GenerateMessageAnswerRequest` body params.

However, if you had previously created a message using the `/chat/message/create` and have a `messageId`, then use the `GenerateExistingMessageAnswerRequest` body params.

## Request body

- union
  - GenerateMessageAnswerRequest
    - `channelId` string, uuid, required — ID of the channel on which the conversation was or will be initiated.
    - `source` string, required — The source of the chat conversation to be used for your analytics and debugging purposes.
    - `message` string, text, required — Content of the user message.
    - `conversationId` string, uuid — ID of the conversation/thread. If present, will add the newly created message record to the conversation history. Otherwise, will create a new conversation.
    - `senderId` string — An optional user identifier to be used for your analytics and debugging purposes.
    - `options` GenerateMessageAnswerOptions
      - `responseSize` 'XS' | 'SM' | 'MD' | 'LG' | 'XL' | 'AUTO' — Indicates the preferred size of the answer. Latency will increase as you increase the size of the response. Suggested option - AUTO, it will generate an appropriate answer size relevant to the intent of the user query.
      - `autoUseFallback` boolean — Indicates if the system should proceed with its normal flow and automatically switch to a fallback answer, if the answer cannot be generated from the referenced content. Your account must have the fallback answer feature enabled to use this.
      - `gptModel` 'GPT_3_5_TURBO' | 'GPT_4' — Optional field that allows to override default GPT Model to be used instead of the one set of the channel.
      - `useInlineReferences` boolean — Indicates if the API should return inline references within the answer or if the inline references should be removed instead.
      - `customInstructionId` string, uuid — Optional field, indicating the ID of the custom instruction associated with the channel that should be used. This allows override of the one set as primary on the channel settings.
      - `inlineReferenceType` 'ID' | 'URL' — Non-Streaming route only. Indicates the preferred type of the inline reference format, when useInlineReferences = true. When selected type = ID, the footnotes are returned as [^LalSzaA]. When type = 'URL', footnotes are returned as [\^1\](url). References JSON will be updated as well to [^LalSzaA] => footnoteId = LalSzaA or [\^1\](url) => footnoteId = '1'
  - GenerateExistingMessageAnswerRequest
    - `messageId` string, uuid, required — ID of the message record for which the answer should be generated. In streaming flow, it is required to create the message record in advance, since streaming returns only the answer text.
    - `options` GenerateMessageAnswerOptions
      - `responseSize` 'XS' | 'SM' | 'MD' | 'LG' | 'XL' | 'AUTO' — Indicates the preferred size of the answer. Latency will increase as you increase the size of the response. Suggested option - AUTO, it will generate an appropriate answer size relevant to the intent of the user query.
      - `autoUseFallback` boolean — Indicates if the system should proceed with its normal flow and automatically switch to a fallback answer, if the answer cannot be generated from the referenced content. Your account must have the fallback answer feature enabled to use this.
      - `gptModel` 'GPT_3_5_TURBO' | 'GPT_4' — Optional field that allows to override default GPT Model to be used instead of the one set of the channel.
      - `useInlineReferences` boolean — Indicates if the API should return inline references within the answer or if the inline references should be removed instead.
      - `customInstructionId` string, uuid — Optional field, indicating the ID of the custom instruction associated with the channel that should be used. This allows override of the one set as primary on the channel settings.
      - `inlineReferenceType` 'ID' | 'URL' — Non-Streaming route only. Indicates the preferred type of the inline reference format, when useInlineReferences = true. When selected type = ID, the footnotes are returned as [^LalSzaA]. When type = 'URL', footnotes are returned as [\^1\](url). References JSON will be updated as well to [^LalSzaA] => footnoteId = LalSzaA or [\^1\](url) => footnoteId = '1'

## Response `200`

A successful response to a generated message answer.

- GenerateMessageAnswerResponse
  - `conversationId` string, uuid — ID of the chat conversation/thread.
  - `messageId` string, uuid — ID of the message record that was created.
  - `answerContent` string, text — Content of the answer that was generated.
  - `answerMessageId` string, text — Message ID for the associated generated answer. Use this to fetch suggested questions, references, details.
  - `references` object[]
    - `id` string, uuid — ID of the reference record.
    - `contentId` string, uuid — ID of the parent content record from which the reference were generated. Useful in case of multiple references being generated from the same content record, in case deduplication is needed.
    - `relevanceRank` integer — Rank of relevance of the reference to the generated answer content.
    - `source` 'YOUTUBE' | 'VIMEO' | 'WEBSITE' | 'VIDEO' | 'SPOTIFY' — Source of the content to be used for handling its display to the user.
    - `title` string — Title of the main/source media.
    - `url` string, url
    - `text` string — Text of the referenced section's content.
    - `thumbnailUrl` string, url
    - `urlContentId` string — Original ID of the media from the given source. It can be used to generate an iframe/embed url when displaying the content from the reference.
    - `timeSeconds` number, float — Optional time location seconds of the content. If it's null or undefined, then it's a text document without timestamps.
    - `footnoteId` string — ID of a footnote used within the answer, useful to display additional information when inline references are being used.

## Other responses

- `422` — Some or all of the received payload is unprocessable.
- `500` — Internal server error

---

[API](https://skmtc.dev/sentiyen/apis/sentiyen-api-v3.md) · [All operations](https://skmtc.dev/sentiyen/apis/sentiyen-api-v3/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sentiyen/sentiyen-api-v3/revisions/8ce4e621146e/schema)
