Prerequisites
- Go 1.22+ installed
- A Telnyx account
- A Telnyx API key
Step 1: Install the CLI
Step 2: Configure Authentication
Set your API key as an environment variable. You can get your API key from the Telnyx Portal.Verify Authentication
Test that your credentials are working:Step 3: Run Your First Commands
Check Your Balance
List Your Phone Numbers
Search for Available Numbers
Send a Test Message
You’ll need a messaging-enabled phone number and a configured messaging profile.
Step 4: Explore Commands
Get Help
Common Commands
| Command | Description |
|---|---|
telnyx phone-numbers list | List your phone numbers |
telnyx available-phone-numbers list | Search available numbers |
telnyx number-orders create | Purchase phone numbers |
telnyx messages send | Send an SMS/MMS message |
telnyx calls dial | Initiate an outbound call |
telnyx balance retrieve | Check account balance |
telnyx messaging-10dlc:brand list | List 10DLC brands |
telnyx messaging-10dlc:campaign list | List 10DLC campaigns |
telnyx ai:chat create-completion | Chat with AI models |
telnyx ai:assistants list | List AI assistants |
Output Formats
The CLI supports multiple output formats:Debug Mode
To see full HTTP request/response details:Next Steps
Authentication
Learn about authentication options
General Usage
Output formats, scripting, and CI/CD integration