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

# Serverless Inference で Invalid Authentication（401）エラーを解消するにはどうすればよいですか？

401 の Invalid Authentication エラーは、APIキーが無効であるか、W\&B プロジェクトの entity または名 が正しくないことを示します。

<div id="verify-your-api-key">
  ## APIキーを確認する
</div>

1. [User Settings](https://wandb.ai/settings) で新しいAPIキーを作成します。
2. APIキーは安全な場所に保管します。

<div id="check-your-project-configuration">
  ## プロジェクト設定を確認する
</div>

プロジェクトが `<your-team>/<your-project>` の形式で正しく設定されていることを確認してください。

**Python の例:**

```python theme={null}
client = openai.OpenAI(
    base_url='https://api.inference.wandb.ai/v1',
    api_key="<your-api-key>",
    project="<your-team>/<your-project>",  # W&B のチームとプロジェクトに一致する必要があります
)
```

**Bashの例:**

```bash theme={null}
curl https://api.inference.wandb.ai/v1/chat/completions \
  -H "Authorization: Bearer <your-api-key>" \
  -H "OpenAI-Project: <your-team>/<your-project>"
```

<div id="common-mistakes">
  ## よくある間違い
</div>

* チーム名ではなく、個人のentityを使用している
* チーム名またはプロジェクト名のスペルを間違えている
* チームとプロジェクトの間のスラッシュ (`/`) が抜けている
* 期限切れまたは削除済みのAPIキーを使用している

<div id="still-having-issues">
  ## まだ問題が解決しませんか？
</div>

* W\&Bアカウントにチームとプロジェクトが存在することを確認してください
* 指定したチームへのアクセス権があることを確認してください
* 現在のAPIキーが機能しない場合は、新しいAPIキーを作成してみてください

***

<Badge stroke shape="pill" color="orange" size="md">
  [Inference](/ja/support/models/tags/inference)
</Badge>
