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

# LiveKit

> LiveKit AgentsでPhaseoのモデルを使います。

LiveKit AgentsはOpenAIプラグイン経由で、OpenAI互換のチャットエンドポイントを呼び出せます。プラグインをPhaseoに向けると、PhaseoのモデルIDとルーティングを使えます。

## Python

```bash theme={null}
uv add "livekit-agents[openai]"
```

```python theme={null}
import os
from livekit.agents import AgentSession
from livekit.plugins import openai

session = AgentSession(
    llm=openai.LLM(
        model="openai/gpt-5-nano",
        api_key=os.environ["PHASEO_API_KEY"],
        base_url="https://api.phaseo.app/v1",
    ),
)
```

## Node.js

```bash theme={null}
pnpm add @livekit/agents @livekit/agents-plugin-openai
```

```ts theme={null}
import { voice } from "@livekit/agents";
import * as openai from "@livekit/agents-plugin-openai";

const session = new voice.AgentSession({
	llm: new openai.LLM({
		model: "openai/gpt-5-nano",
		apiKey: process.env.PHASEO_API_KEY,
		baseURL: "https://api.phaseo.app/v1",
	}),
});
```

## 注意事項

* カスタムエンドポイントにはOpenAI互換のChat Completionsモードを使います。
* LiveKitのResponses専用OpenAIツールが、自動的にPhaseoサーバーツールになるわけではありません。
* 選択したLiveKitインターフェースがそのモダリティ向けのOpenAI互換カスタムURLに対応していない限り、音声認識と音声合成は別々に設定します。
* 音声の本番トラフィックを流す前に、中断処理、ツール呼び出し、ストリーミング遅延をテストします。

## 関連項目

* [OpenAI SDK](./openai-sdk.mdx)
* [ストリーミング](../streaming.mdx)
* [ツール呼び出し](../tool-calling.mdx)


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