> ## 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.

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

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

<Tip>
  Telnyx also provides [speech-to-text](/integrations/stt/telnyx), [text-to-speech](/integrations/tts/telnyx), and [PSTN telephony](/integrations/telephony/telnyx). You can use all four in the same agent.
</Tip>

## 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.
</Warning>

## 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](/guides/mcp-tool-calling) for details.

## Next steps

<CardGroup cols={2}>
  <Card title="Telnyx STT" icon="microphone" href="/integrations/stt/telnyx">
    Streaming speech-to-text
  </Card>

  <Card title="Telnyx TTS" icon="volume-high" href="/integrations/tts/telnyx">
    Streaming text-to-speech
  </Card>

  <Card title="Telnyx Telephony" icon="phone" href="/integrations/telephony/telnyx">
    PSTN calls via Call Control
  </Card>

  <Card title="Function Calling" icon="wrench" href="/guides/mcp-tool-calling">
    Register tools your LLM can invoke
  </Card>
</CardGroup>
