> 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="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FumQXaeZGAQ8f3hMQSQQY%2Fimage.png?alt=media&amp;token=51ec273d-4271-4683-8cf2-0fb11bccb1ba" alt="" width="563"><figcaption></figcaption></figure>

キーをコピーします。次の手順で Unsloth に貼り付けます。

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

{% step %}

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

開く **設定 → 接続**、次に **接続済みを追加**.

選択 **OpenRouter**、その後、接続の詳細を入力します。

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

* **API キー：** OpenRouter の API キーを貼り付け

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FB9fDpRnYfDjhCI5yDoon%2Fimage.png?alt=media&amp;token=97ecc7e3-a3fe-4cd8-a5c6-738c9de7fbf3" alt="" width="375"><figcaption></figcaption></figure>

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F59F88IYS0BzteOqcavUj%2Fimage.png?alt=media&amp;token=72632261-b3cd-486c-b4dd-09b56fa3a58a" alt="" width="375"><figcaption></figcaption></figure>

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

{% step %}

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

接続を保存したら、次の下で OpenRouter モデルを選択してください **接続済み** モデルのドロップダウンで。

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FFFvSXoLCnvydwmTgS7Ru%2Fimage.png?alt=media&amp;token=79ca30bb-e049-4106-8b98-0871f79dfba5" alt="" width="337"><figcaption></figcaption></figure>

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

### モデルの選択

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

<figure><img src="https://735611837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FQM4eHEcNpWQazKtyS06X%2Fimage.png?alt=media&amp;token=8774a4a0-7d00-4888-9e03-72c0e8641533" 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 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/openrouter.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.
