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

# Telnyx LLM

[Telnyx Inference](https://telnyx.com/products/inference) exposes hosted language models through an OpenAI-compatible Chat Completions API. The plugin is a thin wrapper over the shared Chat Completions client pointed at `https://api.telnyx.com/v2/ai`, so streaming and tool calling work the same as any other Chat Completions provider.

> [!NOTE]
>
> Vision Agents uses [Stream Video](https://getstream.io/video/) for real-time WebRTC transport by default. [External WebRTC transports](https://visionagents.ai/integrations/introduction-to-integrations.md#edge-transport) are supported as well. Most AI providers offer free tiers to get started.

> [!NOTE]
>
> Get your Telnyx API key from the [Telnyx Mission Control Portal](https://portal.telnyx.com/).

> [!TIP]
>
> Telnyx also provides [speech-to-text](https://visionagents.ai/integrations/stt/telnyx.md), [text-to-speech](https://visionagents.ai/integrations/tts/telnyx.md), and [PSTN telephony](https://visionagents.ai/integrations/telephony/telnyx.md). You can use all four in the same agent.

## Installation

```sh theme={null}
uv add "vision-agents[telnyx]"
```

## Quick start

```python theme={null}
from vision_agents.core import Agent, User
from vision_agents.plugins import getstream, smart_turn, telnyx

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="Assistant", id="agent"),
    instructions="You are a helpful voice assistant.",
    stt=telnyx.STT(),
    llm=telnyx.LLM(),
    tts=telnyx.TTS(),
    turn_detection=smart_turn.TurnDetection(),
)
```

> [!WARNING]
>
> Set `TELNYX_API_KEY` in your environment or pass `api_key` directly.

## Parameters

| Name | Type | Default | Description |
| - | - | - | - |
| `model` | `str` | `"meta-llama/Llama-3.3-70B-Instruct"` | Model id as served by Telnyx Inference |
| `api_key` | `str` | `None` | API key (defaults to `TELNYX_API_KEY` env var) |
| `base_url` | `str` | `"https://api.telnyx.com/v2/ai"` | API base URL |
| `client` | `AsyncOpenAI` | `None` | Pre-configured client (overrides `api_key` and `base_url`) |
| `tools_max_rounds` | `int` | `3` | Maximum calling rounds for multi-hop tool calls |

Model ids come from the Telnyx catalogue at `GET /v2/ai/models` and are not validated locally.

## Function calling

```python theme={null}
@agent.llm.register_function(description="Get weather for a location")
async def get_weather(location: str) -> str:
    return f"The weather in {location} is sunny and 30°C"
```

See the [Function Calling guide](https://visionagents.ai/guides/mcp-tool-calling.md) for details.

## Next steps

> [card] [Telnyx STT](https://visionagents.ai/integrations/stt/telnyx.md)
>
> Streaming speech-to-text

> [card] [Telnyx TTS](https://visionagents.ai/integrations/tts/telnyx.md)
>
> Streaming text-to-speech

> [card] [Telnyx Telephony](https://visionagents.ai/integrations/telephony/telnyx.md)
>
> PSTN calls via Call Control

> [card] [Function Calling](https://visionagents.ai/guides/mcp-tool-calling.md)
>
> Register tools your LLM can invoke


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