---
title: "Generate a model response to a conversation that can include references to video content"
method: POST
path: "/chat/completions"
tags: ["Chat"]
---

# Generate a model response to a conversation that can include references to video content

`POST /chat/completions`

## Request

- Base URL: `https://api.cloudglue.dev/v1`
- URL: `https://api.cloudglue.dev/v1/chat/completions`
- Auth: HTTP bearer

Generate a model response to a conversation that can include references to video content

## Request body

- ChatCompletionRequest
  - `model` 'nimbus-001', required: Name of the video understanding model to use.
  - `messages` ChatMessage[], required: A list of messages comprising the conversation so far
    - `role` 'system' | 'user' | 'assistant', required: The role of the message author
    - `content` string, required: The content of the message
    - `name` string: The name of the author of this message
  - `collections` string[], required: List of collection IDs to use as context for the chat. Note that 'nimbus-001' only supports collections with collection_type 'media-descriptions' or 'rich-transcripts'
  - `filter` object: Filter criteria to constrain search results used in chat
    - `metadata` object[]: Filter by file metadata using JSON path expressions
      - `path` string, required: JSON path on metadata object (e.g. 'my_custom_field', 'category.subcategory')
      - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'In' | 'ContainsAny' | 'ContainsAll', required: Comparison operator to apply
      - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, In)
      - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll)
    - `video_info` object[]: Filter by video information. Use scope 'file' for source video properties or 'segment' for segment properties (e.g. segment duration).
      - `path` 'duration_seconds' | 'has_audio', required: JSON path on video_info object (e.g. 'has_audio', 'duration_seconds')
      - `scope` 'file' | 'segment': Scope of the filter. 'file' filters by source video properties, 'segment' filters by segment properties. Only duration_seconds is supported with segment scope.
      - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'In' | 'ContainsAny' | 'ContainsAll', required: Comparison operator to apply
      - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, In)
      - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll)
    - `file` object[]: Filter by file properties using JSON path expressions
      - `path` string, required: JSON path on file object (e.g. 'uri', 'id', 'filename', 'created_at', 'bytes')
      - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'In' | 'ContainsAny' | 'ContainsAll', required: Comparison operator to apply
      - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, In)
      - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll)
  - `temperature` number: Sampling temperature to use, between 0 and 2

## Response `200`

Successful response

- ChatCompletionResponse
  - `id` string: Unique identifier for this chat completion
  - `object` string: Object type, always "chat.completion"
  - `created_at` integer: Unix timestamp in milliseconds when the chat completion was created
  - `model` string: The model used for the chat completion
  - `choices` object[]: The generated responses
    - `index` integer: The index of this choice
    - `message` ChatMessage
      - `role` 'system' | 'user' | 'assistant', required: The role of the message author
      - `content` string, required: The content of the message
      - `name` string: The name of the author of this message
    - `citations` object[]: Citations to specific video segments that informed the response
      - `collection_id` string: ID of the collection containing the cited video
      - `file_id` string: ID of the file being cited
      - `segment_id` string: ID of the segment being cited
      - `start_time` union: Start time of the cited segment in seconds
        - string: Start time of the cited segment in seconds
        - number: Start time of the cited segment in seconds
      - `end_time` union: End time of the cited segment in seconds
        - string: End time of the cited segment in seconds
        - number: End time of the cited segment in seconds
      - `text` string: (Deprecated) Relevant text from the segment; use context and relevant_sources instead
      - `context` string: Short explanation of the relevance of the segment to the query provided as context
      - `relevant_sources` object[]: List of source modalities in segment that are relevant for this citation
        - `text` string: Source modality, one of visual_scene_description, scene_text, speech
      - `visual_scene_description` DescribeOutputPart[]: Array of visual descriptions
        - `text` string: Text content
        - `start_time` number: Start time in seconds
        - `end_time` number: End time in seconds
      - `scene_text` DescribeOutputPart[]: Array of scene text extractions
        - `text` string: Text content
        - `start_time` number: Start time in seconds
        - `end_time` number: End time in seconds
      - `speech` SpeechOutputPart[]: Array of speech transcriptions
        - `speaker` string: Identified speaker
        - `text` string: Transcribed speech text
        - `start_time` number: Start time of speech in seconds
        - `end_time` number: End time of speech in seconds
        - `words` WordTimestamp[]: Word-level timestamps. Only present when include_word_timestamps=true. Not available for YouTube sources.
          - `word` string, required: The word text
          - `start_time` number, required: Start time of the word in seconds
          - `end_time` number, required: End time of the word in seconds
      - `audio_description` DescribeOutputPart[]: Array of audio descriptions
        - `text` string: Text content
        - `start_time` number: Start time in seconds
        - `end_time` number: End time in seconds
  - `payload` ChatCompletionPayload
    - `messages` ChatMessage[]
      - `role` 'system' | 'user' | 'assistant', required: The role of the message author
      - `content` string, required: The content of the message
      - `name` string: The name of the author of this message
    - `temperature` number: The temperature of the chat completion
    - `filter` SearchFilter
      - `metadata` object[]: Filter by file metadata using JSON path expressions
        - `path` string, required: JSON path for the field to filter on
        - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'ContainsAny' | 'ContainsAll' | 'In' | 'Like', required: Comparison operator to apply
        - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, Like)
        - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll, In)
        - `scope` 'file' | 'segment': Specifies scope of eligible search items (file/segment) to check metadata filtering conditions
      - `video_info` object[]: Filter by video information. Use scope 'file' to filter by source video properties, or 'segment' to filter by individual segment properties (e.g. segment duration).
        - `path` 'duration_seconds' | 'has_audio', required: JSON path for the field to filter on
        - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'ContainsAny' | 'ContainsAll' | 'In' | 'Like', required: Comparison operator to apply
        - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, Like)
        - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll, In)
        - `scope` 'file' | 'segment': Scope of the filter. 'file' filters by source video properties, 'segment' filters by segment properties. Only duration_seconds is supported with segment scope.
      - `file` object[]: Filter by file properties
        - `path` 'bytes' | 'filename' | 'uri' | 'created_at' | 'id', required: JSON path for the field to filter on
        - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'ContainsAny' | 'ContainsAll' | 'In' | 'Like', required: Comparison operator to apply
        - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, Like)
        - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll, In)
      - `source_metadata` SearchFilterCriteria[]: Filter by connector-provided source metadata using JSON path expressions (file scope only). Available fields depend on the file's source. Examples: source_metadata.topic (zoom), source_metadata.host_email (zoom), source_metadata.title (gong/grain/iconik), source_metadata.participants.name (grain), source_metadata.parties.email (gong), source_metadata.tags (grain, use ContainsAny), source_metadata.meeting_platform (recall), source_metadata.name (google-drive/dropbox), source_metadata.media_type (iconik), source_metadata.iconik_metadata.<FieldName> (iconik custom metadata-view fields, e.g. source_metadata.iconik_metadata.Keywords with ContainsAny). Paths through arrays of objects match when ANY element matches. ISO datetime fields (zoom start_time, gong started, grain start_datetime, recall started_at, iconik date_created) compare as strings with LessThan/GreaterThan and represent the actual meeting date (or, for iconik, the asset creation date).
        - `path` string, required: JSON path for the field to filter on
        - `operator` 'NotEqual' | 'Equal' | 'LessThan' | 'GreaterThan' | 'ContainsAny' | 'ContainsAll' | 'In' | 'Like', required: Comparison operator to apply
        - `valueText` string: Text value for scalar comparison (used with NotEqual, Equal, LessThan, GreaterThan, Like)
        - `valueTextArray` string[]: Array of values for array comparisons (used with ContainsAny, ContainsAll, In)
    - `collections` string[]
  - `usage` object: Usage statistics for the completion request
    - `prompt_tokens` integer: Number of tokens in the prompt
    - `completion_tokens` integer: Number of tokens in the generated completion
    - `total_tokens` integer: Total number of tokens used in the request

## Other responses

- `400`: Invalid request
- `403`: Usage limit reached (monthly or daily chat completions) — `code: usage_limit_reached`
- `404`: Collections not found
- `500`: An unexpected error occurred on the server

## Changes

- **2026-10-30** `23d3f240819f`: 5 info
  - added the non-success response with the status `403`
  - removed the non-success response with the status `429`
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `404` status
  - …1 more
- **2026-07-22** `c02e52ec2e28`: 1 info
  - added the optional property `payload/filter/source_metadata` to the response with the `200` status
- **2026-03-11** `1d5d6115c0d0`: 5 info
  - the `scope` request property default value `file` was removed
  - the `temperature` request property default value `0.7` was removed
  - added the optional property `choices/items/citations/items/allOf[#/components/schemas/DescribeOutput]/speech/items/words` to the response with the `200` status
  - the `scope` response's property default value `file` was removed for the status `200`
  - …1 more
- **2026-03-03** `fbee7be59d72`: 1 breaking, 4 info
  - request property `filter/video_info/items/path` was restricted to a list of enum values
  - added the new optional request property `filter/video_info/items/scope`
  - added the new `duration_seconds` enum value to the request property `filter/video_info/items/path`
  - added the new `has_audio` enum value to the request property `filter/video_info/items/path`
  - …1 more
- **2026-01-05** `deb3e8e32814`: 1 info
  - added the optional property `payload` to the response with the `200` status

[Operation history](https://skmtc.dev/cloudglue/apis/cloudglue-api/changes/chat/completions/post.md)

---

[API](https://skmtc.dev/cloudglue/apis/cloudglue-api.md) - [All operations](https://skmtc.dev/cloudglue/apis/cloudglue-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudglue/apis/cloudglue-api/revisions/23d3f240819f?raw)
