Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manage account balance, payments, invoices, webhooks, and view audit logs and detail records. This skill provides Python SDK examples.
.claude/skills/team-telnyx-telnyx-account-python/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 91% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 117% | 0% |
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
bashpip install telnyx
pythonimport os from telnyx import Telnyx client = Telnyx( api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted )
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:
pythonimport telnyx try: result = client.messages.send(to="+13125550001", from_="+13125550002", text="Hello") except telnyx.APIConnectionError: print("Network error — check connectivity and retry") except telnyx.RateLimitError: # 429: rate limited — wait and retry with exponential backoff import time time.sleep(1) # Check Retry-After header for actual delay except telnyx.APIStatusError as e: print(f"API error {e.status_code}: {e.message}") if e.status_code == 422: print("Validation error — check required fields and formats")
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).
for item in page_result: to iterate through all pages automatically.Retrieve a list of audit log entries. Audit logs are a best-effort, eventually consistent record of significant account-related changes.
GET /audit_events
pythonpage = client.audit_events.list() page = page.data[0] print(page.id)
Returns: alternate_resource_id (string | null), change_made_by (enum: telnyx, account_manager, account_owner, organization_member), change_type (string), changes (array | null), created_at (date-time), id (uuid), organization_id (uuid), record_type (string), resource_id (string), user_id (uuid)
GET /balance
pythonbalance = client.balance.retrieve() print(balance.data)
Returns: available_credit (string), balance (string), credit_limit (string), currency (string), pending (string), record_type (enum: balance)
Retrieve a detailed breakdown of monthly charges for phone numbers in a specified date range. The date range cannot exceed 31 days.
GET /charges_breakdown
pythonfrom datetime import date charges_breakdown = client.charges_breakdown.retrieve( start_date=date.fromisoformat("2025-05-01"), ) print(charges_breakdown.data)
Returns: currency (string), end_date (date), results (arrayobject]), start_date (date), user_email (email), user_id (string)
Retrieve a summary of monthly charges for a specified date range. The date range cannot exceed 31 days.
GET /charges_summary
pythonfrom datetime import date charges_summary = client.charges_summary.retrieve( end_date=date.fromisoformat("2025-06-01"), start_date=date.fromisoformat("2025-05-01"), ) print(charges_summary.data)
Returns: currency (string), end_date (date), start_date (date), summary (object), total (object), user_email (email), user_id (string)
Search for any detail record across the Telnyx Platform
GET /detail_records
pythonpage = client.detail_records.list() page = page.data[0] print(page)
Returns: carrier (string), carrier_fee (string), cld (string), cli (string), completed_at (date-time), cost (string), country_code (string), created_at (date-time), currency (string), delivery_status (string), delivery_status_failover_url (string), delivery_status_webhook_url (string), direction (enum: inbound, outbound), errors (arraystring]), fteu (boolean), mcc (string), message_type (enum: SMS, MMS, RCS), mnc (string), on_net (boolean), parts (integer), profile_id (string), profile_name (string), rate (string), record_type (string), sent_at (date-time), source_country_code (string), status (enum: gw_timeout, delivered, dlr_unconfirmed, dlr_timeout, received, gw_reject, failed), tags (string), updated_at (date-time), user_id (string), uuid (string)
Retrieve a paginated list of invoices.
GET /invoices
pythonpage = client.invoices.list() page = page.data[0] print(page.file_id)
Returns: file_id (uuid), invoice_id (uuid), paid (boolean), period_end (date), period_start (date), url (uri)
Retrieve a single invoice by its unique identifier.
GET /invoices/{id}
pythoninvoice = client.invoices.retrieve( id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) print(invoice.data)
Returns: download_url (uri), file_id (uuid), invoice_id (uuid), paid (boolean), period_end (date), period_start (date), url (uri)
Returns the payment auto recharge preferences.
GET /payment/auto_recharge_prefs
pythonauto_recharge_prefs = client.payment.auto_recharge_prefs.list() print(auto_recharge_prefs.data)
Returns: enabled (boolean), id (string), invoice_enabled (boolean), preference (enum: credit_paypal, ach), recharge_amount (string), record_type (string), threshold_amount (string)
Update payment auto recharge preferences.
PATCH /payment/auto_recharge_prefs
Optional: enabled (boolean), invoice_enabled (boolean), preference (enum: credit_paypal, ach), recharge_amount (string), threshold_amount (string)
pythonauto_recharge_pref = client.payment.auto_recharge_prefs.update() print(auto_recharge_pref.data)
Returns: enabled (boolean), id (string), invoice_enabled (boolean), preference (enum: credit_paypal, ach), recharge_amount (string), record_type (string), threshold_amount (string)
List all user tags.
GET /user_tags
pythonuser_tags = client.user_tags.list() print(user_tags.data)
Returns: number_tags (arraystring]), outbound_profile_tags (arraystring])
POST /v2/payment/stored_payment_transactions — Required: amount
pythonresponse = client.payment.create_stored_payment_transaction( amount="120.00", ) print(response.data)
Returns: amount_cents (integer), amount_currency (string), auto_recharge (boolean), created_at (date-time), id (string), processor_status (string), record_type (enum: transaction), transaction_processing_type (enum: stored_payment)
Lists webhook_deliveries for the authenticated user
GET /webhook_deliveries
pythonpage = client.webhook_deliveries.list() page = page.data[0] print(page.id)
Returns: attempts (arrayobject]), finished_at (date-time), id (uuid), record_type (string), started_at (date-time), status (enum: delivered, failed), user_id (uuid), webhook (object)
Provides webhook_delivery debug data, such as timestamps, delivery status and attempts.
GET /webhook_deliveries/{id}
pythonwebhook_delivery = client.webhook_deliveries.retrieve( "C9C0797E-901D-4349-A33C-C2C8F31A92C2", ) print(webhook_delivery.data)
Returns: attempts (arrayobject]), finished_at (date-time), id (uuid), record_type (string), started_at (date-time), status (enum: delivered, failed), user_id (uuid), webhook (object)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 16,149 | 7,023 | -57% | 1 | 1 | 0% | 3,396 | 3,873 | +14% | 0 | 0 | — |
case-02 | fail→pass | 12,036 | 10,428 | -13% | 1 | 1 | 0% | 2,445 | 4,660 | +91% | 0 | 0 | — |
case-03 | fail→pass | 14,823 | 9,354 | -37% | 1 | 1 | 0% | 2,843 | 4,464 | +57% | 0 | 0 | — |
case-04 | fail→fail | 12,077 | 2,751 | -77% | 1 | 1 | 0% | 2,230 | 2,940 | +32% | 0 | 0 | — |
case-05 | pass→pass | 16,216 | 4,891 | -70% | 1 | 1 | 0% | 3,044 | 3,300 | +8% | 0 | 0 | — |
case-06 | fail→pass | 12,290 | 2,713 | -78% | 1 | 1 | 0% | 2,096 | 2,870 | +37% | 0 | 0 | — |
case-07 | fail→pass | 7,425 | 2,374 | -68% | 1 | 1 | 0% | 1,295 | 2,812 | +117% | 0 | 0 | — |
case-08 | fail→pass | 8,397 | 3,078 | -63% | 1 | 1 | 0% | 1,593 | 2,897 | +82% | 0 | 0 | — |
case-09 | fail→pass | 9,590 | 2,697 | -72% | 1 | 1 | 0% | 1,803 | 2,866 | +59% | 0 | 0 | — |
case-10 | pass→pass | 5,361 | 2,433 | -55% | 1 | 1 | 0% | 947 | 2,770 | +193% | 0 | 0 | — |
case-11 | fail→pass | 7,930 | 3,078 | -61% | 1 | 1 | 0% | 1,501 | 2,961 | +97% | 0 | 0 | — |
case-12 | fail→pass | 5,260 | 1,510 | -71% | 1 | 1 | 0% | 948 | 2,636 | +178% | 0 | 0 | — |
case-13 | fail→pass | 8,560 | 3,196 | -63% | 1 | 1 | 0% | 1,563 | 2,945 | +88% | 0 | 0 | — |
case-14 | fail→pass | 6,477 | 3,262 | -50% | 1 | 1 | 0% | 1,302 | 3,057 | +135% | 0 | 0 | — |
case-15 | fail→pass | 10,158 | 5,211 | -49% | 1 | 1 | 0% | 2,008 | 3,416 | +70% | 0 | 0 | — |
case-16 | fail→pass | 12,302 | 4,004 | -67% | 1 | 1 | 0% | 2,354 | 3,202 | +36% | 0 | 0 | — |
case-17 | fail→fail | 9,732 | 2,819 | -71% | 1 | 1 | 0% | 1,814 | 2,888 | +59% | 0 | 0 | — |
case-18 | pass→pass | 3,524 | 1,505 | -57% | 1 | 1 | 0% | 596 | 2,646 | +344% | 0 | 0 | — |
case-19 | fail→pass | 8,116 | 3,044 | -62% | 1 | 1 | 0% | 1,467 | 2,909 | +98% | 0 | 0 | — |
case-20 | fail→pass | 5,230 | 2,220 | -58% | 1 | 1 | 0% | 946 | 2,754 | +191% | 0 | 0 | — |
case-21 | pass→fail | 19,140 | 16,941 | -11% | 1 | 1 | 0% | 3,540 | 5,776 | +63% | 0 | 0 | — |
case-22 | pass→pass | 9,551 | 5,624 | -41% | 1 | 1 | 0% | 1,910 | 3,575 | +87% | 0 | 0 | — |
case-23 | pass→pass | 11,090 | 5,768 | -48% | 1 | 1 | 0% | 2,297 | 3,531 | +54% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +61 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.