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

# API の概要

> エンドポイントや認証を含む、Serverless Inference サービスの完全な REST API リファレンスを確認できます。

このリファレンスでは、Serverless Inference REST API について説明します。この API を使用すると、ご自身のアプリケーションから基盤モデルをプログラムで呼び出せます。モデルのインフラストラクチャーを管理することなく、サービス、スクリプト、ノートブックにホスト型推論を統合する際に使用できます。

<div id="base-url">
  ## ベース URL
</div>

Inference サービスには次の URL からアクセスできます：

```plaintext theme={null}
https://api.inference.wandb.ai/v1
```

<div id="prerequisites">
  ## 前提条件
</div>

Inference APIを呼び出すには、次が必要です。

* InferenceクレジットがあるW\&Bアカウント。
* 有効なW\&B APIキー。

複数のチームに所属している場合、または使用量をprojectに関連付けたい場合は、チームIDとproject IDも必要です。コード例では、これらは`[YOUR-TEAM]/[YOUR-PROJECT]`として表示されます。これらを指定しない場合、W\&Bはデフォルトのentityとproject名`inference`を使用します。

<div id="available-methods">
  ## 利用可能なメソッド
</div>

Inference API は、基盤モデルとやり取りするための OpenAI 互換エンドポイントを提供します。利用可能なメソッドは次のとおりです。

* **[Chat Completions](/ja/inference/api-reference/chat-completions)**: 基盤モデルを使用してチャット補完を生成します。
* **[List Models](/ja/inference/api-reference/list-models)**: 利用可能なすべてのモデルとその ID を取得します。

<div id="authentication">
  ## 認証
</div>

すべての API リクエストには、W\&B の APIキーを使用した認証が必要です。[wandb.ai/settings](https://wandb.ai/settings) で APIキーを作成してください。

リクエストヘッダーに APIキーを含めてください:

* OpenAI SDK の場合は、`api_key` パラメーターを設定します。
* API を直接呼び出す場合は、`Authorization: Bearer [YOUR-API-KEY]` を使用します。

<div id="error-handling">
  ## エラー処理
</div>

すべてのエラーコードとその解決方法については、[API errors](/ja/support/inference) を参照してください。

<div id="next-steps">
  ## 次のステップ
</div>

APIキーを取得したら、次のいずれかに進んでください:

* [使用例](/ja/inference/examples)を試して、API がどのように動作するかを確認してください。
* [Inference UI](/ja/inference/ui-guide)でモデルを確認してください。
* ご利用のアカウントの[使用制限](/ja/inference/usage-limits)を確認してください。
