Skip to content

Hi Coactive team!

This is a sample of what your docs might look like on Starport, based on your public docs.

Take a look! Ask AI, search, the MCP server, and Markdown copies all work.

Starport is a free and open-source docs framework based on Starlight and maintained by Promptless. Promptless is the AI agent that automatically updates your customer-facing docs.

Every annual Promptless plan comes with white-glove migration to Starport, where we migrate the content, tune the result with you, and you own the repository so you're never locked in.

Book a 15-minute walkthrough

Sample migration of Coactive docs to Starport, prepared by PromptlessBook 15-minute call

Predict composite slice subject(s)

POST https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/{dataset_id}/videos/{video_id}/composite-slices/{composite_slice_id}/subject
Content-Type: application/json

Predict composite slice subject(s).

Subject: The main topic or theme the content focuses on.

  • Authorization header (bearer token, required) — Bearer authentication of the form Bearer <token>, where token is your auth token.
  • dataset_id (string, required)
  • video_id (string, required)
  • composite_slice_id (string, required)

This endpoint expects an object.

  • composite_slice_context (string, optional, nullable) — Optional context about the composite slice

Successful Response

  • subjects (list of string, required) — Predicted composite slice subjects

Validation Error

  • detail (list of object, optional)
    • loc (list of string or integer, required)
    • msg (string, required)
    • type (string, required)

Request

{
"composite_slice_context": "This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro."
}

Response

{
"subjects": [
"Crime",
"Heist"
]
}

SDK Code

import requests
url = "https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject"
payload = { "composite_slice_context": "This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = 'https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: '{"composite_slice_context":"This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro."}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject"
payload := strings.NewReader("{\n \"composite_slice_context\": \"This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro.\"\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(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject")
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 \"composite_slice_context\": \"This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro.\"\n}"
response = http.request(request)
puts response.read_body
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"composite_slice_context\": \"This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro.\"\n}")
.asString();
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject', [
'body' => '{
"composite_slice_context": "This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro."
}',
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
using RestSharp;
var client = new RestClient("https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"composite_slice_context\": \"This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
let parameters = ["composite_slice_context": "This is a scene from a film directed by Michael Mann in 1995, starring Al Pacino and Robert De Niro."] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.coactive.ai/api/v0/video-narrative-metadata/datasets/dataset_id/videos/video_id/composite-slices/composite_slice_id/subject")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()