# Cline and Roo Code (https://inference.net/docs/integrations/cline)

Connect Cline or Roo Code in VS Code to Inference.net by selecting the **OpenAI Compatible** API provider, setting the base URL to `https://api.inference.net/v1`, and entering your Inference.net API key with a tool-capable model ID such as `deepseek-v4.1-flash-1017` or `glm-5.3`.

## Quick configuration

Enter these values in the Cline or Roo Code provider settings panel. If you do not have an account yet, [create one here](/register/) and generate a key in [API keys](/dashboard/api-keys/).

| Setting | Value |
| --- | --- |
| API Provider | `OpenAI Compatible` |
| Base URL | `https://api.inference.net/v1` |
| US-only Base URL (optional) | `https://us.api.inference.net/v1` |
| API Key | Your Inference.net API key (`inf_sk_...`) |
| Model ID | `deepseek-v4.1-flash-1017` (or any tool-capable ID below) |

## Configure Cline in VS Code

<Steps>
<Step title="Open Cline API settings">

Open the Cline sidebar in VS Code and click the **Settings** (gear) icon in the top-right corner.

</Step>
<Step title="Select OpenAI Compatible">

Under **API Provider**, select **OpenAI Compatible**.

</Step>
<Step title="Enter Base URL and API key">

Set **Base URL** to:

```text
https://api.inference.net/v1
```

Paste your Inference.net API key from [API keys](/dashboard/api-keys/) into **API Key**.

</Step>
<Step title="Set Model ID and limits">

Enter `deepseek-v4.1-flash-1017` in **Model ID**. Under **Model Configuration**, set:

- **Context Window Size:** `1040000`
- **Max Output Tokens:** `393216`
- **Supports Images:** Enabled (for `deepseek-v4.1-flash-1017`, `glm-5.3-flash`, and `moonshotai/kimi-k3.1-pro`)

</Step>
<Step title="Optional: add custom tracking headers">

In **Custom Headers**, add `x-inference-task-id` with value `cline` to group Cline traffic in [Usage](/dashboard/usage/).

</Step>
<Step title="Save and run a test prompt">

Click **Done**, start a new task, and ask Cline to inspect a file in your workspace. Confirm token counts and spend under [Usage](/dashboard/usage/).

</Step>
</Steps>

## Configure Roo Code in VS Code

Roo Code uses the same **OpenAI Compatible** provider settings and supports importing JSON configuration profiles.

1. Open the Roo Code sidebar and click **Settings** (gear icon).
2. Create a new provider profile (for example, `inference-deepseek`) and choose **OpenAI Compatible**.
3. Set **Base URL** to `https://api.inference.net/v1`, paste your API key, and enter `deepseek-v4.1-flash-1017` as the **Model**.
4. Expand **Model Configuration** to match the context window and max output tokens from the table below.

You can also store a reusable Roo Code provider profile JSON snippet (replace `inf_sk_...` with your own key before importing, and never commit the file to git):

```json
{
  "providerProfiles": {
    "currentApiConfigName": "inference-deepseek",
    "apiConfigs": {
      "inference-deepseek": {
        "apiProvider": "openai",
        "openAiBaseUrl": "https://api.inference.net/v1",
        "openAiApiKey": "inf_sk_...",
        "openAiModelId": "deepseek-v4.1-flash-1017",
        "openAiHeaders": {
          "x-inference-task-id": "roo-code"
        },
        "openAiCustomModelInfo": {
          "contextWindow": 1040000,
          "maxTokens": 393216,
          "supportsImages": true,
          "supportsPromptCache": true
        }
      }
    }
  }
}
```

## Verified tool-calling models

Cline and Roo Code rely on tool calls to read files, run terminal commands, and apply diffs. Pick a model with `supports_tools: true` from `GET https://api.inference.net/v1/models`:

| Model ID | Context window | Max output | Image input | Model page |
| --- | --- | --- | --- | --- |
| `deepseek-v4.1-flash-1017` | 1,040,000 | 393,216 | Yes | [DeepSeek V4.1 Flash](/models/deepseek-v4-1-flash-1017/) |
| `glm-5.3` | 1,048,576 | 943,718 | No | [GLM 5.3](/models/glm-5-3/) |
| `glm-5.3-flash` | 1,048,576 | 262,144 | Yes | [GLM 5.3 Flash](/models/glm-5-3-flash/) |
| `moonshotai/kimi-k3.1-pro` | 1,048,576 | 1,048,576 | Yes | [Kimi K3.1 Pro](/models/kimi-k3-1-pro/) |

<Callout title="Avoid non-tool models in coding extensions" tone="warning">

Models with `supports_tools: false` (such as `inference-net/schematron-v2-turbo` or `glm-5`) are not suited for Cline or Roo Code agent loops. Verify `supports_tools: true` in `GET https://api.inference.net/v1/models` or see [Function calling](/docs/api/function-calling/).

</Callout>

## Verify connectivity outside VS Code

If requests fail inside VS Code, verify your API key and model ID with `curl`:

```bash
export INFERENCE_API_KEY="inf_sk_..."
curl https://api.inference.net/v1/chat/completions \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash-1017",
    "messages": [{"role": "user", "content": "Say hello in five words."}]
  }'
```

## Troubleshooting

- **`401 Unauthorized`:** Re-paste your API key without leading or trailing spaces, and verify it is active on [API keys](/dashboard/api-keys/).
- **`404` or HTML error page:** Confirm **Base URL** is `https://api.inference.net/v1` (with `/v1`), not `https://inference.net/v1`.
- **Model not found:** Copy the exact ID from the [model catalog](/models/), including owner prefixes such as `moonshotai/kimi-k3.1-pro`.
- **Context limit errors:** Check that your **Context Window Size** and **Max Output Tokens** do not exceed the model's `context_length` and `max_completion_tokens` values in `GET /v1/models`.
- **Using an Inference Pass plan key:** Plan keys work directly in Cline and Roo Code for models included in your plan. Check [API keys](/docs/api-keys/#plan-keys) for plan limits.

See all supported editors, gateways, and SDKs in the [Integrations hub](/docs/integrations/).