Skip to contentNewKimi K3.1 Pro is now availableTry it now
Docs / Cline and Roo Code

Cline and Roo Code

Configure Cline and Roo Code in VS Code to call Inference.net OpenAI-compatible models with tool calling and 1M context.

Last updated

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 and generate a key in API keys.

SettingValue
API ProviderOpenAI Compatible
Base URLhttps://api.inference.net/v1
US-only Base URL (optional)https://us.api.inference.net/v1
API KeyYour Inference.net API key (inf_sk_...)
Model IDdeepseek-v4.1-flash-1017 (or any tool-capable ID below)

Configure Cline in VS Code

  1. Open Cline API settings

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

  2. Select OpenAI Compatible

    Under API Provider, select OpenAI Compatible.

  3. 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 into API Key.

  4. 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)
  5. Optional: add custom tracking headers

    In Custom Headers, add x-inference-task-id with value cline to group Cline traffic in Usage.

  6. 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.

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 IDContext windowMax outputImage inputModel page
deepseek-v4.1-flash-10171,040,000393,216YesDeepSeek V4.1 Flash
glm-5.31,048,576943,718NoGLM 5.3
glm-5.3-flash1,048,576262,144YesGLM 5.3 Flash
moonshotai/kimi-k3.1-pro1,048,5761,048,576YesKimi K3.1 Pro

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.
  • 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, 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 for plan limits.

See all supported editors, gateways, and SDKs in the Integrations hub.