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

# OpenAI LLM

[OpenAI](https://openai.com) provides industry-leading language models. The plugin supports the **Responses API** (for GPT-5+) and **ChatCompletionsLLM** (any OpenAI-compatible API). Requires separate STT/TTS.

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

<Tip>
  OpenAI also provides [Realtime speech-to-speech](/integrations/realtime/openai) and [text-to-speech](/integrations/tts/openai).
</Tip>

## Installation

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

## LLM (Responses API)

Uses the Responses API (default for GPT-5+).

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

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="Assistant", id="agent"),
    instructions="You are a helpful assistant.",
    llm=openai.LLM(model="gpt-5.4"),
    stt=deepgram.STT(),
    tts=openai.TTS(),
)
```

| Name | Type | Default | Description |
| - | - | - | - |
| `model` | `str` | `"gpt-5.4"` | Model (e.g., `"gpt-5.4"`) |
| `api_key` | `str` | `None` | API key (defaults to `OPENAI_API_KEY` env var) |
| `base_url` | `str` | `None` | Custom API endpoint |
| `max_tool_rounds` | `int` | `3` | Maximum tool-call rounds per response |

## ChatCompletionsLLM

Works with any OpenAI-compatible API (Together AI, Fireworks, DeepSeek, etc.).

```python theme={null}
from vision_agents.plugins import openai

llm = openai.ChatCompletionsLLM(
    model="deepseek-chat",
    base_url="https://api.deepseek.com",
    api_key="your_api_key"
)
```

| Name | Type | Default | Description |
| - | - | - | - |
| `model` | `str` | -- | Model identifier |
| `api_key` | `str` | `None` | API key (defaults to `OPENAI_API_KEY` env var) |
| `base_url` | `str` | `None` | Custom API endpoint |
| `tools_max_rounds` | `int` | `3` | Maximum tool-call rounds per response |

## Function Calling

```python theme={null}
@agent.llm.register_function(description="Get weather for a location")
async def get_weather(location: str) -> dict:
    return {"temperature": "72°F", "condition": "Sunny"}
```

See the [Function Calling guide](/guides/mcp-tool-calling) for details.

## Events

The OpenAI plugin no longer documents provider-specific event classes for normal app code. Prefer core events and provider-agnostic response handling.

## Next Steps

<CardGroup cols={2}>
  <Card title="OpenAI Realtime" icon="bolt" href="/integrations/realtime/openai">
    Speech-to-speech over WebRTC
  </Card>

  <Card title="OpenAI TTS" icon="volume-high" href="/integrations/tts/openai">
    Text-to-speech synthesis
  </Card>
</CardGroup>


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