| 1 | --- |
| 2 | title: "OpenRouter" |
| 3 | --- |
| 4 | |
| 5 | OpenRouter is a unified interface for commercial and open-source models, giving you access to the best models at the best prices. You can sign up [here](https://openrouter.ai/signup), create your API key on the [keys page](https://openrouter.ai/keys), and then choose a model from the [list of supported models](https://openrouter.ai/models). |
| 6 | |
| 7 | Change `~/.continue/config.json` to look like the following. |
| 8 | |
| 9 | <Tabs> |
| 10 | <Tab title="YAML"> |
| 11 | ```yaml title="config.yaml" |
| 12 | models: |
| 13 | - name: OpenRouter LLaMA 70 8B |
| 14 | provider: openrouter |
| 15 | model: meta-llama/llama-3-70b-instruct |
| 16 | apiBase: https://openrouter.ai/api/v1 |
| 17 | apiKey: <YOUR_OPEN_ROUTER_API_KEY> |
| 18 | ``` |
| 19 | </Tab> |
| 20 | <Tab title="JSON"> |
| 21 | ```json title="config.json" |
| 22 | { |
| 23 | "models": [ |
| 24 | { |
| 25 | "title": "OpenRouter LLaMA 70 8B", |
| 26 | "provider": "openrouter", |
| 27 | "model": "meta-llama/llama-3-70b-instruct", |
| 28 | "apiBase": "https://openrouter.ai/api/v1", |
| 29 | "apiKey": "<YOUR_OPEN_ROUTER_API_KEY>" |
| 30 | } |
| 31 | ] |
| 32 | } |
| 33 | ``` |
| 34 | </Tab> |
| 35 | </Tabs> |
| 36 | |
| 37 | To utilize features such as provider preferences or model routing configuration, include these parameters inside the `models[].requestsOptions.extraBodyProperties` field of your plugin config. |
| 38 | |
| 39 | For example, to prevent extra long prompts from being compressed, you can explicitly turn off the feature like so: |
| 40 | |
| 41 | <Tabs> |
| 42 | <Tab title="YAML"> |
| 43 | ```yaml title="config.yaml" |
| 44 | models: |
| 45 | - name: Example Model |
| 46 | provider: exampleProvider |
| 47 | model: example-model |
| 48 | requestOptions: |
| 49 | extraBodyProperties: |
| 50 | transforms: [] |
| 51 | ``` |
| 52 | </Tab> |
| 53 | <Tab title="JSON"> |
| 54 | ```json title="config.json" |
| 55 | { |
| 56 | "models": [ |
| 57 | { |
| 58 | "title": "Example Model", |
| 59 | "provider": "exampleProvider", |
| 60 | "model": "example-model", |
| 61 | "requestOptions": { |
| 62 | "extraBodyProperties": { |
| 63 | "transforms": [] |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | ] |
| 68 | } |
| 69 | ``` |
| 70 | </Tab> |
| 71 | </Tabs> |
| 72 | |
| 73 | Learn more about available settings [here](https://openrouter.ai/docs). |