| 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). |
| 74 | |
| 75 | ## Model Capabilities |
| 76 | |
| 77 | OpenRouter models may require explicit capability configuration because the proxy doesn't always preserve the original model's function calling support. |
| 78 | |
| 79 | <Info> |
| 80 | Continue automatically uses system message tools for models that don't support native function calling, so Agent mode should work even without explicit capability configuration. However, you can still override capabilities if needed. |
| 81 | </Info> |
| 82 | |
| 83 | If you're experiencing issues with Agent mode or tools not working, you can add the capabilities field: |
| 84 | |
| 85 | <Tabs> |
| 86 | <Tab title="YAML"> |
| 87 | ```yaml title="config.yaml" |
| 88 | models: |
| 89 | - name: Claude via OpenRouter |
| 90 | provider: openrouter |
| 91 | model: anthropic/claude-3.5-sonnet |
| 92 | apiBase: https://openrouter.ai/api/v1 |
| 93 | apiKey: <YOUR_OPEN_ROUTER_API_KEY> |
| 94 | capabilities: |
| 95 | - tool_use # Enable function calling for Agent mode |
| 96 | - image_input # Enable image upload support |
| 97 | ``` |
| 98 | </Tab> |
| 99 | <Tab title="JSON"> |
| 100 | ```json title="config.json" |
| 101 | { |
| 102 | "models": [ |
| 103 | { |
| 104 | "title": "Claude via OpenRouter", |
| 105 | "provider": "openrouter", |
| 106 | "model": "anthropic/claude-3.5-sonnet", |
| 107 | "apiBase": "https://openrouter.ai/api/v1", |
| 108 | "apiKey": "<YOUR_OPEN_ROUTER_API_KEY>", |
| 109 | "capabilities": { |
| 110 | "tools": true, |
| 111 | "uploadImage": true |
| 112 | } |
| 113 | } |
| 114 | ] |
| 115 | } |
| 116 | ``` |
| 117 | </Tab> |
| 118 | </Tabs> |
| 119 | |
| 120 | Note: Not all models support function calling. Check the [OpenRouter models page](https://openrouter.ai/models) for specific model capabilities. |