# IDE agents

Connect Cursor, Cline, Roo Code, Kilo Code and Continue to Nodul Router as an OpenAI-compatible provider.

Coding agents that accept an OpenAI-compatible provider work with the router. You always need three values:

| Setting  | Value                                                                    |
| -------- | ------------------------------------------------------------------------ |
| Base URL | `https://router.nodul.ru/api/v1`                                         |
| API key  | Your Router key, `sk-nr-…`                                               |
| Model    | A model id from the [catalog](/models), for example `openai/gpt-4o-mini` |

Pick a model with the **Tools** capability: agents call tools on every step. Agents send long prompts, so watch the spend in the cabinet logs and set a budget on the key.

## Cline, Roo Code, Kilo Code

1. Open the extension's settings and choose the API provider **OpenAI Compatible**.
2. Base URL: `https://router.nodul.ru/api/v1`.
3. API key: your Router key.
4. Model ID: the model id from the catalog.
5. Set the context window and the output limit to the model's `context_length` and `max_completion_tokens` from `GET /api/v1/models`.

## Continue

Add a model to `config.yaml`:

```yaml
models:
  - name: Nodul Router
    provider: openai
    model: openai/gpt-4o-mini
    apiBase: https://router.nodul.ru/api/v1
    apiKey: sk-nr-...
    roles: [chat, edit, apply]
```

## Cursor

1. Open **Cursor Settings → Models**.
2. In **API Keys**, enter the Router key as the OpenAI API key, turn on **Override OpenAI Base URL** and enter `https://router.nodul.ru/api/v1`.
3. Add the model id from the catalog as a custom model and turn it on.

Cursor sends some requests through its own servers, and some of its features work only with its built-in models.

## If something fails

| Symptom                        | Cause                                                                                                                               |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `401`                          | The key is wrong, disabled or expired.                                                                                              |
| `402`                          | The payer's balance is low or the key budget is reached. Agents reserve a lot per request: set a smaller output limit in the agent. |
| `400 model … is not available` | The model id is not in the catalog: copy it from the catalog.                                                                       |
| `400 no route of …`            | The model does not support tools. Pick a model with **Tools**.                                                                      |
| The answer stops in the middle | The output limit: set a larger `max_tokens` (output limit) in the agent.                                                            |
