telnyx-ai-assistants-c…
AI voice assistants with custom instructions, knowledge bases, and tool integrations.
Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides Go SDK examples.
Claude Code
$ npx -y skills add team-telnyx/ai --skill telnyx-account-reports-go --agent claude-code
Codex
$ npx skills add team-telnyx/ai --skill telnyx-account-reports-go -a codex -y
Cursor
$ npx skills add team-telnyx/ai --skill telnyx-account-reports-go -a cursor -y
Gemini CLI
$ npx skills add team-telnyx/ai --skill telnyx-account-reports-go -a gemini-cli -y
GitHub Copilot
$ npx skills add team-telnyx/ai --skill telnyx-account-reports-go -a github-copilot -y
OpenCode
$ npx skills add team-telnyx/ai --skill telnyx-account-reports-go -a opencode -y
Windsurf
$ npx skills add team-telnyx/ai --skill telnyx-account-reports-go -a windsurf -y
name: telnyx-account-reports-go description: >- Generate and retrieve usage reports for billing, analytics, and reconciliation. This skill provides Go SDK examples. metadata: author: telnyx product: account-reports 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).
Filters call events by given filter parameters. Events are ordered by `occurred_at`. If filter for `leg_id` or `application_session_id` is not present, it only filters events from the last 24 hours.
`GET /call_events`
page, err := client.CallEvents.List(context.Background(), telnyx.CallEventListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: `call_leg_id` (string), `call_session_id` (string), `event_timestamp` (string), `metadata` (object), `name` (string), `record_type` (enum: call_event), `type` (enum: command, webhook)
Create a ledger billing group report, which aggregates ledger activity by billing group.
`POST /ledger_billing_group_reports`
Optional: `month` (integer), `year` (integer)
ledgerBillingGroupReport, err := client.LedgerBillingGroupReports.New(context.Background(), telnyx.LedgerBillingGroupReportNewParams{
Month: telnyx.Int(10),
Year: telnyx.Int(2019),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", ledgerBillingGroupReport.Data)Returns: `created_at` (date-time), `id` (uuid), `organization_id` (uuid), `record_type` (enum: ledger_billing_group_report), `report_url` (uri), `status` (enum: pending, complete, failed, deleted), `updated_at` (date-time)
Retrieve the details and status of a previously created ledger billing group report.
`GET /ledger_billing_group_reports/{id}`
ledgerBillingGroupReport, err := client.LedgerBillingGroupReports.Get(context.Background(), "f5586561-8ff0-4291-a0ac-84fe544797bd")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", ledgerBillingGroupReport.Data)Returns: `created_at` (date-time), `id` (uuid), `organization_id` (uuid), `record_type` (enum: ledger_billing_group_report), `report_url` (uri), `status` (enum: pending, complete, failed, deleted), `updated_at` (date-time)
Retrieves all MDR detailed report requests for the authenticated user
`GET /legacy/reporting/batch_detail_records/messaging`
messagings, err := client.Legacy.Reporting.BatchDetailRecords.Messaging.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", messagings.Data)Returns: `connections` (array[integer]), `created_at` (date-time), `directions` (array[string]), `end_date` (date-time), `filters` (array[object]), `id` (uuid), `profiles` (array[string]), `record_type` (string), `record_types` (array[string]), `report_name` (string), `report_url` (string), `start_date` (date-time), `status` (enum: PENDING, COMPLETE, FAILED, EXPIRED), `updated_at` (date-time)
Creates a new MDR detailed report request with the specified filters
`POST /legacy/reporting/batch_detail_records/messaging` — Required: `start_time`, `end_time`
Optional: `connections` (array[integer]), `directions` (array[integer]), `filters` (array[object]), `include_message_body` (boolean), `managed_accounts` (array[string]), `profiles` (array[string]), `record_types` (array[integer]), `report_name` (string), `select_all_managed_accounts` (boolean), `timezone` (string)
messaging, err := client.Legacy.Reporting.BatchDetailRecords.Messaging.New(context.Background(), telnyx.LegacyReportingBatchDetailRecordMessagingNewParams{
EndTime: time.Now(),
StartTime: time.Now(),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", messaging.Data)Returns: `connections` (array[integer]), `created_at` (date-time), `directions` (array[string]), `end_date` (date-time), `filters` (array[object]), `id` (uuid), `profiles` (array[string]), `record_type` (string), `record_types` (array[string]), `report_name` (string), `report_url` (string), `start_date` (date-time), `status` (enum: PENDING, COMPLETE, FAILED, EX
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.