DEV Community

ModelSite
ModelSite

Posted on Originally published at modelsite.ai AI-assisted

One OpenAI-compatible API key for DeepSeek, Qwen and GLM

Trying DeepSeek, Qwen and GLM on the same task usually means juggling three vendor dashboards: separate sign-ups, separate billing, and rate-limit rules that never match. If your code already calls the OpenAI API, you can reuse it as-is.

One endpoint, one key

ModelSite exposes an OpenAI-compatible endpoint at https://api.modelsite.ai/v1. You authenticate with a single key (it starts with sk-ms-) in the Authorization: Bearer header and pick the model with the model field. Nothing else about the request changes.

Try it with curl

curl https://api.modelsite.ai/v1/chat/completions \
  -H "Authorization: Bearer $MODELSITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Explain TCP slow start in two sentences."}]
  }'
Enter fullscreen mode Exit fullscreen mode

Switch models by changing one string

With the official OpenAI Python SDK, point base_url at ModelSite and loop over model names. Request and response formats are identical for every model, so your parsing and error handling stay as they are.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MODELSITE_API_KEY"],
    base_url="https://api.modelsite.ai/v1",
)

for model in ["deepseek-v4.1-flash", "qwen3.7-plus", "glm-5.3-flash"]:
    resp = client.chat.completions.create(
        model=model,
        messages=[{"role": "user", "content": "Explain TCP slow start in two sentences."}],
    )
    print(model, "->", resp.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

What each model costs

We don't paste prices here because they change; the pages below always show current numbers for per-million-token pricing, context length, cache pricing and off-peak discounts:

Already using the Anthropic SDK?

ModelSite also exposes an Anthropic-compatible endpoint (same keys, different base URL). The SDK guide lists the base URL and the authentication difference.

Calling each vendor directly

If you'd rather call each vendor yourself, their official docs are the source of truth: DeepSeek, Qwen on Alibaba Cloud, and GLM from Zhipu. You'll do the setup three times, but every call then goes straight to the vendor. The OpenAI Python SDK repo documents the client options used above.

Originally published on the ModelSite blog on 2026-10-22.

Top comments (0)