Skip to main content
GET
/
ai
/
clusters
/
{task_id}
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const cluster = await client.ai.clusters.retrieve('task_id');

console.log(cluster.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
cluster = client.ai.clusters.retrieve(
task_id="task_id",
)
print(cluster.data)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
cluster, err := client.AI.Clusters.Get(
context.TODO(),
"task_id",
telnyx.AIClusterGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", cluster.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.clusters.ClusterRetrieveParams;
import com.telnyx.sdk.models.ai.clusters.ClusterRetrieveResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

ClusterRetrieveResponse cluster = client.ai().clusters().retrieve("task_id");
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

cluster = telnyx.ai.clusters.retrieve("task_id")

puts(cluster)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$cluster = $client->ai->clusters->retrieve(
'task_id', showSubclusters: true, topNNodes: 0
);

var_dump($cluster);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx ai:clusters retrieve \
--api-key 'My API Key' \
--task-id task_id
curl --request GET \
--url https://api.telnyx.com/v2/ai/clusters/{task_id} \
--header 'Authorization: Bearer <token>'
{
  "data": {
    "bucket": "<string>",
    "clusters": [
      {
        "cluster_id": "<string>",
        "cluster_summary": "<string>",
        "total_number_of_nodes": 123,
        "cluster_header": "<string>",
        "nodes": [
          {
            "filename": "<string>",
            "text": "<string>"
          }
        ],
        "subclusters": "<array>"
      }
    ]
  }
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

task_id
string
required

Unique identifier of the task.

Query Parameters

top_n_nodes
integer
default:0

The number of nodes in the cluster to return in the response. Nodes will be sorted by their centrality within the cluster.

show_subclusters
boolean
default:false

Whether or not to include subclusters and their nodes in the response.

Response

Successful Response

data
ClusteringStatusResponse · object
required