> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threetone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio with a custom model

> Review the separate model, speech, and telephony contracts required for a future Twilio deployment with a custom language model.

A custom language-model endpoint answers model requests. It does not receive telephone audio or supply a Twilio media bridge.

<Note>
  Threetone supports a dashboard connection probe for a custom model candidate. Custom-model publication is currently rejected, and Twilio calling has separate runtime requirements. A successful model probe does not release either path.
</Note>

## Prepare the integration design

Collect the model base URL and model ID, credential reference, desired phone route, and an owner for each service. Use [custom models](/agents-platform/advanced/custom-models/overview) for the supported probe and draft workflow.

<Steps>
  <Step title="Check the model contract">Review [endpoint compatibility](/agents-platform/advanced/custom-models/compatible-endpoints), including streaming responses and tool behavior. Record probe failures separately from any telephony findings.</Step>
  <Step title="Choose the media boundary">Decide whether the future runtime will receive SIP media or implement a provider-specific streaming bridge. Do not point a Twilio stream at a Chat Completions endpoint.</Step>
  <Step title="Specify the conversation lifecycle">Document how the bridge will handle audio conversion, transcription, synthesized speech, interruptions, silence, and caller hangup. Define the result when the model times out or the media connection closes.</Step>
  <Step title="Keep release checks independent">Require an executable custom-model version, supported credential delivery, a released media adapter, and the phone route's acceptance evidence before moving traffic.</Step>
</Steps>

Twilio distinguishes receive-only Media Streams from bidirectional streams. The latter uses `Connect` with `Stream` and blocks subsequent TwiML until the connection disconnects. Those provider capabilities do not establish a Threetone WebSocket endpoint. See [Twilio Media Streams](https://www.twilio.com/docs/voice/media-streams).

## Failure handling

Plan a bounded model timeout and a caller-facing fallback. Keep provider call IDs, model request IDs, and your application correlation ID separate so a model error is not misreported as a carrier failure. Do not retain audio or transcripts without a reviewed purpose and retention policy.

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Can I publish after the connection probe succeeds?" id="twilio-custom-model-faq-publish">No. Current publication rejects custom model execution. Preserve the reviewed candidate as a draft.</Accordion>
  <Accordion title="Can a receive-only stream speak back to the caller?" id="twilio-custom-model-faq-stream">No. Twilio's unidirectional stream cannot play application audio back. A supported bidirectional integration would need a separate media implementation.</Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.