当前位置: 首页 > Skill >

Telnyx Toolkit

Telnyx Toolkit

Telnyx Toolkit

完整Telnyx工具包,含即用型工具(语音转文本、文本转语音、检索增强生成、网络、10DLC)及JavaScript、Python、Go、Java、Ruby的SDK文档。

1.5.0 2026.11.26 847
获取Skill文件查看使用说明
作 者:苏禾 许可证: 更新时间:2026.11.26
本文目录展开

Telnyx Toolkit

The complete toolkit for building with Telnyx. Includes ready-to-use tools and SDK documentation for all Telnyx APIs.

Quick Start

export TELNYX_API_KEY="your_key_here"

🚀 Getting Started

Two companion skills handle account lifecycle. They are included with the toolkit and can also be installed independently via ClawHub.

Skill Purpose Path Install standalone
Telnyx Bot Signup Create a new account or sign into an existing one (PoW challenge → email → API key) {baseDir}/getting-started/telnyx-bot-signup/ clawhub install telnyx-bot-signup
Telnyx Freemium Upgrade Upgrade freemium → professional via GitHub or LinkedIn identity verification {baseDir}/getting-started/telnyx-freemium-upgrade/ clawhub install telnyx-freemium-upgrade

When to Use Account Signup

Hand off to telnyx-bot-signup when ANY of these are true:

  • No API key exists (TELNYX_API_KEY not set, ~/.config/telnyx/config.json missing)
  • API key is invalid/expired (401 errors from Telnyx API)
  • User wants to create a new Telnyx account
  • API key needs to be refreshed after an upgrade (same email, new key)

Note: The bot_signup endpoint handles both new and existing accounts transparently — just provide the user's email.

When to Use Account Upgrade

Hand off to telnyx-freemium-upgrade when ANY of these are true:

Trigger Detection
Error 10039 SMS send fails: "destination not verified"
Error D60 Voice call fails: "destination not verified"
Error 10038 Feature blocked: "not available on current plan"
Number limit hit Second phone number purchase fails
Cannot add funds Freemium account cannot add payment method or top up
Explicit request User says "upgrade my account"

Before handing off, check ~/.telnyx/upgrade.json — if decision is APPROVED, the account is already upgraded (retry the operation instead). If PASS_TO_HUMAN, it's under review (don't retry). See the telnyx-freemium-upgrade SKILL.md for full decision tree.

Each skill has its own SKILL.md with complete instructions. Read the skill's SKILL.md before executing its workflow.

💳 Balance & Payments

Use these endpoints to check balance and add funds programmatically.

Important: Top-ups charge the payment method (credit card, PayPal, or ACH) saved in the Telnyx Portal. There is no API to add a payment method — this is done by the user in the portal. Do not prompt the user about this upfront — just attempt the top-up when needed. If it returns 403, that's when you inform the user they need to add a payment method in the portal.

Check Balance

curl -s https://api.telnyx.com/v2/balance -H "Authorization: Bearer $TELNYX_API_KEY"

Response:

{
  "data": {
    "balance": "300.00",
    "credit_limit": "100.00",
    "available_credit": "400.00",
    "currency": "USD"
  }
}

Check Auto-Recharge Status

Check whether auto-recharge is enabled. If it is, the account will top up automatically when balance drops below the threshold — the agent can just wait and retry instead of manually topping up.

curl -s https://api.telnyx.com/v2/payment/auto_recharge_prefs -H "Authorization: Bearer $TELNYX_API_KEY"

Response:

{
  "data": {
    "enabled": true,
    "threshold_amount": "100.00",
    "recharge_amount": "100.00",
    "preference": "credit_paypal"
  }
}

If enabled is true and the agent hits 20100, wait briefly and retry — auto-recharge should handle it. If enabled is false, proceed with the top-up endpoint below.

Note: Enabling or configuring auto-recharge is a human decision — use the Telnyx Portal to change these settings.

Add Funds (Top Up)

Charges the stored payment method on file. Requires a payment method already configured in the Telnyx Portal.

curl -s -X POST https://api.telnyx.com/v2/payment/stored_payment_transactions -H "Authorization: Bearer $TELNYX_API_KEY" -H "Content-Type: application/json" -d '{"amount": "100.00"}'

The amount field is in dollars and cents (e.g., "100.00", "25.50").

Response:

{
  "data": {
    "id": "de06811a-2e43-4561-af5a-7d0a26e20aaa",
    "record_type": "transaction",
    "amount_cents": 10000,
    "processor_status": "submitted_for_settlement",
    "amount_currency": "USD",
    "created_at": "2026-02-25T10:00:00Z",
    "auto_recharge": false
  }
}

Error handling:

Status Meaning Action
200 Transaction submitted Wait for settlement, then retry the original operation
401 Unauthorized API key is invalid — hand off to telnyx-bot-signup
403 Forbidden No stored payment method on file — direct user to Telnyx Portal to add one
422 Invalid amount Amount must be a string with dollars and cents (e.g., "120.00")

Payment Error Decision Tree

When a Telnyx API call fails with a payment-related error, follow this tree. The agent does not need to know the account tier upfront — the error codes and response codes reveal the right path.

Step 1: Identify the error

Error Code Meaning Go to
10038 / 10039 Feature not permitted / limited Step 2 (upgrade)
20100 / 20012 Insufficient Funds / Account inactive Step 3 (try top-up)

Note: The API may return 20100 (Insufficient Funds) even on freemium accounts where 10038/10039 would be more accurate. Don't assume 20100 means the account is professional — always attempt the top-up and let the response tell you.

Step 2: Feature restriction → Upgrade first

Errors 10038/10039 mean the account is freemium. Freemium accounts cannot add payment methods or top up — they must upgrade first.

  1. Hand off to telnyx-freemium-upgrade → upgrade to professional
  2. User adds payment method at Telnyx Portal
  3. Then proceed to Step 3 if funds are needed

Step 3: Insufficient funds → Try to top up

Always attempt the top-up regardless of account tier — the response will reveal the right path.

  1. GET /v2/balance — check current available credit
  2. GET /v2/payment/auto_recharge_prefs — if enabled: true, wait briefly and retry (auto-recharge will handle it). If it does, stop here
  3. If auto-recharge is off: POST /v2/payment/stored_payment_transactions — top up via API
  4. If top-up returns 200 → retry the original operation
  5. If top-up returns 403 → no payment method on file. This is the real signal:
    • Check ~/.telnyx/upgrade.json — if decision is APPROVED, the account is professional but has no payment method → direct user to Telnyx Portal to add one
    • Otherwise, the account is likely freemium → hand off to telnyx-freemium-upgrade (Step 2)

🔧 Tools (Ready-to-Use)

These are standalone utilities with scripts you can run directly:

Tool Description Path
Missions AI agent task tracking, voice/SMS assistants, scheduled calls {baseDir}/tools/missions/
STT Speech-to-text transcription (Whisper) {baseDir}/tools/stt/
TTS Text-to-speech synthesis {baseDir}/tools/tts/
CLI Telnyx CLI wrapper and helpers {baseDir}/tools/cli/
Network WireGuard mesh networking, public IP exposure {baseDir}/tools/network/
RAG Semantic search with Telnyx Storage + embeddings {baseDir}/tools/rag/
10DLC Registration Interactive wizard for A2P messaging registration {baseDir}/tools/10dlc-registration/
Storage Backup Backup/restore workspace to Telnyx Storage {baseDir}/tools/storage-backup/
Voice SIP SIP-based voice call control {baseDir}/tools/voice-sip/
Embeddings Semantic search & text embeddings (Telnyx-native) {baseDir}/tools/embeddings/

Tool Usage Examples

# Create a mission and schedule calls
python3 {baseDir}/tools/missions/scripts/telnyx_api.py init "Find contractors" "Call contractors and get quotes" "User request" '[{"step_id": "calls", "description": "Make calls", "sequence": 1}]'

# Transcribe audio
python3 {baseDir}/tools/stt/scripts/telnyx-stt.py /path/to/audio.mp3

# Generate speech  
python3 {baseDir}/tools/tts/scripts/telnyx-tts.py "Hello world" -o output.mp3

# Join mesh network
{baseDir}/tools/network/join.sh

# Index files for RAG
python3 {baseDir}/tools/rag/sync.py

# 10DLC registration wizard
{baseDir}/tools/10dlc-registration/setup.sh

# Semantic search
python3 {baseDir}/tools/embeddings/search.py "your query" --bucket your-bucket

# Index a file for search
python3 {baseDir}/tools/embeddings/index.py upload /path/to/file.md

Each tool has its own SKILL.md with detailed usage instructions.

📚 API Documentation (SDK Reference)

SDK documentation for all Telnyx APIs, organized by language:

Language Path Skills
JavaScript {baseDir}/api/javascript/ 35
Python {baseDir}/api/python/ 35
Go {baseDir}/api/go/ 35
Java {baseDir}/api/java/ 35
Ruby {baseDir}/api/ruby/ 35

API Categories

Each language includes documentation for:

  • Voice — Calls, call control, conferencing, streaming, gather
  • Messaging — SMS, MMS, profiles, hosted messaging
  • Numbers — Search, purchase, configure, compliance
  • AI — Inference, assistants, embeddings
  • Storage — Object storage (S3-compatible)
  • SIP — Trunking, connections, integrations
  • Video — Video rooms and conferencing
  • Fax — Programmable fax
  • IoT — SIM management, wireless
  • Verify — Phone verification, 2FA
  • Account — Management, billing, reports
  • Porting — Port numbers in/out
  • 10DLC — A2P messaging registration
  • TeXML — TeXML applications
  • Networking — Private networks, SETI
  • WebRTC — Server-side WebRTC

Finding API Docs

{baseDir}/api/{language}/telnyx-{capability}-{language}/SKILL.md

Example: {baseDir}/api/python/telnyx-voice-python/SKILL.md

📱 WebRTC Client SDKs

Guides for building real-time voice apps on mobile and web:

Platform Path
iOS {baseDir}/webrtc-clients/ios/
Android {baseDir}/webrtc-clients/android/
Flutter {baseDir}/webrtc-clients/flutter/
JavaScript (Web) {baseDir}/webrtc-clients/javascript/
React Native {baseDir}/webrtc-clients/react-native/

Structure

telnyx-toolkit/
├── SKILL.md              # This file (index)
├── getting-started/      # Account creation & upgrade
│   ├── telnyx-bot-signup/
│   └── telnyx-freemium-upgrade/
├── tools/                # Ready-to-use utilities
│   ├── missions/         # AI agent task tracking
│   ├── stt/
│   ├── tts/
│   ├── cli/
│   ├── network/
│   ├── rag/
│   ├── 10dlc-registration/
│   ├── storage-backup/
│   ├── voice-sip/
│   └── embeddings/
├── api/                  # SDK documentation
│   ├── javascript/       # 35 skills
│   ├── python/           # 35 skills
│   ├── go/               # 35 skills
│   ├── java/             # 35 skills
│   └── ruby/             # 35 skills
└── webrtc-clients/       # Mobile/Web SDK guides
    ├── ios/
    ├── android/
    ├── flutter/
    ├── javascript/
    └── react-native/

Resources

  • Telnyx API Docs
  • Telnyx Portal
  • API Reference

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
Skill 文件
  • SKILL.md
    • Telnyx Toolkit
    • Quick Start
    • 🚀 Getting Started
      • When to Use Account Signup
      • When to Use Account Upgrade
    • 💳 Balance & Payments
      • Check Balance
      • Check Auto-Recharge Status
      • Add Funds (Top Up)
      • Payment Error Decision Tree
    • 🔧 Tools (Ready-to-Use)
      • Tool Usage Examples
    • 📚 API Documentation (SDK Reference)
      • API Categories
      • Finding API Docs
    • 📱 WebRTC Client SDKs
    • Structure
    • Resources
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期