> For the complete documentation index, see [llms.txt](https://mitsu-1.gitbook.io/vrc-ai-companion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mitsu-1.gitbook.io/vrc-ai-companion/aiwosuru/openai.md).

# OpenAIのAPIキー

VACでは **「OpenAI（インターネット）」** を選びます。 ChatGPTの会話画面ではなく、OpenAIのAPI管理画面で準備してください。

## 1. 公式のAPI管理画面にログインする

[OpenAI Platform](https://platform.openai.com/)を開き、アカウントを作成またはログインします。 組織・プロジェクトを選ぶ画面がある場合は、自分がVACで使うプロジェクトを選びます。

## 2. APIの支払い・利用上限を確認する

管理画面のBilling（請求）で、支払い設定や残高を確認します。 ChatGPTへのログインだけでは、APIキーやAPI側の課金設定は完了しません。

Limits / Spend limitsなどの画面で、通知と利用停止の条件を確認してください。 通知を出す設定と、実際にAPIを止める上限は区別します。[OpenAI公式：利用上限](https://developers.openai.com/api/docs/guides/spend-limits)

## 3. APIキーを発行する

1. [API Keys](https://platform.openai.com/api-keys)を開く。
2. 新しいシークレットキーを作成する操作を選ぶ。
3. 名前には「VAC用」など、用途が分かるものを付ける。
4. プロジェクト・権限・有効期限を確認し、作成したキーをコピーする。

管理用のAdmin APIキーは不要です。通常のモデル利用のためのキーを用意してください。 権限を絞る場合は、VACが利用する会話生成と、必要に応じたモデル一覧の取得を許可します。 キー全文が再表示されない場合は、再発行して交換します。

発行の入口は[OpenAI公式クイックスタート](https://developers.openai.com/api/docs/quickstart)にもあります。 VACの利用者は、公式ページのプログラム例やSDK導入を実行する必要はありません。

## 4. VACに登録する

「AI の設定」を開き、下へスクロールして「OpenAI（インターネット）の利用設定」を探します。 「利用キー」欄に貼り付けて、欄の右の **「保存」** を押します。

![OpenAIの利用キー入力欄。保存後は入力欄が空になります。](https://2281629983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWzAawsJRGrYYDbrjl4uR%2Fuploads%2Fgit-blob-7940c7ed3ba3dfd4a698aad14714909a4d93d33e%2Fkey-openai.png?alt=media)

続いて、上の「まとめて切り替え」でOpenAIと利用可能な会話用モデルを選び、**「まとめて切り替える」** を押します。 [登録手順の詳細](/vrc-ai-companion/aiwosuru/register.md)

## うまくいかないとき

| 状況          | 確認すること                           |
| ----------- | -------------------------------- |
| キーが無効・認証エラー | コピー漏れ、期限切れ、削除済みキー、プロジェクトの権限      |
| 利用上限・残高不足   | API側の請求・利用上限。チャットサービス側の契約とは分けて確認 |
| モデルが見つからない  | APIで使えるモデルの正式なIDと、自分のプロジェクトの利用権限 |

最新の料金は[OpenAI APIの料金表](https://developers.openai.com/api/docs/pricing)を確認してください。 公式情報の確認日：2026年9月16日。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mitsu-1.gitbook.io/vrc-ai-companion/aiwosuru/openai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
