> 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/openrouter.md).

# OpenRouterをUnslothに接続する方法：APIキーとモデル設定

このガイドでは、接続する方法を説明します **OpenRouter を** [**Unsloth**](https://github.com/unslothai/unsloth) に接続し、次のようなプロバイダーのホスト型 AI モデルにアクセスできるようにします **OpenAI、Anthropic、** および **Google** オープンソースのローカル UI チャットインターフェースから利用できます。OpenRouter の API キーを作成する方法、Unsloth にプロバイダーとして OpenRouter を追加する方法、モデル ID を読み込むまたは手動で入力する方法、チャット用に外部モデルを有効にする方法を学びます。

1 つの API キーを接続するだけで、Unsloth の OpenRouter モデルは、思考、ウェブ検索、ツール呼び出し、コード実行、カスタマイズ可能な生成設定などの高度な機能をチャットページから直接利用できます。

### セットアップ

{% stepper %}
{% step %}

#### OpenRouter の API キーを作成する

OpenRouter アカウントにサインインします。次から API キーを作成してください。 [OpenRouter ダッシュボード](https://openrouter.ai/settings/keys):

<figure><img src="/files/6c53c4bfcf197acc06906d3b0c28fce287a0db03" alt="" width="563"><figcaption></figcaption></figure>

キーをコピーします。次のステップで Unsloth に貼り付けます。

キーを作成する際、必要に応じてクレジット上限や有効期限を設定できます。
{% endstep %}

{% step %}

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

開く **設定 → 接続**、次にクリック **接続を追加**.

選択 **OpenRouter**、次に接続情報を入力します。

OpenRouter の詳細を入力してください:

* **API キー:** OpenRouter の API キーを貼り付けてください

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

* **モデル ID:** クリック **モデルを読み込む**、またはモデル ID を手動で入力します

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

最後に、クリック **接続を追加**.&#x20;
{% endstep %}

{% step %}

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

接続を保存したら、モデルのドロップダウンで **接続済み** の下にある OpenRouter モデルを選択します。

<figure><img src="/files/d40a5ae86973df0b07821741f834334fbf1fa7dd" alt="" width="337"><figcaption></figcaption></figure>

OpenRouter モデルは、上流モデルに応じて、ウェブ検索、思考、ツール呼び出し、生成設定など、さまざまなコントロールを提供する場合があります。
{% endstep %}
{% endstepper %}

### モデルの選択

OpenRouter は、さまざまなプロバイダーの多くのモデルへのアクセスを提供します。もし **モデルを読み込む** で選択したいモデルが表示されない場合は、有効にしたいモデル ID を入力してください。

<figure><img src="/files/1feb623b26279e0688dcbd70922e9411df88064e" alt="" width="563"><figcaption></figcaption></figure>

モデル ID の例:

```
openai/gpt-5.5 
anthropic/claude-sonnet-4.6 
google/gemini-3-pro
```

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

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

クリック後にモデルが表示されない場合 **モデルを読み込む**、そのモデルはあなたのアカウントまたは地域では利用できない可能性があります。モデル 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/openrouter.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.
