Replace all files with clean upstream Cline v3.83.0 content. ShengSuanYun provider code automatically removed.
33 lines
2.4 KiB
Plaintext
33 lines
2.4 KiB
Plaintext
---
|
|
title: "OpenRouter"
|
|
description: "Learn how to use OpenRouter with Cline to access a wide variety of language provider through a single API."
|
|
---
|
|
|
|
OpenRouter is an AI platform that provides access to a wide variety of language models from different providers, all through a single API. This can simplify setup and allow you to easily experiment with different models.
|
|
|
|
**Website:** [https://openrouter.ai/](https://openrouter.ai/)
|
|
|
|
### Get API Credentials
|
|
|
|
1. **Sign Up/Sign In:** Go to the [OpenRouter website](https://openrouter.ai/). Sign in with your Google or GitHub account.
|
|
2. **Get an API Key:** Go to the [keys page](https://openrouter.ai/keys). You should see an API key listed. If not, create a new key.
|
|
3. **Copy the Key:** Copy the API key.
|
|
|
|
### Configuration in Cline
|
|
|
|
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
|
|
|
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
|
2. **Select Provider:** Choose "OpenRouter" from the "API Provider" dropdown.
|
|
3. **Enter API Key:** Paste your OpenRouter API key into the "OpenRouter API Key" field.
|
|
4. **Select Provider Model:** Choose your desired model from the "Model" dropdown.
|
|
5. **(Optional) Custom Base URL:** If you need to use a custom base URL for the OpenRouter API, check "Use custom base URL" and enter the URL. Leave this blank for most users.
|
|
|
|
### Tips and Notes
|
|
|
|
- **Pricing:** OpenRouter charges based on the underlying model's pricing. See the [OpenRouter Models page](https://openrouter.ai/models) for details.
|
|
- OpenRouter passes caching requests to underlying models that support it. Check the [OpenRouter Models page](https://openrouter.ai/models) to see which models offer caching.
|
|
- For most models, caching should activate automatically if supported by the model itself (similar to how Requesty works).
|
|
- **Exception for Gemini Models via OpenRouter:** Due to potential response delays sometimes observed with Google's caching mechanism when accessed via OpenRouter, a manual activation step is required _specifically for Gemini models_.
|
|
- If using a **Gemini model** via OpenRouter, you **must manually check** the "Enable Prompt Caching" box in the provider settings to activate caching for that model. This checkbox serves as a temporary workaround. For non-Gemini models on OpenRouter, this checkbox is not necessary for caching.
|