DEV Community

lbase-novaapi
lbase-novaapi

Posted on Originally published at novaapi.lbase.com

One Endpoint, Your Whole Toolchain: Running Chinese Frontier Models in Claude Code, Cursor, Cline, Aider and More

The awkward part of using a Chinese frontier model isn't the model. It's wiring the same model into the seven different tools you already have open.

This is the copy-paste version of that setup, for every client I've configured over the last few months. One endpoint, many tools. Scroll to the one you use.

First: the part that matters (base URLs)

Nearly every tool below asks for a "base URL". Getting this wrong is the #1 setup failure, and the rule is annoyingly inconsistent:

Client type What to enter
OpenAI-compatible clients (Cursor, Cline, LangChain, most GUIs) https://api.lbase.com/v1with /v1
Claude Code / Anthropic SDK clients https://api.lbase.comwithout /v1 (the SDK appends /v1/messages itself)

Put /v1 on an Anthropic client and you'll get a 404 on /v1/v1/messages. That's the whole bug 90% of the time.

Claude Code

Two environment variables, no config file:

export ANTHROPIC_BASE_URL="https://api.lbase.com"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"
claude
Enter fullscreen mode Exit fullscreen mode

Want a specific model? Claude Code respects the model env var too:

export ANTHROPIC_MODEL="deepseek-v4-flash"     # or a claude-* name if your gateway maps them
Enter fullscreen mode Exit fullscreen mode

Tip: keep a separate shell profile (or a small wrapper script) for the cheap profile and another for the flagship one. Switching is then one command, and you stop hand-editing configs.

Cursor

Settings → Models → OpenAI API Key, then add a custom model:

  • Base URL: https://api.lbase.com/v1
  • Model name: deepseek-v4-flash
  • Toggle off the models you don't want shown in the picker (Cursor lists a lot of noise by default)

Cursor is chat/completion oriented; for long agentic runs, Claude Code or Cline handle tool-call loops better on non-Anthropic models.

Cline / Roo Code (VS Code)

In the extension settings, choose OpenAI Compatible:

  • Base URL: https://api.lbase.com/v1
  • API Key: your sk-...
  • Model ID: deepseek-v4-flash

Cline's agentic loops are token-hungry. This is exactly where prompt caching pays off — the same system prompt and file context get re-sent every step, and on a cached-input rate the input side is nearly free.

Aider (terminal)

export OPENAI_API_BASE="https://api.lbase.com/v1"
export OPENAI_API_KEY="sk-your-key"
aider --model openai/deepseek-v4-flash
Enter fullscreen mode Exit fullscreen mode

Aider also supports Anthropic-style endpoints if you prefer the Claude model aliases.

Continue.dev

~/.continue/config.json:

{
  "models": [
    {
      "title": "DeepSeek V4.1 (NovaAPI)",
      "provider": "openai",
      "model": "deepseek-v4-flash",
      "apiBase": "https://api.lbase.com/v1",
      "apiKey": "sk-your-key"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Dify / FastGPT / LangChain

All three want an OpenAI-compatible provider. Take any provider you're not using, or add a custom one:

# LangChain
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="deepseek-v4-flash",
    base_url="https://api.lbase.com/v1",
    api_key="sk-your-key",
)
Enter fullscreen mode Exit fullscreen mode

For Dify: Settings → Model Provider → OpenAI-API-compatible, paste the base URL and key, then add deepseek-v4-flash as a model name.

Desktop GUIs (Cherry Studio, ChatBox, Open WebUI)

Same pattern every time: pick "OpenAI" as the provider type, then override the API host with https://api.lbase.com/v1, paste the key, and fetch the model list (they'll pull whatever the endpoint exposes).

One caveat with reasoning models: some GUIs render the model's reasoning_content field inline. That's a client rendering quirk, not a broken response — worth knowing before you file a bug.

The three gotchas that cost the most time

1. Model names change under you. Providers rename models (DeepSeek turned deepseek-v4-flash into deepseek-flash the day V4.1 shipped) and start auto-routing traffic between tiers. If a tool hardcodes an old name, it breaks silently. Gateways help here because the mapping lives server-side: your client keeps sending the name it always sent.

2. Peak/off-peak pricing is real. If your provider bills peak windows (DeepSeek's are Mon–Fri 01:00–04:00 and 06:00–10:00 UTC, at 2x), then "the same request" costs double depending on when a batch runs. Schedule overnight jobs outside those windows; on a large batch that's a straight 50% saving with no code changes.

3. Caching is the biggest lever nobody configures. Cached-input rates are an order of magnitude below cache-miss rates. Agentic tools re-send a stable prefix constantly, so enabling caching changes your bill more than switching models does.

How to verify a setup in 30 seconds

curl https://api.lbase.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-key" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"reply with OK"}],"max_tokens":5}'
Enter fullscreen mode Exit fullscreen mode

A 200 with "choices" means your endpoint, key and model name are all fine — any client problem after that is client-side config, not the gateway.


Full disclosure: I build NovaAPI, the gateway used in these examples — OpenAI/Anthropic-compatible access to Chinese frontier models, PayPal/USDT billing. Every snippet above works with any compatible gateway; the base-URL rules and gotchas are the same regardless of which one you pick.

Top comments (0)