You must have a publicly accessible OpenAI-compatible chat completions endpoint before proceeding with deployment.
When to use custom LLM providers
Custom LLM providers are ideal for scenarios where you need:- Specific model requirements - Access to proprietary models, fine-tuned models, or the latest releases not yet available through standard providers.
- Data residency and compliance - Ensure your data stays within specific geographic regions or private cloud environments.
- Cost optimization - Leverage enterprise agreements, reserved capacity, or self-hosted infrastructure for better economics at scale.
- Advanced model control - Fine-tune parameters, adjust inference settings, or use specialized configurations for your use case.
FastRouter
FastRouter is an OpenAI-compatible LLM gateway that can route requests to a fixed model or a Virtual Model. A Virtual Model is an alias that represents a model pool and routing strategy configured in FastRouter.Configure FastRouter with the API
First, store the FastRouter API key with the Create Integration Secret API. The secret’sidentifier is referenced by the assistant; the key itself is not included in the assistant configuration.
external_llm object to the Create Assistant API. For a fixed model, set external_llm.model to its provider/model ID:
external_llm.model value—for example, "model": "OMNIMODEL". To change an existing assistant, send the same external_llm object to POST /v2/ai/assistants/{assistant_id} with the Update Assistant API.
Do not set the top-level model or llm_api_key_ref fields for this configuration. Those fields select Telnyx-managed third-party models; FastRouter uses external_llm.model and external_llm.llm_api_key_ref.
Configure FastRouter in the Portal
To configure FastRouter for an AI Assistant:- Create a FastRouter API key.
- Create or edit a Telnyx AI Assistant and open the
Agenttab. - Set
LLM ProvidertoFastRouter. - Under
FastRouter API Key, select or create an Integration Secret containing your FastRouter API key. - Choose a
Routing Mode:Fixed modelis selected by default. Choose a model from the searchable catalog. Fixed model IDs useprovider/modelformat.- Select
Virtual modelto enter the exactVirtual Model Aliasfrom FastRouter, such asOMNIMODEL.
- Select
Validate LLM connection. - Save the assistant.
FastRouter does not include Virtual Model aliases in its Models API. Enter Virtual Model aliases manually. The fixed-model dropdown loads from the Models API after you select an Integration Secret.
Azure
For this guide, we will deploy gpt-4o on Azure AI Foundry. First, create or select a resource.

Agent tab, check Use Custom LLM.
Input the endpoint URL as the Base URL and append /openai/v1 and create a new Integration Secret with your API Key.
You will see a dropdown of all possible Azure models but only ones that you have deployed will validate an LLM connection.

Test Assistant dropdown.
Forward metadata to your custom LLM
By default, Telnyx does not include your assistant’s dynamic variables in requests to a custom LLM endpoint. If your model gateway or application needs those values, enableforward_metadata on the assistant’s external_llm configuration.
forward_metadata is true, Telnyx adds a top-level extra_metadata object to the OpenAI-compatible chat completions request body sent to your custom LLM endpoint when dynamic variables are available. The field defaults to false when omitted.
extra_metadata is separate from OpenAI’s native metadata field, so your endpoint must explicitly read extra_metadata from the request body.
Send custom HTTP headers to your custom LLM
If your model gateway requires additional HTTP headers — for example, an internal accounting or cost-center header — setextra_headers on the assistant’s external_llm configuration. Telnyx sends every entry as an HTTP header on each request to your custom LLM endpoint, in addition to the authentication header.
Use dynamic variables and integration secrets in header values
A header value can be a template. Telnyx fills it in for each conversation, on voice calls and on chat and SMS:{{variable_name}}inserts a dynamic variable, including thetelnyx_current_*system variables and thetelnyx_current_time | date:filter.{{#integration_secret}}identifier{{/integration_secret}}inserts the value of an integration secret. Use this for tokens, so the credential is never stored on the assistant.
{{...}}, never the secret.
How templates are checked:
- When you save the assistant, a template that can never be filled in is rejected with
400: an unclosed or misspelled tag, a Mustache form other than{{variable}}and the secret section, or a secret section with no identifier. Write the secret section exactly as{{#integration_secret}}identifier{{/integration_secret}}, with no spaces. Every integration secret a header names must exist, or the request is rejected with422. - When a variable has no value, or the filled-in value is empty or not a valid header value, the header is left out of that request. Other headers are still sent.
- When an integration secret cannot be read at request time, for example because it was deleted after you saved the assistant, Telnyx does not call your endpoint without it. The request fails instead of reaching your endpoint without the credential the header was configured with.
Header name and value rules
Reserved header names are rejected with400: accept-encoding, authorization, connection, content-encoding, content-length, content-type, cookie, expect, host, keep-alive, proxy-authenticate, proxy-authorization, proxy-connection, set-cookie, te, trailer, transfer-encoding, upgrade, x-host-rewrite, x-request-id, x-trace-id, and any x-telnyx-* or x-stainless-* header. Telnyx or its HTTP client sets those itself. Authentication is configured through llm_api_key_ref or certificate_ref, not through extra_headers, so Authorization cannot be overridden. Names are compared case-insensitively, with _ treated as -, so X_Host_Rewrite counts as x-host-rewrite and the same name cannot appear twice. Names must be valid HTTP header names of at most 128 characters (letters, digits, and !#$%&'*+-.^_`|~). Values must be printable ASCII, at most 4096 characters, with no leading or trailing whitespace.
extra_headers is also accepted on fallback_config.external_llm. When you update the assistant, omitting extra_headers keeps the stored headers; sending an explicit null clears them. When an assistant is cloned into another organization, its extra_headers are not copied.
Baseten
For this guide, we will deploy Llama 3.3 70B on Baseten. First, clickDeploy Now.



Agent tab, check Use Custom LLM.
Input the Baseten Endpoint URL for your deployment as the Base URL and create a new Integration Secret with your Baseten API Key.


Test Assistant dropdown as well as review metrics in your Baseten deployment.
