telnyx-ai-assistants-c…
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Advanced call control features including DTMF sending, SIPREC recording, noise suppression, client state, and supervisor controls. This skill provides Go SDK examples.
Claude Code
$ npx -y skills add team-telnyx/ai --skill telnyx-voice-advanced-go --agent claude-code
Codex
$ npx skills add team-telnyx/ai --skill telnyx-voice-advanced-go -a codex -y
Cursor
$ npx skills add team-telnyx/ai --skill telnyx-voice-advanced-go -a cursor -y
Gemini CLI
$ npx skills add team-telnyx/ai --skill telnyx-voice-advanced-go -a gemini-cli -y
GitHub Copilot
$ npx skills add team-telnyx/ai --skill telnyx-voice-advanced-go -a github-copilot -y
OpenCode
$ npx skills add team-telnyx/ai --skill telnyx-voice-advanced-go -a opencode -y
Windsurf
$ npx skills add team-telnyx/ai --skill telnyx-voice-advanced-go -a windsurf -y
name: telnyx-voice-advanced-go description: >- Advanced call control features including DTMF sending, SIPREC recording, noise suppression, client state, and supervisor controls. This skill provides Go SDK examples. metadata: author: telnyx product: voice-advanced language: go generated_by: telnyx-openapi-pipeline
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
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")),
option.WithPublicKey(os.Getenv("TELNYX_PUBLIC_KEY")), // Required for client.Webhooks.Unwrap (webhook verification)
)All examples below assume `client` is already initialized as shown above.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
import "errors"
result, err := client.Messages.Send(ctx, params)
if err != nil {
var apiErr *telnyx.Error
if errors.As(err, &apiErr) {
switch apiErr.StatusCode {
case 422:
fmt.Println("Validation error — check required fields and formats")
case 429:
// Rate limited — wait, then retry the request (bounded exponential backoff)
fmt.Println("Rate limited, retrying...")
default:
fmt.Printf("API error %d: %s\n", apiErr.StatusCode, apiErr.Error())
}
} else {
fmt.Println("Network error — check connectivity and retry")
}
return err // Propagate: a failed request must never look like success to the caller
}Common error codes: `401` invalid API key, `403` insufficient permissions, `404` resource not found, `422` validation error (check field formats), `429` rate limited (retry with exponential backoff).
Add a participant to an existing AI assistant conversation. Use this command to bring an additional call leg into a running AI conversation.
`POST /calls/{call_control_id}/actions/ai_assistant_join` — Required: `conversation_id`, `participant`
Optional: `client_state` (string), `command_id` (string)
response, err := client.Calls.Actions.JoinAIAssistant(
context.Background(),
"call_control_id",
telnyx.CallActionJoinAIAssistantParams{
ConversationID: "v3:abc123",
Participant: telnyx.CallActionJoinAIAssistantParamsParticipant{
ID: "v3:abc123def456",
Role: "user",
},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)Returns: `conversation_id` (uuid), `result` (string)
Updates the client state associated with the call. Client state is an opaque value echoed back in subsequent webhooks for the call, letting you correlate events with your application's state.
`PUT /calls/{call_control_id}/actions/client_state_update` — Required: `client_state`
response, err := client.Calls.Actions.UpdateClientState(
context.Background(),
"call_control_id",
telnyx.CallActionUpdateClientStateParams{
ClientState: "aGF2ZSBhIG5pY2UgZGF5ID1d",
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)Returns: `result` (string)
Start a Conversation Relay session on an active call. Conversation Relay connects the call audio to your WebSocket so your application can exchange realtime messages with the caller while Telnyx handles speech recognition and text-to-speech. Only one AI Assistant or Conversation Relay session can be active on a call at a time.
`POST /calls/{call_control_id}/actions/conversation_relay_start`
Optional: `assistant` (object), `client_state` (string), `command_id` (string), `conversation_relay_dtmf_detection` (boolean), `conversation_relay_settings` (object), `conversation_relay_url` (string), `custom_parameters` (object), `dtmf_detection` (boolean), `greeting` (string), `interruptible` (enum: none, any, speech, dtmf), `interruptible_greeting` (enum: none, any, speech, dtmf), `interruption_settings` (object), `language` (string), `languages` (array[object]), `provider` (string), `structured_provider` (object), `transcription` (object), `transcription_engine` (enum: Google, Telnyx, Deepgram, Azure, xAI, AssemblyAI, Speechmatics, Soniox, A, B), `transcription_engine_config` (object), `tts_provider` (string), `url` (string), `voice` (string), `voice_settings` (object)
response, err := client.Calls.Actions.StartConversationRelay(
context.Background(),
"call_control_id",
telnyx.CallActionStartConversationRelayParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)Returns: `conversation_relay_id` (string), `result` (string)
Stop the active Conversation Relay session on a call.
`POST /calls/{call_control_id}/actions/conversation_relay_stop`
Optional: `client_state` (string), `command_id` (string)
response, err := client.Calls.Actions.StopConversationRelay(
context.Background(),
"call_control_id",
telnyx.CallActionStopConversationRelayParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)Returns: `result` (string)
Collect payment details from the caller using DTMF and either charge or tokenize the payment method through a configured Pay connector. Pay pauses active call recordings while sensitive payment details are collected. When `payment_token` is supplied, the DTMF collection steps are skipped and the existing token is sent to the connector.
`POST /calls/{call_control_id}/actions/pay`
Optional: `amount` (number), `client_state` (string), `command_id` (string), `connector_name` (string), `currency` (enum: USD, usd), `description` (string), `inter_digit_timeout_millis` (int32), `language` (string), `max_attemp
This repo is the one-stop shop for AI Agents and AI-first developers building with Telnyx — everything an agent needs to build production-grade applications and manage its account, from signup to funding.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.