Skip to main content
POST
/
ai
/
summarize
JavaScript
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.summarize({ bucket: 'bucket', filename: 'filename' });

console.log(response.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
)
response = client.ai.summarize(
    bucket="bucket",
    filename="filename",
)
print(response.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"),
	)
	response, err := client.AI.Summarize(context.TODO(), telnyx.AISummarizeParams{
		Bucket:   "bucket",
		Filename: "filename",
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.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.AiSummarizeParams;
import com.telnyx.sdk.models.ai.AiSummarizeResponse;

public final class Main {
    private Main() {}

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

        AiSummarizeParams params = AiSummarizeParams.builder()
            .bucket("bucket")
            .filename("filename")
            .build();
        AiSummarizeResponse response = client.ai().summarize(params);
    }
}
require "telnyx"

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

response = telnyx.ai.summarize(bucket: "bucket", filename: "filename")

puts(response)
<?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 {
  $response = $client->ai->summarize(
    bucket: 'bucket', filename: 'filename', systemPrompt: 'system_prompt'
  );

  var_dump($response);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx ai summarize \
  --api-key 'My API Key' \
  --bucket bucket \
  --filename filename
curl --request POST \
  --url https://api.telnyx.com/v2/ai/summarize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "bucket": "<string>",
  "filename": "<string>",
  "system_prompt": "<string>"
}
'
{
  "data": {
    "summary": "<string>"
  }
}
{
  "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.

Body

application/json
bucket
string
required

The name of the bucket that contains the file to be summarized.

filename
string
required

The name of the file to be summarized.

system_prompt
string

A system prompt to guide the summary generation.

Response

Successful Response

data
SummaryResponse · object
required