Use DeepSeek in Cline, Roo Code and Kilo Code
Updated 2026-10-18 · Connect the VS Code coding agents to DeepSeek V4.1 Flash and more: choose OpenAI Compatible and fill in three fields.
Connection details
- Base URL (OpenAI compatible)
- https://api.aifans.fan/v1
- API key
- Create one in the console; it starts with sk- (no account yet? sign up)
- Recommended models
- deepseek-v4.1-flash, deepseek-v4-pro (all models and prices)
Cline, Roo Code and Kilo Code are the most popular AI coding agents for VS Code. All three are set up the same way: choose the “OpenAI Compatible” provider and enter the base URL, your API key and a model ID.
Setup
- Install Cline (or Roo Code, Kilo Code) from the VS Code marketplace, open it from the sidebar and go to its settings (the gear icon).
- Set API Provider to OpenAI Compatible.
- Base URL: https://api.aifans.fan/v1
- API Key: the key you created in the console.
- Model ID: deepseek-v4.1-flash; switch to deepseek-v4-pro for harder tasks.
- In the model configuration, start with a Context Window of 128000; deepseek-v4.1-flash accepts images, so you can tick “Supports Images”. Save and send a message to test.
Setting names change between versions; follow what you see.
Save money, go faster
- An agent resends the whole conversation on every step. Most of it is a cache hit and billed at the cached-input price; start a new task when you switch topics so the context does not grow forever.
- Give your coding agent its own API key with a daily spending limit, so a long unattended run cannot surprise you.
- If you see 429 (too many requests), the extension retries by itself; throttled calls are not billed.