> 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 search](#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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FSzJ57mYBpBCavIKyksDy%2Fclaude_studio_api.gif?alt=media&amp;token=bd7b7da5-bb25-4f9d-bfb8-b63602c1f082" alt="" width="563"><figcaption></figcaption></figure>

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

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

{% step %}

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

接続を保存したら、以下の **接続済み** をモデルのドロップダウンで選択します。対応する Claude モデルでは、画像生成、思考、ウェブ検索、コード実行などの追加コントロールが表示される場合があります。

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FpOMKHdhunTepcJSvf8pA%2Fimage.png?alt=media&amp;token=ca454678-a98b-4edb-b407-beeb879b4f76" alt="" width="337"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### コード実行

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F4W9Zq684jCgJy9kGvrkk%2FScreenshot%202026-05-26%20at%206.10.12%E2%80%AFAM.png?alt=media&amp;token=c7b6a106-1a22-4120-a22d-f9ad8a9471c7" alt="" width="563"><figcaption></figcaption></figure>

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

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

{% column width="33.33333333333334%" %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FKA6iU3qCFhUiq0KI16aU%2FScreenshot%202026-05-26%20at%203.28.44%E2%80%AFAM.png?alt=media&amp;token=41a43794-792d-48f4-8774-8b9d85702dfc" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fq4csmTX5rS9isMkNkhTX%2FPrompt%20Caching%20Diagram%20(1).png?alt=media&amp;token=ade433bf-5eaf-4146-a266-525a85a6c98d" alt="" width="375"><figcaption></figcaption></figure>

### Web検索と思考

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FC0Ed4kzN9h6c0ogEn6NT%2Fwebsearch%20api.png?alt=media&amp;token=d3335222-1d9e-4021-9bf9-734c6acf1fc0" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/jp/tong-he/connections/anthropic-claude.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
