api/go/telnyx-ai-inference-go/SKILL.md
Access Telnyx LLM inference APIs, embeddings, and AI analytics for call insights and summaries. This skill provides Go SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-ai-inference-goInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
go get github.com/team-telnyx/telnyx-go
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)
All examples below assume client is already initialized as shown above.
Retrieve a list of all AI conversations configured by the user.
GET /ai/conversations
conversations, err := client.AI.Conversations.List(context.TODO(), telnyx.AIConversationListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", conversations.Data)
Create a new AI Conversation.
POST /ai/conversations
conversation, err := client.AI.Conversations.New(context.TODO(), telnyx.AIConversationNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", conversation.ID)
Get all insight groups
GET /ai/conversations/insight-groups
page, err := client.AI.Conversations.InsightGroups.GetInsightGroups(context.TODO(), telnyx.AIConversationInsightGroupGetInsightGroupsParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new insight group
POST /ai/conversations/insight-groups — Required: name
insightTemplateGroupDetail, err := client.AI.Conversations.InsightGroups.InsightGroups(context.TODO(), telnyx.AIConversationInsightGroupInsightGroupsParams{
Name: "name",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", insightTemplateGroupDetail.Data)
Get insight group by ID
GET /ai/conversations/insight-groups/{group_id}
insightTemplateGroupDetail, err := client.AI.Conversations.InsightGroups.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", insightTemplateGroupDetail.Data)
Update an insight template group
PUT /ai/conversations/insight-groups/{group_id}
insightTemplateGroupDetail, err := client.AI.Conversations.InsightGroups.Update(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.AIConversationInsightGroupUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", insightTemplateGroupDetail.Data)
Delete insight group by ID
DELETE /ai/conversations/insight-groups/{group_id}
err := client.AI.Conversations.InsightGroups.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
Assign an insight to a group
POST /ai/conversations/insight-groups/{group_id}/insights/{insight_id}/assign
err := client.AI.Conversations.InsightGroups.Insights.Assign(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.AIConversationInsightGroupInsightAssignParams{
GroupID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
Remove an insight from a group
DELETE /ai/conversations/insight-groups/{group_id}/insights/{insight_id}/unassign
err := client.AI.Conversations.InsightGroups.Insights.DeleteUnassign(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.AIConversationInsightGroupInsightDeleteUnassignParams{
GroupID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
Get all insights
GET /ai/conversations/insights
page, err := client.AI.Conversations.Insights.List(context.TODO(), telnyx.AIConversationInsightListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Create a new insight
POST /ai/conversations/insights — Required: instructions, name
insightTemplateDetail, err := client.AI.Conversations.Insights.New(context.TODO(), telnyx.AIConversationInsightNewParams{
Instructions: "instructions",
Name: "name",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", insightTemplateDetail.Data)
Get insight by ID
GET /ai/conversations/insights/{insight_id}
insightTemplateDetail, err := client.AI.Conversations.Insights.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", insightTemplateDetail.Data)
Update an insight template
PUT /ai/conversations/insights/{insight_id}
insightTemplateDetail, err := client.AI.Conversations.Insights.Update(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.AIConversationInsightUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", insightTemplateDetail.Data)
Delete insight by ID
DELETE /ai/conversations/insights/{insight_id}
err := client.AI.Conversations.Insights.Delete(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
if err != nil {
panic(err.Error())
}
Retrieve a specific AI conversation by its ID.
GET /ai/conversations/{conversation_id}
conversation, err := client.AI.Conversations.Get(context.TODO(), "conversation_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", conversation.Data)
Update metadata for a specific conversation.
PUT /ai/conversations/{conversation_id}
conversation, err := client.AI.Conversations.Update(
context.TODO(),
"conversation_id",
telnyx.AIConversationUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", conversation.Data)
Delete a specific conversation by its ID.
DELETE /ai/conversations/{conversation_id}
err := client.AI.Conversations.Delete(context.TODO(), "conversation_id")
if err != nil {
panic(err.Error())
}
Retrieve insights for a specific conversation
GET /ai/conversations/{conversation_id}/conversations-insights
response, err := client.AI.Conversations.GetConversationsInsights(context.TODO(), "conversation_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Add a new message to the conversation.
POST /ai/conversations/{conversation_id}/message — Required: role
err := client.AI.Conversations.AddMessage(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.AIConversationAddMessageParams{
Role: "role",
},
)
if err != nil {
panic(err.Error())
}
Retrieve messages for a specific conversation, including tool calls made by the assistant.
GET /ai/conversations/{conversation_id}/messages
messages, err := client.AI.Conversations.Messages.List(context.TODO(), "conversation_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messages.Data)
Retrieve tasks for the user that are either queued, processing, failed, success or partial_success based on the query string.
GET /ai/embeddings
embeddings, err := client.AI.Embeddings.List(context.TODO(), telnyx.AIEmbeddingListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", embeddings.Data)
Perform embedding on a Telnyx Storage Bucket using an embedding model.
POST /ai/embeddings — Required: bucket_name
embeddingResponse, err := client.AI.Embeddings.New(context.TODO(), telnyx.AIEmbeddingNewParams{
BucketName: "bucket_name",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", embeddingResponse.Data)
Get all embedding buckets for a user.
GET /ai/embeddings/buckets
buckets, err := client.AI.Embeddings.Buckets.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", buckets.Data)
Get all embedded files for a given user bucket, including their processing status.
GET /ai/embeddings/buckets/{bucket_name}
bucket, err := client.AI.Embeddings.Buckets.Get(context.TODO(), "bucket_name")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", bucket.Data)
Deletes an entire bucket's embeddings and disables the bucket for AI-use, returning it to normal storage pricing.
DELETE /ai/embeddings/buckets/{bucket_name}
err := client.AI.Embeddings.Buckets.Delete(context.TODO(), "bucket_name")
if err != nil {
panic(err.Error())
}
Perform a similarity search on a Telnyx Storage Bucket, returning the most similar num_docs document chunks to the query.
POST /ai/embeddings/similarity-search — Required: bucket_name, query
response, err := client.AI.Embeddings.SimilaritySearch(context.TODO(), telnyx.AIEmbeddingSimilaritySearchParams{
BucketName: "bucket_name",
Query: "query",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Embed website content from a specified URL, including child pages up to 5 levels deep within the same domain.
POST /ai/embeddings/url — Required: url, bucket_name
embeddingResponse, err := client.AI.Embeddings.URL(context.TODO(), telnyx.AIEmbeddingURLParams{
BucketName: "bucket_name",
URL: "url",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", embeddingResponse.Data)
Check the status of a current embedding task.
GET /ai/embeddings/{task_id}
embedding, err := client.AI.Embeddings.Get(context.TODO(), "task_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", embedding.Data)
GET /ai/clusters
page, err := client.AI.Clusters.List(context.TODO(), telnyx.AIClusterListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
Starts a background task to compute how the data in an embedded storage bucket is clustered.
POST /ai/clusters — Required: bucket
response, err := client.AI.Clusters.Compute(context.TODO(), telnyx.AIClusterComputeParams{
Bucket: "bucket",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
GET /ai/clusters/{task_id}
cluster, err := client.AI.Clusters.Get(
context.TODO(),
"task_id",
telnyx.AIClusterGetParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", cluster.Data)
DELETE /ai/clusters/{task_id}
err := client.AI.Clusters.Delete(context.TODO(), "task_id")
if err != nil {
panic(err.Error())
}
GET /ai/clusters/{task_id}/graph
response, err := client.AI.Clusters.FetchGraph(
context.TODO(),
"task_id",
telnyx.AIClusterFetchGraphParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
Transcribe speech to text.
POST /ai/audio/transcriptions
response, err := client.AI.Audio.Transcribe(context.TODO(), telnyx.AIAudioTranscribeParams{
Model: telnyx.AIAudioTranscribeParamsModelDistilWhisperDistilLargeV2,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Text)
Chat with a language model.
POST /ai/chat/completions — Required: messages
response, err := client.AI.Chat.NewCompletion(context.TODO(), telnyx.AIChatNewCompletionParams{
Messages: []telnyx.AIChatNewCompletionParamsMessage{{
Role: "system",
Content: telnyx.AIChatNewCompletionParamsMessageContentUnion{
OfString: telnyx.String("You are a friendly chatbot."),
},
}, {
Role: "user",
Content: telnyx.AIChatNewCompletionParamsMessageContentUnion{
OfString: telnyx.String("Hello, world!"),
},
}},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
Retrieve a list of all fine tuning jobs created by the user.
GET /ai/fine_tuning/jobs
jobs, err := client.AI.FineTuning.Jobs.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", jobs.Data)
Create a new fine tuning job.
POST /ai/fine_tuning/jobs — Required: model, training_file
fineTuningJob, err := client.AI.FineTuning.Jobs.New(context.TODO(), telnyx.AIFineTuningJobNewParams{
Model: "model",
TrainingFile: "training_file",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fineTuningJob.ID)
Retrieve a fine tuning job by job_id.
GET /ai/fine_tuning/jobs/{job_id}
fineTuningJob, err := client.AI.FineTuning.Jobs.Get(context.TODO(), "job_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fineTuningJob.ID)
Cancel a fine tuning job.
POST /ai/fine_tuning/jobs/{job_id}/cancel
fineTuningJob, err := client.AI.FineTuning.Jobs.Cancel(context.TODO(), "job_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fineTuningJob.ID)
This endpoint returns a list of Open Source and OpenAI models that are available for use.
GET /ai/models
response, err := client.AI.GetModels(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
Generate a summary of a file's contents.
POST /ai/summarize — Required: bucket, filename
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)
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.