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

# Fetch a cluster visualization



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/analytics.yml get /ai/clusters/{task_id}/graph
openapi: 3.1.0
info:
  title: Telnyx AI Analytics API
  version: 2.0.0
  description: API for AI conversations, insights, embeddings, and clusters.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/clusters/{task_id}/graph:
    get:
      tags:
        - Clusters
      summary: Fetch a cluster visualization
      operationId: fetch_cluster_image_by_task_id_public_text_clusters__task_id__image_get
      parameters:
        - required: true
          schema:
            type: string
            title: Task Id
          name: task_id
          in: path
        - name: cluster_id
          in: query
          required: false
          schema:
            type: integer
            title: Cluster Id
      responses:
        '200':
          description: >-
            Successful Response - Returns a PNG image of the cluster
            visualization.
          content:
            image/png:
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

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

            const response = await client.ai.clusters.fetchGraph('task_id');

            console.log(response);

            const content = await response.blob();
            console.log(content);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.ai.clusters.fetch_graph(
                task_id="task_id",
            )
            print(response)
            content = response.read()
            print(content)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.AI.Clusters.FetchGraph(\n\t\tcontext.TODO(),\n\t\t\"task_id\",\n\t\ttelnyx.AIClusterFetchGraphParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.core.http.HttpResponse;
            import com.telnyx.sdk.models.ai.clusters.ClusterFetchGraphParams;

            public final class Main {
                private Main() {}

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

                    HttpResponse response = client.ai().clusters().fetchGraph("task_id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            response = telnyx.ai.clusters.fetch_graph("task_id")

            puts(response)
        - lang: CLI
          source: |-
            telnyx ai:clusters fetch-graph \
              --api-key 'My API Key' \
              --task-id task_id
components:
  schemas:
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````