# Cline (/docs/integrations/cline)

Use codai in Cline through the OpenAI Compatible provider, in both Plan and Act, and add the MCP server.

Cline needs the **OpenAI Compatible** provider with base URL `https://ai.codai.ro/v1`, your codai key and model ID `codai`.

## Before you start [#before-you-start]

- A codai key from [hub.codai.ro](https://hub.codai.ro) → **Keys → Create key** (details in the [quickstart](../gateway/index.mdx)).
- Use **OpenAI Compatible**, not the Anthropic provider. Cline's Anthropic provider only offers a fixed list of Claude model ids, so it cannot select `codai`.

## Configure the provider [#configure-the-provider]

Open Cline **Settings → API Provider → OpenAI Compatible**:

| Field | Value |
| --- | --- |
| Base URL | `https://ai.codai.ro/v1` |
| API Key | `codai_xxxxxxxx` |
| Model ID | `codai` |
| Custom Headers | leave empty |
| Azure API version | leave empty |

- Cline reads `GET /v1/models` to fill a dropdown. If `codai` is not offered, type it or pick **Use custom model ID**.
- Set the model in **both Plan and Act** modes.
- Leave the price fields empty and Cline shows $0; your real usage is in the hub.

From the Cline CLI:

```bash
cline auth --provider openai-compatible --apikey codai_xxxxxxxx --modelid codai --baseurl https://ai.codai.ro/v1
```

## MCP [#mcp]

Open the **MCP Servers** icon → **Configure → Configure MCP Servers** and add:

```json title="cline_mcp_settings.json"
{
  "mcpServers": {
    "codai": {
      "type": "streamableHttp",
      "url": "https://ai.codai.ro/mcp",
      "headers": { "Authorization": "Bearer codai_xxxxxxxx" },
      "disabled": false,
      "autoApprove": [],
      "timeout": 60
    }
  }
}
```

- Set `type` to `streamableHttp`. Without it Cline assumes SSE and the connection fails.
- `timeout` is in seconds.
- The Remote Servers tab has no headers field, so a key means editing this JSON.

## What works and what does not [#what-works-and-what-does-not]

| Feature | With codai |
| --- | --- |
| Plan and Act, tools | Work through OpenAI Compatible |
| Anthropic provider with `codai` | Does not — the model list is fixed |
| Cost display | Shows $0 unless you enter prices |

## Troubleshooting [#troubleshooting]

- **`404`** — the base URL lacks `/v1`.
- **Act mode uses another model** — the model is set only in Plan. Set it in Act too.
- **MCP server stays red** — `type` is missing or set to `sse`.

## Sources [#sources]

Checked 2026-10-02.

- [Cline — OpenAI Compatible](https://docs.cline.bot/provider-config/openai-compatible)
- [Cline — Anthropic](https://docs.cline.bot/provider-config/anthropic)
- [Cline — configuring MCP servers](https://docs.cline.bot/mcp/configuring-mcp-servers)
- [Cline — configuration](https://docs.cline.bot/getting-started/config)
- [Cline — CLI reference](https://docs.cline.bot/cli/cli-reference)
