Create an AI agent
curl -X POST https://api.telnyx.com/v2/ai/assistants \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Support Assistant",
"model": "meta-llama/Meta-Llama-3.1-70B-Instruct",
"instructions": "You are a helpful support assistant."
}'
List text-to-speech voices
curl -L 'https://api.telnyx.com/v2/text-to-speech/voices' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TELNYX_API_KEY'
Chat with a language model
curl -i -X POST \
https://api.telnyx.com/v2/ai/chat/completions \
-H 'Authorization: Bearer YOUR_TELNYX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{
"role": "user",
"content": "Hello, World!"
}
],
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct"
}'
Create a video room
curl -X POST "https://api.telnyx.com/v2/rooms" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-d '{
"unique_name": "My room",
"max_participants": 10,
"enable_recording": false
}'
Send a message
curl -X POST \
https://api.telnyx.com/v2/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-d '{
"from": "+13115552368",
"to": "+13115552367",
"text": "Hello, world!"
}'
Purchase a phone number
curl -i -X POST "https://api.telnyx.com/v2/number_orders" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TELNYX_API_KEY" \
-d '{
"phone_numbers": [
{"phone_number": "+15558675309"}
]
}'
Join our community on Slack
Ask questions, receive updates and connect with other developers in our community.
Join Community


