| 1 | --- |
| 2 | title: "How to Configure OpenRouter with Continue" |
| 3 | sidebarTitle: "OpenRouter" |
| 4 | --- |
| 5 | |
| 6 | <Tip> |
| 7 | **Discover Inception models [here](https://hub.continue.dev/inceptionlabs)** |
| 8 | </Tip> |
| 9 | |
| 10 | <Info> |
| 11 | Get an API key from [OpenRouter](https://openrouter.ai/keys) |
| 12 | </Info> |
| 13 | |
| 14 | <Tabs> |
| 15 | <Tab title="YAML"> |
| 16 | ```yaml title="config.yaml" |
| 17 | models: |
| 18 | - name: <MODEL_NAME> |
| 19 | provider: openrouter |
| 20 | model: <MODEL_ID> |
| 21 | apiBase: https://openrouter.ai/api/v1 |
| 22 | apiKey: <YOUR_OPEN_ROUTER_API_KEY> |
| 23 | ``` |
| 24 | </Tab> |
| 25 | <Tab title="JSON (Deprecated)"> |
| 26 | ```json title="config.json" |
| 27 | { |
| 28 | "models": [ |
| 29 | { |
| 30 | "title": "<MODEL_NAME>", |
| 31 | "provider": "openrouter", |
| 32 | "model": "<MODEL_ID>", |
| 33 | "apiBase": "https://openrouter.ai/api/v1", |
| 34 | "apiKey": "<YOUR_OPEN_ROUTER_API_KEY>" |
| 35 | } |
| 36 | ] |
| 37 | } |
| 38 | ``` |
| 39 | </Tab> |
| 40 | </Tabs> |
| 41 | |
| 42 | <Info> |
| 43 | **Check out a more advanced configuration [here](https://hub.continue.dev/openrouter/qwen3-coder?view=config)** |
| 44 | </Info> |
| 45 | |
| 46 | ## Optional configuration |
| 47 | |
| 48 | OpenRouter allows you configure provider preferences, model routing configuration, and more. You can set these via `requestOptions`. |
| 49 | |
| 50 | For example, to prevent extra long prompts from being compressed, you can explicitly turn off [Transforms](https://openrouter.ai/docs/features/message-transforms):) |
| 51 | |
| 52 | <Tabs> |
| 53 | <Tab title="YAML"> |
| 54 | ```yaml title="config.yaml" |
| 55 | models: |
| 56 | - name: <MODEL_NAME> |
| 57 | provider: openrouter |
| 58 | model: <MODEL_ID> |
| 59 | requestOptions: |
| 60 | extraBodyProperties: |
| 61 | transforms: [] |
| 62 | ``` |
| 63 | </Tab> |
| 64 | <Tab title="JSON (Deprecated)"> |
| 65 | ```json title="config.json" |
| 66 | { |
| 67 | "models": [ |
| 68 | { |
| 69 | "title": "<MODEL_NAME>", |
| 70 | "provider": "openrouter", |
| 71 | "model": "<MODEL_ID>", |
| 72 | "requestOptions": { |
| 73 | "extraBodyProperties": { |
| 74 | "transforms": [] |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | ] |
| 79 | } |
| 80 | ``` |
| 81 | </Tab> |
| 82 | </Tabs> |
| 83 | |
| 84 | ## Model Capabilities |
| 85 | |
| 86 | OpenRouter models may require explicit capability configuration because the proxy doesn't always preserve the function calling support of the original model. |
| 87 | |
| 88 | <Info> |
| 89 | Continue automatically uses system message tools for models that don't support |
| 90 | native function calling, so Agent mode should work even without explicit |
| 91 | capability configuration. However, you can still override capabilities if |
| 92 | needed. |
| 93 | </Info> |
| 94 | |
| 95 | If you're experiencing issues with Agent mode or tools not working, you can add the capabilities field: |
| 96 | |
| 97 | <Tabs> |
| 98 | <Tab title="YAML"> |
| 99 | ```yaml title="config.yaml" |
| 100 | models: |
| 101 | - name: <MODEL_NAME> |
| 102 | provider: openrouter |
| 103 | model: <MODEL_ID> |
| 104 | apiBase: https://openrouter.ai/api/v1 |
| 105 | apiKey: <YOUR_OPEN_ROUTER_API_KEY> |
| 106 | capabilities: |
| 107 | - tool_use # Enable function calling for Agent mode |
| 108 | ``` |
| 109 | </Tab> |
| 110 | <Tab title="JSON (Deprecated)"> |
| 111 | ```json title="config.json" |
| 112 | { |
| 113 | "models": [ |
| 114 | { |
| 115 | "title": "<MODEL_NAME>", |
| 116 | "provider": "openrouter", |
| 117 | "model": "<MODEL_ID>", |
| 118 | "apiBase": "https://openrouter.ai/api/v1", |
| 119 | "apiKey": "<YOUR_OPEN_ROUTER_API_KEY>", |
| 120 | "capabilities": { |
| 121 | "tools": true, // Enable function calling for Agent mode |
| 122 | } |
| 123 | } |
| 124 | ] |
| 125 | } |
| 126 | ``` |
| 127 | </Tab> |
| 128 | </Tabs> |
| 129 | |
| 130 | <Note> |
| 131 | Not all models support function calling. Check the [OpenRouter models page](https://openrouter.ai/models) for specific model capabilities. |
| 132 | </Note> |