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

# Python SDKのインストール

> Phaseo Python SDKのインストールと設定方法です。

SDKはPyPIで[`phaseo`](https://pypi.org/project/phaseo/)として公開されています。

## インストール

好みのPythonパッケージマネージャーを使ってSDKをインストールします。

<CodeGroup>
  ```bash title="pip" theme={null}
  pip install phaseo
  ```

  ```bash title="uv" theme={null}
  uv add phaseo
  ```
</CodeGroup>

## 必要条件

* Python 3.10+

## セットアップ

### APIキー

[Phaseoダッシュボード](https://phaseo.app/gateway/keys)でAPIキーを作成します。

### 環境変数

```bash theme={null}
export PHASEO_API_KEY="phaseo_v1_sk_<kid>_<secret>"
```

### 基本的な使い方

```python theme={null}
from phaseo import Phaseo
import os

client = Phaseo(api_key=os.environ["PHASEO_API_KEY"])

response = client.generate_text(
    {
        "model": "openai/gpt-5-nano",
        "messages": [{"role": "user", "content": "Hello!"}],
    }
)

print(response["choices"][0]["message"]["content"])
```

### クライアントの任意設定

```python theme={null}
from phaseo import Phaseo

client = Phaseo(
    api_key="your-api-key",
    base_url="https://api.phaseo.app/v1",
    timeout=30.0,
)
```

## 次のステップ

* [使い方ガイド](./usage.mdx)を確認する
* [APIリファレンス](../../api-reference/introduction.mdx)を見る


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