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

# AIプロバイダに接続する

> Craft AIクレジットの代わりに、ご自身のOpenAIまたはAnthropicの認証情報をCraft Assistantで使用します。

Craft Assistantはデフォルトでは Craft AIクレジットを使用しますが、代わりにご自身のAIプロバイダアカウントを接続できます。接続済みのプロバイダを使用した場合、Craft AIクレジットは消費されません。

<Info>
  この機能は **macOS** および **iOS** でのみ利用できます。現在、WebおよびWindowsでは利用できません。
</Info>

## 利用可能なプロバイダ

| プロバイダ         | 接続方法                         |
| ------------- | ---------------------------- |
| **OpenAI**    | ChatGPTでサインインするか、APIキーを貼り付ける |
| **Anthropic** | APIキーを貼り付ける                  |
| **ローカルモデル**   | デバイス上で実行、接続不要                |
| **Craft**     | デフォルト、Craft AIクレジットを使用       |

<Info>
  接続済みのプロバイダを使用した場合、会話はそのプロバイダのAPIを通じて実行されます。Craft AIの使用量には影響しません。
</Info>

## プロバイダを接続する

<Steps>
  <Step title="設定を開く">
    **設定** > **アシスタント** に移動します。
  </Step>

  <Step title="AIプロバイダ接続を探す">
    **AIプロバイダ接続** セクションまでスクロールします。
  </Step>

  <Step title="接続をタップする">
    追加したいプロバイダの横にある **接続** をタップします。
  </Step>

  <Step title="アクティブなプロバイダを確認する">
    アシスタントパネルを開き、新しいプロバイダが選択されていることを確認します。新しい会話は自動的に接続済みのプロバイダを使用しますが、すでに開いているチャットでは引き続きCraftが使用されている場合があります。変更方法については、[プロバイダを切り替える](#プロバイダを切り替える) をご覧ください。
  </Step>
</Steps>

<Frame caption="クリックして拡大">
  <img src="https://mintcdn.com/craft-support/mrn9h3Zv_F-f37nX/images/ai-assistant/bring-your-own-key/en/content/settings-ai-provider-connections.png?fit=max&auto=format&n=mrn9h3Zv_F-f37nX&q=85&s=b7258cea96e57b581394a1f82ad381cc" alt="AI Provider Connections section in Settings showing OpenAI and Anthropic options" width="1470" height="1067" data-path="images/ai-assistant/bring-your-own-key/en/content/settings-ai-provider-connections.png" />
</Frame>

### OpenAI

OpenAIの接続方法は2つあります。

* **ChatGPTでサインイン**: 既存のChatGPTアカウントとサブスクリプションを使用します。APIキーは不要です。
* **OpenAI APIキーを使用**: [OpenAI Platform](https://platform.openai.com/api-keys) からAPIキーを貼り付けます。使用料はOpenAIアカウントに請求されます。

<Frame>
  <img src="https://mintcdn.com/craft-support/mrn9h3Zv_F-f37nX/images/ai-assistant/bring-your-own-key/en/content/connect-openai-dialog.png?fit=max&auto=format&n=mrn9h3Zv_F-f37nX&q=85&s=0c42784bf0718402b2f4b626a621f9a4" alt="Connect to OpenAI dialog with two options: Use OpenAI API Key and Sign in with ChatGPT" width="1470" height="1067" data-path="images/ai-assistant/bring-your-own-key/en/content/connect-openai-dialog.png" />
</Frame>

### Anthropic

Anthropicに接続するには、[Anthropic Console](https://console.anthropic.com/) からAPIキーを貼り付けます。使用料はAnthropicアカウントに請求されます。

<Frame>
  <img src="https://mintcdn.com/craft-support/mrn9h3Zv_F-f37nX/images/ai-assistant/bring-your-own-key/en/content/connect-anthropic-dialog.png?fit=max&auto=format&n=mrn9h3Zv_F-f37nX&q=85&s=99975bfc8d17d7a33ca55af604b3b23e" alt="Connect to Anthropic dialog with API key field and Open Anthropic Console button" width="1470" height="1067" data-path="images/ai-assistant/bring-your-own-key/en/content/connect-anthropic-dialog.png" />
</Frame>

## プロバイダを切り替える

プロバイダを接続すると、アシスタントパネルから直接プロバイダとモデルを切り替えられます。

<Steps>
  <Step title="アシスタントパネルを開く">
    任意のドキュメントまたはSpaceビューからアシスタントを開きます。
  </Step>

  <Step title="アシスタントボタンをタップする">
    入力フィールドの下にある **アシスタントボタン** をタップします。
  </Step>

  <Step title="モデルを選択する">
    ポップアップから **モデル** を選択します。接続済みのプロバイダのモデルがCraftのモデルと並んで表示されます。
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/craft-support/mrn9h3Zv_F-f37nX/images/ai-assistant/bring-your-own-key/en/content/model-selector-provider.png?fit=max&auto=format&n=mrn9h3Zv_F-f37nX&q=85&s=58d8da8fb4d5adb65f5f04222a1b5f23" alt="Model selector in the Assistant panel showing OpenAI models" width="1076" height="1124" data-path="images/ai-assistant/bring-your-own-key/en/content/model-selector-provider.png" />
</Frame>

アクティブなプロバイダを変更するには、モデルリストの下部にある **設定** をタップし、**プロバイダ** ドロップダウンからプロバイダを選択します。

<Frame>
  <img src="https://mintcdn.com/craft-support/mrn9h3Zv_F-f37nX/images/ai-assistant/bring-your-own-key/en/content/configure-provider-dropdown.png?fit=max&auto=format&n=mrn9h3Zv_F-f37nX&q=85&s=e64aeb2da5097bb72d3e02a0366e762d" alt="Configure dialog showing provider dropdown with Craft, Local Models, OpenAI, and Anthropic" width="1024" height="967" data-path="images/ai-assistant/bring-your-own-key/en/content/configure-provider-dropdown.png" />
</Frame>

<Tip>
  チャット内のバッジを確認することで、どのプロバイダがアクティブかを確認できます。モデル名の横にプロバイダのロゴが表示されるため、会話がCraftクレジットを使用しているか、ご自身のプロバイダを使用しているかを常に確認できます。
</Tip>

## 接続を削除する

<Steps>
  <Step title="設定を開く">
    **設定** > **アシスタント** に移動します。
  </Step>

  <Step title="接続を探す">
    **AIプロバイダ接続** セクションで、削除したいプロバイダを見つけます。
  </Step>

  <Step title="削除する">
    接続の横にある **3点ボタン** をタップし、**削除** をタップします。
  </Step>
</Steps>

<Frame>
  <img src="https://mintcdn.com/craft-support/mrn9h3Zv_F-f37nX/images/ai-assistant/bring-your-own-key/en/content/remove-connection.png?fit=max&auto=format&n=mrn9h3Zv_F-f37nX&q=85&s=d047ca8c12d7fb24a5e088400343bd1c" alt="AI Provider Connections showing connected providers with Remove button" width="1091" height="953" data-path="images/ai-assistant/bring-your-own-key/en/content/remove-connection.png" />
</Frame>

接続を削除すると、アシスタントはCraft AIクレジットに切り替わります。

<Columns cols={2}>
  <Card title="AIモデルを選ぶ" href="/ja/ai-assistant/models" />

  <Card title="AIクレジット" href="/ja/ai-assistant/usage" />
</Columns>
