> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-dependabot-github-actions-actions-cache-6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# モデルを一覧表示

> models エンドポイントを使用して、利用可能な Serverless Inference のモデルとその ID の一覧を取得します。

このページでは、Serverless Inference API で利用可能なすべてのモデルとその ID を取得する方法を説明します。利用可能なモデルをプログラムから確認したり、実行時にモデルを動的に選択したり、アカウントでアクセスできるモデルを確認したりするには、このエンドポイントを使用します。

<div id="request-examples">
  ## リクエスト例
</div>

以下の例では、Python とコマンドラインから models エンドポイントを呼び出す方法を示します。

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import openai

    client = openai.OpenAI(
        base_url="https://api.inference.wandb.ai/v1",
        api_key="[YOUR-API-KEY]",
        project="[YOUR-TEAM]/[YOUR-PROJECT]"  # 省略可能。使用状況のトラッキング用
    )

    response = client.models.list()

    for model in response.data:
        print(model.id)
    ```
  </Tab>

  <Tab title="Bash">
    ```bash theme={null}
    curl https://api.inference.wandb.ai/v1/models \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer [YOUR-API-KEY]" \
      -H "OpenAI-Project: [YOUR-TEAM]/[YOUR-PROJECT]"
    ```
  </Tab>
</Tabs>

<div id="response-format">
  ## 応答形式
</div>

このエンドポイントは、OpenAI 互換形式のモデル オブジェクトのリストを返すため、標準的な OpenAI クライアント ライブラリを使用して応答を解析できます。各エントリには、他の Inference API エンドポイントに渡すモデル ID が含まれます。

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "id": "deepseek-ai/DeepSeek-V3.1",
      "object": "model",
      "created": 0,
      "owned_by": "system",
      "root": "deepseek-ai/DeepSeek-V3.1"
    },
    {
      "id": "openai/gpt-oss-20b",
      "object": "model",
      "created": 0,
      "owned_by": "system",
      "root": "openai/gpt-oss-20b"
    }
    // ... その他のモデル
  ]
}
```
