> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/jp/tong-he/connections/anthropic-claude.md).

# AnthropicをUnslothに接続：ローカルチャットでClaudeモデルを実行

Anthropic API を [Unsloth](https://github.com/unslothai/unsloth) に接続して、Claude Opus 4.7 を含む Claude モデルを、オープンソースの UI チャットインターフェースでローカルモデルと並べて直接会話できます。このガイドでは、Anthropic API キーの作成方法、Unsloth に Anthropic をプロバイダーとして追加する方法、Claude LLM の読み込み方法、そしてチャットを開始する方法を紹介します。

Unsloth でサポートされている Claude モデルは、思考、 [Web 検索](#web-search-and-thinking)、Anthropic [コード実行](#code-execution)、および [プロンプトキャッシュ](#prompt-caching) などの高度な機能にもアクセスでき、コスト効率を向上させます。

### セットアップ

{% stepper %}
{% step %}

#### Anthropic API キーを作成する

から API キーを作成します。 [Anthropic Console](https://console.anthropic.com/settings/keys)。キーをコピーしてください。次のステップで Unsloth に貼り付けます。
{% endstep %}

{% step %}

#### Anthropic を Unsloth に接続する

<figure><img src="/files/308496fd92dfabad3fc10b7ec869acc772e29496" alt="" width="563"><figcaption></figcaption></figure>

次に、Anthropic を Unsloth に接続します。

1. 開く **設定** → **接続**、その後 **接続を追加**
2. をクリックします。追加したいプロバイダーを選択し、先ほどコピーした API キーを貼り付けます。
3. クリック **モデルを再読み込み** して、アカウントで利用可能なモデルの一覧を更新します。
4. 有効にしたいモデルを選択し、保存を押します。&#x20;
   {% endstep %}

{% step %}

#### チャットの準備完了

接続を保存した後、モデルのドロップダウンで **接続済み** の下にある Claude モデルを選択します。対応する Claude モデルでは、画像生成、思考、Web 検索、コード実行などの追加コントロールを表示できます。

<figure><img src="/files/0cc6576186070a2e37d9d7e004aea05290d0df20" alt="" width="337"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### コード実行

有効にすると、対応する Claude モデルは Anthropic のプロバイダーサンドボックス内でコードを実行し、問題の解決、データ分析、ファイルの操作を行えます。Claude は Anthropic の Code execution ツールを使用します。コード実行は、他のツール呼び出しと並んで、レスポンスのタイムラインにツールアクティビティとして表示されます。

<figure><img src="/files/2cd41c9642bb54fa238bef901d5c969e39c09d30" alt="" width="563"><figcaption></figcaption></figure>

### プロンプトキャッシュ

{% columns %}
{% column width="66.66666666666666%" %}
プロンプトキャッシュは、同じ長いプレフィックスを再利用するリクエストでレイテンシとコストを削減します。Anthropic モデルを含む、対応するプロバイダーとサーバーでサポートされています。サポートされている接続のキャッシュ動作を制御するには、サイドパネルの **プロンプトキャッシュ** 設定を使用します。
{% endcolumn %}

{% column width="33.33333333333334%" %}

<figure><img src="/files/e482d692d1a77c68eb712a04952a92f16b3a7953" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<figure><img src="/files/5bcf6fff0534310d56b7bea1b8e416dab545b5b1" alt="" width="375"><figcaption></figcaption></figure>

### Web 検索と思考

対応する Claude モデルは、プロバイダー側の Web 検索を使用できます。 **思考** コントロールは、選択したモデルが思考をサポートしている場合に表示されます。モデルによっては、異なる思考レベルや利用可否が表示されることがあります。

<figure><img src="/files/0dbb7389f8d19ef42407933ecd60c6ec7f8ab667" alt="" width="563"><figcaption></figcaption></figure>

この **思考** コントロールは選択したモデルに応じて変化します。オン/オフのトグルを使うモデルもあれば、推論強度モデルではモデル固有の思考レベルを使うモデルもあります。&#x20;

### トラブルシューティング

Anthropic API への接続に失敗する場合は、API キーが有効で、正しい Anthropic アカウントのものであることを確認してください。

モデルをクリックしても表示されない場合は **モデルを読み込む**、そのモデルがあなたのアカウントで利用できない可能性があります。モデル ID を手動で入力するか、別のモデルを選択してください。


---

# 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://unsloth.ai/docs/jp/tong-he/connections/anthropic-claude.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.
