DeepSeek 1017 in Cursor, Cline, Dify and the OpenAI SDK
Every tool below speaks the OpenAI format, so the change is the same everywhere: a base URL, a key, and a model name. Nothing in your prompts, your tool definitions or your application code changes.
The three values you need
- Base URL —
https://api.lbase.com/v1(OpenAI-compatible clients expect the/v1suffix) - API key — created in the console, tied to a group
- Model name —
deepseek-flashfor the current V4.1 Flash 1017 build,deepseek-v4-profor the reasoning tier
Cursor
Settings → Models → OpenAI API key, then override the base URL with the value above. Add deepseek-flash as a custom model name. If the model does not appear in the picker, that is a UI cache, not an API problem — restart the editor.
Cline
Choose OpenAI Compatible as the provider, paste the base URL and the key, and type the model name directly. Cline passes the name through unchanged, so a typo becomes a 404 rather than a silent fallback.
Dify
Add a model provider of type OpenAI-API-compatible. Set the base URL to the endpoint, the model name to deepseek-flash, and leave the context size at the model's stated window. Dify's connection test calls the models endpoint first, which is a useful check on the key before you debug anything else.
The official OpenAI SDK
from openai import OpenAI
client = OpenAI(
api_key="YOUR_KEY",
base_url="https://api.lbase.com/v1",
)
resp = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "say hello in five words"}],
)
print(resp.choices[0].message.content)
The same client works with streaming, tool calls and JSON output. If you are on the Anthropic SDK instead, point it at https://api.lbase.com and keep your Claude model names — the compatibility layer maps them.
When it does not work
- 401 — key wrong or revoked. Re-copy it from the console rather than from a note.
- 402 — balance, not code. Check the prepaid balance before touching the payload.
- 404 — model name. The console lists exactly what your key can call.
- Timeouts on long outputs — check whether the request is streaming; non-streaming requests that generate a lot of tokens look like hangs.
Full endpoint reference, including the Anthropic format, is in the docs.
Questions people actually ask
Which model name should I use?
deepseek-flash for the current V4.1 Flash 1017 build, deepseek-v4-pro for the reasoning tier.
Does Cursor work with DeepSeek 1017?
Yes. Set the OpenAI base URL to the endpoint and add deepseek-flash as a custom model.
Can I use the Anthropic SDK instead of OpenAI?
Yes. Point the Anthropic client at https://api.lbase.com and keep the Claude model names.
Why do I get a 404 when the key works?
The model name is not one your key can call. Check the console's model list for that group.
Is streaming supported?
Yes, including tool calls and JSON output.
Nova