LiveKit docs › Models › LLM › Additional models › OpenAI-compatible LLMs

---

# OpenAI-compatible LLMs

> Connect to any OpenAI-compatible LLM provider in your voice agents.

## Overview

Many LLM providers expose an API that's compatible with OpenAI's format, which means LiveKit's OpenAI plugin can connect to them without a separate integration. For popular providers, the plugin includes convenience methods that pre-configure the endpoint for you. For any other compatible provider, you can pass a `base_url` directly.

These providers use the Chat Completions API format via `openai.LLM()`. If you're connecting directly to OpenAI's platform, use `openai.responses.LLM()` instead. To learn more, see [OpenAI API modes](https://docs.livekit.io/agents/models/llm/openai.md#api-modes) for details on the Responses API.

## Installation

Install the OpenAI plugin to use any of these providers:

**Python**:

```bash
uv add "livekit-agents[openai]~=1.5"

```

---

**Node.js**:

```bash
pnpm add @livekit/agents-plugin-openai@1.x

```

## Convenience methods

The OpenAI plugin includes wrapper methods for the following providers. Use these when available to handle endpoint configuration automatically:

| Provider | Python | Node.js |
| [Azure](https://docs.livekit.io/agents/models/llm/azure-openai.md) | [`with_azure()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_azure) | [`withAzure()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withAzure) |
| CometAPI | [`with_cometapi()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_cometapi) |  |
| [DeepSeek](https://docs.livekit.io/agents/models/llm/deepseek.md) | [`with_deepseek()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_deepseek) | [`withDeepSeek()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withDeepSeek) |
| [Fireworks](https://docs.livekit.io/agents/models/llm/fireworks.md) | [`with_fireworks()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_fireworks) | [`withFireworks()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withFireworks) |
| [Groq](https://docs.livekit.io/agents/models/llm/groq.md) |  | [`withGroq()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withGroq) |
| [Letta](https://docs.livekit.io/agents/models/llm/letta.md) | [`with_letta()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_letta) |  |
| Meta |  | [`withMeta()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withMeta) |
| Nebius | [`with_nebius()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_nebius) |  |
| [OpenRouter](https://docs.livekit.io/agents/models/llm/openrouter.md) | [`with_openrouter()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_openrouter) |  |
| [OVHCloud](https://docs.livekit.io/agents/models/llm/ovhcloud.md) | [`with_ovhcloud()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_ovhcloud) | [`withOVHcloud()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withOVHcloud) |
| [Perplexity](https://docs.livekit.io/agents/models/llm/perplexity.md) | [`with_perplexity()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_perplexity) | [`withPerplexity()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withPerplexity) |
| Sambanova | [`with_sambanova()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_sambanova) |  |
| [Telnyx](https://docs.livekit.io/agents/models/llm/telnyx.md) | [`with_telnyx()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_telnyx) | [`withTelnyx()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withTelnyx) |
| [Together](https://docs.livekit.io/agents/models/llm/together.md) | [`with_together()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_together) | [`withTogether()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withTogether) |
| [xAI](https://docs.livekit.io/agents/models/llm/xai.md) | [`with_x_ai()`](https://docs.livekit.io/reference/python/livekit/plugins/openai/index.html.md#livekit.plugins.openai.LLM.with_x_ai) | [`withXAI()`](https://docs.livekit.io/reference/agents-js/classes/plugins_agents_plugin_openai.LLM.html.md#withXAI) |

## Using a custom endpoint

For providers that don't have a convenience method, but expose an OpenAI-compatible API, pass their endpoint and API key directly to the `openai.LLM` constructor:

**Python**:

```python
from livekit.plugins import openai

session = AgentSession(
    llm=openai.LLM(
        model="your-model-name",
        base_url="https://your-provider.com/v1",
        api_key="your-api-key",
    ),
    # ... tts, stt, vad, turn_detection, etc.
)

```

---

**Node.js**:

```typescript
import * as openai from '@livekit/agents-plugin-openai';

const session = new voice.AgentSession({
    llm: new openai.LLM({
        model: 'your-model-name',
        baseURL: 'https://your-provider.com/v1',
        apiKey: 'your-api-key',
    }),
    // ... tts, stt, vad, turn_detection, etc.
});

```

---

This document was rendered at 2026-06-07T11:35:51.945Z.
For the latest version of this document, see [https://docs.livekit.io/agents/models/llm/openai-compatible-llms.md](https://docs.livekit.io/agents/models/llm/openai-compatible-llms.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).