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.
| 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
Open Cline API settings
Open the Cline sidebar in VS Code and click the Settings (gear) icon in the top-right corner.
Select OpenAI Compatible
Under API Provider, select OpenAI Compatible.
Enter Base URL and API key
Set Base URL to:
texthttps://api.inference.net/v1Paste your Inference.net API key from API keys into API Key.
Set Model ID and limits
Enter
deepseek-v4.1-flash-1017in 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, andmoonshotai/kimi-k3.1-pro)
- Context Window Size:
Optional: add custom tracking headers
In Custom Headers, add
x-inference-task-idwith valueclineto group Cline traffic in Usage.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.
- Open the Roo Code sidebar and click Settings (gear icon).
- Create a new provider profile (for example,
inference-deepseek) and choose OpenAI Compatible. - Set Base URL to
https://api.inference.net/v1, paste your API key, and enterdeepseek-v4.1-flash-1017as the Model. - 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):
{
"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 |
glm-5.3 | 1,048,576 | 943,718 | No | GLM 5.3 |
glm-5.3-flash | 1,048,576 | 262,144 | Yes | GLM 5.3 Flash |
moonshotai/kimi-k3.1-pro | 1,048,576 | 1,048,576 | Yes | Kimi K3.1 Pro |
Verify connectivity outside VS Code
If requests fail inside VS Code, verify your API key and model ID with curl:
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.404or HTML error page: Confirm Base URL ishttps://api.inference.net/v1(with/v1), nothttps://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_lengthandmax_completion_tokensvalues inGET /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.