> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vook.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a prompt to a chat and get its answer

> You continue a chat, including one opened in the web app, and get the answer in the same response. If your connection drops, the answer is still saved: get the chat until turn_in_progress is false. A chat holds up to 2,000,000 tokens. This endpoint is in beta and may change.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/transcriptions/{id}/chats/{chat_id}/messages
openapi: 3.0.0
info:
  title: Vook API
  description: >-
    Public transcription API. Authenticate every request with your API key:
    `Authorization: Bearer vk_live_…`.


    ## Transcribe a file (3 calls)


    1. **`POST /api/v1/uploads/init`** → returns an `upload_url`, an
    `upload_token` and the token's `expires_at`.

    2. **`POST {upload_url}`**: POST the whole file to the `upload_url` returned
    by call 1 (**a different host from this API**) as `multipart/form-data` with
    a single `chunk` field, authenticated with `Authorization: Bearer
    {upload_token}`. The file is sent as a single chunk; no chunk index/count is
    needed. This step is on the ingress service and is not listed below.

    3. **`POST /api/v1/transcription-jobs`**: pass the `upload_token` +
    `file_name` + `language` + `diarize`. Returns a job `id`.


    Then **poll `GET /api/v1/transcription-jobs/{id}`** until `status` is
    `completed` (or `failed`). Read the `transcription_id` through **`GET
    /api/v1/transcriptions/{id}`** and its `/transcript` / `/export`
    sub-resources.
  version: v1
  contact: {}
servers:
  - url: https://www.api.vook.ai
    description: Production
security: []
tags: []
paths:
  /api/v1/transcriptions/{id}/chats/{chat_id}/messages:
    post:
      tags:
        - Chats (API v1, beta)
      summary: Add a prompt to a chat and get its answer
      description: >-
        You continue a chat, including one opened in the web app, and get the
        answer in the same response. If your connection drops, the answer is
        still saved: get the chat until turn_in_progress is false. A chat holds
        up to 2,000,000 tokens. This endpoint is in beta and may change.
      operationId: ApiV1LlmChatController_addMessage
      parameters:
        - name: id
          required: true
          in: path
          description: Transcription ID
          schema:
            example: 123e4567-e89b-12d3-a456-426614174000
            type: string
        - name: chat_id
          required: true
          in: path
          description: Chat ID
          schema:
            example: 123e4567-e89b-12d3-a456-426614174000
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiChatMessageCreateDto'
      responses:
        '201':
          description: The chat, with your prompt and its answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiChatDto'
        '402':
          description: >-
            Your API credit balance is empty and this transcript has not been
            charged for LLM access yet (error code: insufficient_api_credits).
            Top up to chat over it.
        '403':
          description: >-
            Chat is in beta and not enabled for this account (error code:
            chat_not_enabled)
        '404':
          description: The transcription or the chat does not exist
        '409':
          description: >-
            Another message on this chat is still being answered (error code:
            chat_turn_in_progress), or the chat has reached its limit of
            2,000,000 tokens (error code: chat_token_limit_reached). Open a new
            chat to continue after the limit.
      security:
        - bearer: []
components:
  schemas:
    ApiChatMessageCreateDto:
      type: object
      properties:
        prompt:
          type: string
          minLength: 1
          description: Question or instruction to run against the transcript
          example: List the action items decided in this meeting.
      required:
        - prompt
    ApiChatDto:
      type: object
      properties:
        id:
          type: string
          description: Chat ID
          example: 123e4567-e89b-12d3-a456-426614174000
        transcription_id:
          type: string
          description: ID of the transcription this chat runs against
          example: 123e4567-e89b-12d3-a456-426614174000
        title:
          type: string
          description: Label given to the chat
          example: Action items
        created_at:
          format: date-time
          type: string
          description: When the chat was created
          example: '2024-01-15T10:30:00.000Z'
        messages:
          description: Prompts and answers, oldest first
          type: array
          items:
            $ref: '#/components/schemas/ApiChatMessageDto'
        turn_in_progress:
          type: boolean
          description: >-
            True while a message on this chat is being answered. Poll the chat
            until it is false: your prompt and its answer in messages means the
            turn completed.
          example: false
      required:
        - id
        - transcription_id
        - title
        - created_at
        - messages
        - turn_in_progress
    ApiChatMessageDto:
      type: object
      properties:
        role:
          description: Who wrote the message
          example: user
          allOf:
            - $ref: '#/components/schemas/ApiChatMessageRole'
        content:
          type: string
          description: Message text
          example: List the action items decided in this meeting.
        created_at:
          format: date-time
          type: string
          description: When the message was written
          example: '2024-01-15T10:30:00.000Z'
      required:
        - role
        - content
        - created_at
    ApiChatMessageRole:
      type: string
      enum:
        - user
        - assistant
      description: Who wrote the message
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: vk_live_…
      type: http
      description: Your Vook API key (mint one from the web app).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.