For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
WebsiteStatusSupportDashboard
DocumentationAPI ReferenceMCPSDKsCLI (new)What's New?
DocumentationAPI ReferenceMCPSDKsCLI (new)What's New?
  • Get started
    • Introduction
    • Phone calls
    • Web calls
    • Vapi Guides
    • Composer
    • CLI quickstart
  • Assistants
    • Quickstart
    • Tools
    • Custom keywords
    • Custom voices
    • Custom transcriber
    • Custom TTS
  • Observability
    • Boards
  • Squads
    • Quickstart
    • Overview
    • Handoff tool
    • Passing data between assistants
  • Best practices
    • Prompting guide
    • Debugging voice agents
    • Enterprise environments (DEV/UAT/PROD)
    • IVR navigation
  • Phone numbers
    • Free Vapi number
    • Inbound SMS
      • SIP telephony
      • SIP trunking
      • Networking and firewall
        • Twilio
        • Telnyx
        • Zadarma
        • Plivo
        • Amazon Chime SDK
      • Troubleshoot SIP trunk credential errors
    • Phone Number Hooks
  • Calls
    • Call end reasons
    • Troubleshoot call errors
  • Outbound Campaigns
    • Quickstart
    • Overview
  • Chat
    • Quickstart
    • Streaming
    • Non-streaming
    • OpenAI compatibility
    • Session management
    • Variable substitution
    • SMS chat
    • Web widget
    • Webhooks
  • Workflows
    • Quickstart
    • Overview
LogoLogo
WebsiteStatusSupportDashboard
Phone numbersSIP integrationProviders

Telnyx SIP integration

How to integrate SIP Telnyx to Vapi
Was this page helpful?
Edit this page
Previous

Zadarma SIP Integration

How to integrate SIP Zadarma to Vapi
Next
Built with

Integrate your Telnyx SIP trunk with Vapi to enable your AI voice assistants to handle calls efficiently. This guide walks you through the complete setup process for both inbound and outbound calls.

1

Retrieve your Vapi private key

1

Get your private key

  • Log in to your Vapi account
  • Navigate to Organization Settings
  • In the API Keys section, copy your Private Key
2

Configure Telnyx for inbound calls

1

Create a SIP trunk

  • Go to Voice / SIP Trunking / Create
  • Select FQDN
  • Click “Add FQDN”
  • Select A record type
  • Set FQDN to: sip.vapi.ai
  • Port should be 5060 by default
2

Configure inbound settings

  • Navigate to the Inbound tab of your SIP trunk
  • Configure settings as shown:
3

Assign phone number

  • Go to the Numbers tab
  • Assign your acquired phone number to the SIP trunk
4

Configure SIP invite

  • Go to Numbers, edit the number you’ll be using
  • Navigate to Voice settings
  • Scroll down to find “Translated Number”
  • Set this value to match your Vapi SIP URI

You can get your Vapi SIP URI when you create a new SIP number through the Phone Numbers tab in the Vapi dashboard. The URI will look like:


sip:<your-unique-id>@sip.vapi.ai

This setting modifies the SIP Invite so invites are correctly routed to your Vapi SIP URI.

3

Configure Telnyx for outbound calls

1

Set up outbound authentication

  • Go to Voice / SIP Trunking / Authentication and routing
  • Scroll down to “Outbound calls authentication”
  • Create a new credential for Vapi to use
2

Create outbound voice profile

  • Go to Voice / Outbound Voice Profiles
  • Create a new profile
  • Name it appropriately
  • Configure desired destinations
  • Leave default configuration settings
  • Assign your SIP trunk
  • Complete setup Alternatively, go to your SIP trunk / Outbound tab and select your newly created outbound voice profile.
3

Configure outbound settings

  • Choose the country you’ll be making most calls to We recommend creating a separate SIP Trunk for each country you aim to be making most calls to.
4

Add your Telnyx SIP credentials to Vapi

Use the Vapi API to create a SIP trunk credential:

Use IP addresses in gateways. FQDNs like sip.telnyx.com return a 400 Bad Request.

$curl -X POST https://api.vapi.ai/credential \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
> -d '{
> "provider": "byo-sip-trunk",
> "name": "Telnyx Trunk",
> "gateways": [
> {
> "ip": "192.76.120.10",
> "inboundEnabled": true
> },
> {
> "ip": "64.16.250.10",
> "inboundEnabled": true
> }
> ],
> "outboundAuthenticationPlan": {
> "authUsername": "YOUR_SIP_USERNAME",
> "authPassword": "YOUR_SIP_PASSWORD",
> "sipRegisterPlan": {
> "realm": "sip.telnyx.com"
> }
> }
> }'

Replace YOUR_VAPI_PRIVATE_KEY, YOUR_SIP_USERNAME, and YOUR_SIP_PASSWORD with your actual credentials. Replace the gateway IPs with the Telnyx gateway IPs assigned to your trunk. Set inboundEnabled to false if you only need outbound calls. If successful, the response will include an id for the created credential, which you’ll use in the next step.

5

Add your phone number to Vapi

Associate your phone number with the SIP trunk in Vapi:

$curl -X POST https://api.vapi.ai/phone-number \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
> -d '{
> "provider": "byo-phone-number",
> "name": "Telnyx SIP Number",
> "number": "YOUR_PHONE_NUMBER",
> "numberE164CheckEnabled": false,
> "credentialId": "YOUR_CREDENTIAL_ID"
> }'

Replace YOUR_VAPI_PRIVATE_KEY, YOUR_PHONE_NUMBER, and YOUR_CREDENTIAL_ID with your actual details.

6

Assign your voice assistant to handle calls

  • In your Vapi dashboard, go to the Build section and select Phone Numbers
  • Click on your Telnyx Number
  • In the Inbound Settings section, assign your voice assistant to handle incoming calls
  • In the Outbound Form section, assign your voice assistant to handle outgoing calls
7

Make outbound calls

To initiate outbound calls through your Telnyx SIP trunk:

$curl --location 'https://api.vapi.ai/call/phone' \
> --header 'Authorization: Bearer YOUR_VAPI_PRIVATE_KEY' \
> --header 'Content-Type: application/json' \
> --data '{
> "assistantId": "YOUR_ASSISTANT_ID",
> "customer": {
> "number": "CUSTOMER_PHONE_NUMBER",
> "numberE164CheckEnabled": false
> },
> "phoneNumberId": "YOUR_PHONE_ID"
> }'

Replace all placeholder values with your actual information.

By following these steps, your Telnyx SIP trunk will be fully integrated with Vapi, allowing your AI voice assistants to manage calls effectively.