DEV Community

Rambo Peng
Rambo Peng

Posted on

How to Use DeepSeek and Qwen APIs with one OpenAI-Compatible Endpoint

If you are building with Chinese LLMs, the hard part is often not the first API call. It is keeping model names, billing, fallback behavior, and SDK compatibility consistent while testing DeepSeek, Qwen, Kimi, GLM, Doubao and other models.

ChinaWHAPI provides one OpenAI-compatible base URL:

https://chinawhapi.com/v1
Enter fullscreen mode Exit fullscreen mode

Example with the OpenAI SDK:

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CHINAWHAPI_API_KEY,
  baseURL: "https://chinawhapi.com/v1",
});

const response = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Summarize this in English." }],
  max_tokens: 600,
});

console.log(response.choices[0]?.message?.content);
Enter fullscreen mode Exit fullscreen mode

What to test before production:

  • model availability and access permissions
  • input/output token accounting
  • timeout and 429 handling
  • fallback behavior for safe retryable requests
  • latency and real request cost

Why use a gateway?

A unified gateway lets you keep provider-specific testing while reducing repeated integration work. Instead of building separate SDK wrappers for each Chinese model provider, you can keep the application interface stable and make model choice a configuration decision.

Useful links:

Top comments (0)