# Add Token Streaming and Interruption Handling to a Twilio Voice Anthropic Integration

DevFeed: [Add Token Streaming and Interruption Handling to a Twilio Voice Anthropic Integration](<https://devfeed.tech/articles/add-token-streaming-and-interruption-handling-to-a-twilio-voice-anthropic-integration-105800.md>)

Original publisher: [Read original article](<https://www.twilio.com/en-us/blog/anthropic-conversationrelay-token-streaming-interruptions-javascript>)

Author: Paul Kamp

Published: 2026-10-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Twilio](<https://devfeed.tech/sources/twilio-blog.md>), [Twilio Blog](<https://devfeed.tech/sources/twilio-blog-2.md>)

Topics: [Conversational AI](<https://devfeed.tech/topics/conversational-ai.md>), [Claude](<https://devfeed.tech/topics/claude.md>), [Real-time AI interactions](<https://devfeed.tech/topics/real-time-ai-interactions.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [twilio api](<https://devfeed.tech/topics/twilio-api.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-assistant](<https://devfeed.tech/tags/ai-assistant.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [claude](<https://devfeed.tech/tags/claude.md>), [conversation-relay](<https://devfeed.tech/tags/conversation-relay.md>), [conversations](<https://devfeed.tech/tags/conversations.md>), [developer-insights](<https://devfeed.tech/tags/developer-insights.md>), [handling](<https://devfeed.tech/tags/handling.md>), [integration](<https://devfeed.tech/tags/integration.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [token](<https://devfeed.tech/tags/token.md>), [twilio](<https://devfeed.tech/tags/twilio.md>), [voice](<https://devfeed.tech/tags/voice.md>)

## AI overview

The tutorial shows how to reduce response latency and handle caller interruptions in a Node.js Twilio ConversationRelay integration with Anthropic Claude. It replaces full-response waiting with Anthropic's `stream()`, forwards arriving text to ConversationRelay with `last: false`, then sends an empty final text message with `last: true`. It accumulates the assistant's complete turn in local session conversation storage. When ConversationRelay sends an `interrupt` message, `handleInterrupt()` uses `utteranceUntilInterrupt` to replace the interrupted turn's content with the portion the caller heard, so that history informs the next request to Claude. The excerpt also lists setup requirements: Node.js, Twilio and Anthropic accounts and credentials, a Twilio phone number, an IDE, ngrok, and a phone for testing.

## Source excerpt

Learn to add token streaming and local interruption management to a Claude - Anthropic's AI assistant - and Twilio Voice ConversationRelay integration using JavaScript.