{"id":21495642,"url":"https://github.com/deepgram/deepgram-twilio-streaming-voice-agent","last_synced_at":"2025-07-15T19:31:59.239Z","repository":{"id":248060542,"uuid":"827646445","full_name":"deepgram/deepgram-twilio-streaming-voice-agent","owner":"deepgram","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-09T14:36:00.000Z","size":51,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-10T01:22:32.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepgram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-12T04:57:12.000Z","updated_at":"2024-08-09T14:35:59.000Z","dependencies_parsed_at":"2024-08-09T01:19:37.032Z","dependency_job_id":"977d219c-ceab-4b39-9838-e28cae869e13","html_url":"https://github.com/deepgram/deepgram-twilio-streaming-voice-agent","commit_stats":null,"previous_names":["damiendeepgram/deepgram-streaming-voice-agent","damiendeepgram/deepgram-twilio-streaming-voice-agent","deepgram/deepgram-twilio-streaming-voice-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdeepgram-twilio-streaming-voice-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdeepgram-twilio-streaming-voice-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdeepgram-twilio-streaming-voice-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepgram%2Fdeepgram-twilio-streaming-voice-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepgram","download_url":"https://codeload.github.com/deepgram/deepgram-twilio-streaming-voice-agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226064537,"owners_count":17568036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T16:12:39.217Z","updated_at":"2024-11-23T16:12:39.797Z","avatar_url":"https://github.com/deepgram.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Callable Deepgram \u003c\u003e Twilio Streaming Voice Agent\n\nThis is a basic server application that show cases end to end streaming voice agent\n\n* Callable Phone Number\n* Streaming Twilio - Inbound Audio\n* Streaming Deepgram - Speech to Text\n* Streaming OpenAI - LLM\n* Streaming Deepgram - Text to Speech\n* Streaming Twilio - Outbound Audio\n\nIt's a good starting point to develop your own application logic.\n\n## App sever setup\n\n\n### Set environment variables\n\n You will need to set environment variables for your shell session. These environment variables are used to store the API keys required for authentication when accessing the OpenAI and Deepgram APIs.\n\n Open a Terminal and run:\n\n```sh\nexport OPENAI_API_KEY=xxx\nexport DEEPGRAM_API_KEY=xxx\n```\n\nTo verify the environment variables are set, run the following commands in your Terminal:\n\n```sh\necho $OPENAI_API_KEY\necho $DEEPGRAM_API_KEY\n```\n\n### Installation\n\n**Requires Node \u003e= v12.1.0**\n\nRun `npm install`\n\nnpm dependencies (contained in the `package.json`):\n* httpdispatcher\n* websocket\n\n#### Running the server\n\nStart with `npm run start`\n\n## Demo Setup\n\n### Configure the environment using the Ngrok UI \u0026 CLI\n\n1. Install ngrok:\n- If on MacOS: `brew install ngrok/ngrok/ngrok`\n- If on Windows/Linux: Follow the [instructions on ngrok's site](https://ngrok.com/docs/getting-started/)\n\n2. Sign up for a ngrok account:\n- If you haven't already, sign up for an [ngrok account](https://dashboard.ngrok.com/get-started/setup/macos)\n- Copy your ngrok authtoken from your [ngrok dashboard](https://dashboard.ngrok.com/get-started/your-authtoken)\n- Run the following command in your terminal to install the auth token and connect the ngrok agent to your account.\n\n```sh\nngrok config add-authtoken \u003cTOKEN\u003e\n```\n\n### Twilio Phone Number Setup\n\n- You will need to provide a valid phone number from Twilio. Please see these [instructions](https://help.twilio.com/articles/223135247-How-to-Search-for-and-Buy-a-Twilio-Phone-Number-from-Console) to do so.\n\n### Configure with the Twilio CLI\n\n\u003e Refer to this [Repository](https://github.com/twilio/media-streams/tree/master/node/connect-basic) for more information on this section.\n\n1. Install the [Twilio CLI](https://www.twilio.com/docs/twilio-cli/quickstart) and login to Twilio to run these commands.\n\n2. Find an available phone number\n\n```sh\ntwilio api:core:available-phone-numbers:local:list --country-code=\"US\" --voice-enabled --properties=\"phoneNumber\"`\n```\n\n3. Purchase the phone number (where `+123456789` is a number you found)\n\n```sh\ntwilio api:core:incoming-phone-numbers:create --phone-number=\"+123456789\"`\n```\n\n### Set the webhook url to your ngrok url\n\n4. Start ngrok\n\nOn a separate terminal (not the one where you have run `npm run start`):\n\n```sh\nngrok http 8080\n```\n\u003e If you restart your ngrok server your `ngrok url` will change.\n\nYou will see a url under the `Forwarding`row that --\u003e to your localhost. Copy this as the `\u003cngrok url\u003e`\n\n5. Edit the [templates/streams](templates/streams.xml) file to replace `\u003cngrok url\u003e` with your ngrok host. Example: `wss://abcdef.ngrok.io/streams`. Remember to use `wss://` and include `/streams` in the url \n\n6. Go to your Twilio page where you manage your phone number. Under the Configure tab, replace the webhook URL where the call comes in to your ngrok url. Example: `https://abcdef.ngrok-free.app/twiml` . Remember to use `https://` and include `/twiml`\n\n### Call the number and chat to your bot.\n\n7. You can call your Twilio phone number directly. Alternatively, make the call with the following, where `+123456789` is the Twilio number you bought and `+19876543210` is your phone number and `abcdef.ngrok.io` is your ngrok host.\n\n```sh\ntwilio api:core:calls:create --from=\"+123456789\" --to=\"+19876543210\" --url=\"https://abcdef.ngrok.io/twiml\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Fdeepgram-twilio-streaming-voice-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepgram%2Fdeepgram-twilio-streaming-voice-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepgram%2Fdeepgram-twilio-streaming-voice-agent/lists"}