Skip to main content
POST
/
chat
/
completions
Generate a model response to a conversation that can include references to video content
curl --request POST \
  --url https://api.cloudglue.dev/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "nimbus-001",
  "messages": [
    {
      "content": "<string>",
      "name": "<string>"
    }
  ],
  "collections": [
    "<string>"
  ],
  "filter": {
    "metadata": [
      {
        "path": "<string>",
        "valueText": "<string>",
        "valueTextArray": [
          "<string>"
        ]
      }
    ],
    "video_info": [
      {
        "valueText": "<string>",
        "valueTextArray": [
          "<string>"
        ]
      }
    ],
    "file": [
      {
        "path": "<string>",
        "valueText": "<string>",
        "valueTextArray": [
          "<string>"
        ]
      }
    ]
  },
  "temperature": 1
}
'
import requests

url = "https://api.cloudglue.dev/v1/chat/completions"

payload = {
"model": "nimbus-001",
"messages": [
{
"content": "<string>",
"name": "<string>"
}
],
"collections": ["<string>"],
"filter": {
"metadata": [
{
"path": "<string>",
"valueText": "<string>",
"valueTextArray": ["<string>"]
}
],
"video_info": [
{
"valueText": "<string>",
"valueTextArray": ["<string>"]
}
],
"file": [
{
"path": "<string>",
"valueText": "<string>",
"valueTextArray": ["<string>"]
}
]
},
"temperature": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'nimbus-001',
messages: [{content: '<string>', name: '<string>'}],
collections: ['<string>'],
filter: {
metadata: [{path: '<string>', valueText: '<string>', valueTextArray: ['<string>']}],
video_info: [{valueText: '<string>', valueTextArray: ['<string>']}],
file: [{path: '<string>', valueText: '<string>', valueTextArray: ['<string>']}]
},
temperature: 1
})
};

fetch('https://api.cloudglue.dev/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloudglue.dev/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'nimbus-001',
'messages' => [
[
'content' => '<string>',
'name' => '<string>'
]
],
'collections' => [
'<string>'
],
'filter' => [
'metadata' => [
[
'path' => '<string>',
'valueText' => '<string>',
'valueTextArray' => [
'<string>'
]
]
],
'video_info' => [
[
'valueText' => '<string>',
'valueTextArray' => [
'<string>'
]
]
],
'file' => [
[
'path' => '<string>',
'valueText' => '<string>',
'valueTextArray' => [
'<string>'
]
]
]
],
'temperature' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.cloudglue.dev/v1/chat/completions"

payload := strings.NewReader("{\n \"model\": \"nimbus-001\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"filter\": {\n \"metadata\": [\n {\n \"path\": \"<string>\",\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ],\n \"video_info\": [\n {\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ],\n \"file\": [\n {\n \"path\": \"<string>\",\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"temperature\": 1\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.cloudglue.dev/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"nimbus-001\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"filter\": {\n \"metadata\": [\n {\n \"path\": \"<string>\",\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ],\n \"video_info\": [\n {\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ],\n \"file\": [\n {\n \"path\": \"<string>\",\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"temperature\": 1\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cloudglue.dev/v1/chat/completions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"nimbus-001\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"collections\": [\n \"<string>\"\n ],\n \"filter\": {\n \"metadata\": [\n {\n \"path\": \"<string>\",\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ],\n \"video_info\": [\n {\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ],\n \"file\": [\n {\n \"path\": \"<string>\",\n \"valueText\": \"<string>\",\n \"valueTextArray\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"temperature\": 1\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "object": "<string>",
  "created_at": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "content": "<string>",
        "name": "<string>"
      },
      "citations": [
        {
          "collection_id": "<string>",
          "file_id": "<string>",
          "segment_id": "<string>",
          "start_time": "<string>",
          "end_time": "<string>",
          "text": "<string>",
          "context": "<string>",
          "relevant_sources": [
            {
              "text": "<string>"
            }
          ],
          "visual_scene_description": [
            {
              "text": "<string>",
              "start_time": 123,
              "end_time": 123
            }
          ],
          "scene_text": [
            {
              "text": "<string>",
              "start_time": 123,
              "end_time": 123
            }
          ],
          "speech": [
            {
              "speaker": "<string>",
              "text": "<string>",
              "start_time": 123,
              "end_time": 123,
              "words": [
                {
                  "word": "<string>",
                  "start_time": 123,
                  "end_time": 123
                }
              ]
            }
          ],
          "audio_description": [
            {
              "text": "<string>",
              "start_time": 123,
              "end_time": 123
            }
          ]
        }
      ]
    }
  ],
  "payload": {
    "messages": [
      {
        "content": "<string>",
        "name": "<string>"
      }
    ],
    "temperature": 123,
    "filter": {
      "metadata": [
        {
          "path": "<string>",
          "valueText": "<string>",
          "valueTextArray": [
            "<string>"
          ]
        }
      ],
      "video_info": [
        {
          "valueText": "<string>",
          "valueTextArray": [
            "<string>"
          ]
        }
      ],
      "file": [
        {
          "valueText": "<string>",
          "valueTextArray": [
            "<string>"
          ]
        }
      ]
    },
    "collections": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ]
  },
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Chat completion parameters

model
enum<string>
required

Name of the video understanding model to use.

Available options:
nimbus-001
messages
object[]
required

A list of messages comprising the conversation so far

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'

Required array length: 1 element
filter
object

Filter criteria to constrain search results used in chat

temperature
number

Sampling temperature to use, between 0 and 2

Required range: 0 <= x <= 2

Response

Successful response

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

payload
object
usage
object

Usage statistics for the completion request