惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
C
CXSECURITY Database RSS Feed - CXSecurity.com
A
Arctic Wolf
Know Your Adversary
Know Your Adversary
T
Tor Project blog
C
Cisco Blogs
G
GRAHAM CLULEY
S
Schneier on Security
AWS News Blog
AWS News Blog
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
S
SegmentFault 最新的问题
S
Security Affairs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
J
Java Code Geeks
美团技术团队
Hacker News - Newest:
Hacker News - Newest: "LLM"
U
Unit 42
Latest news
Latest news
T
Tailwind CSS Blog
GbyAI
GbyAI
月光博客
月光博客
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
Forbes - Security
Forbes - Security
S
Securelist
AI
AI
Recent Announcements
Recent Announcements
C
Check Point Blog
I
Intezer
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU
Hacker News: Ask HN
Hacker News: Ask HN
O
OpenAI News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
V2EX - 技术
V2EX - 技术
Y
Y Combinator Blog
博客园 - 【当耐特】
aimingoo的专栏
aimingoo的专栏
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Register - Security
The Register - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How to Access 50+ Chinese AI Models Through One API Endpoint
Mattias chaw · 2026-06-19 · via DEV Community

Here's a scenario you've probably lived through: you read a benchmark showing DeepSeek V4 Pro crushing GPT-4o on reasoning tasks. You want to try it. So you sign up for a DeepSeek API key, write a wrapper, swap out your OpenAI client, and test it. Then someone posts about GLM-5's vision capabilities. New account. New API key. New client. Then Qwen-3 comes along. Then MiniMax. Then SenseTime.

By week three you're juggling six API keys, four SDKs, three different authentication schemes, and a billing dashboard for every Chinese AI lab in existence. The promise of cheap inference turns into expensive integration work.

There's a better way. AIWave aggregates 50+ Chinese AI models behind a single OpenAI-compatible endpoint. One API key. One base URL. Change a model name string to switch between DeepSeek, GLM, Qwen, Moonshot, MiniMax, StepFun, and dozens more. Zero client code changes if you're already using the OpenAI SDK.

In this post I'll walk through how the aggregation layer works, show live code from first request to production deployment, and explain why architectural decisions like response streaming and fallback routing matter when you're routing between 50 different model providers.


The Fragmentation Problem Nobody Talks About

Before diving into the solution, let's quantify the problem. Here's what it takes to use Chinese AI models directly:

Provider Auth Method Base URL SDK Rate Limit Docs
DeepSeek API Key api.deepseek.com/v1 OpenAI-compatible Separate dashboard
Zhipu (GLM) JWT Token open.bigmodel.cn/api/paas/v4 zhipuai SDK Per-model quotas
Qwen (Alibaba) API Key (DashScope) dashscope.aliyuncs.com dashscope SDK Token-based buckets
Moonshot (Kimi) API Key api.moonshot.cn/v1 OpenAI-compatible Per-minute limits
MiniMax API Key + Group ID api.minimax.chat/v1 Custom SDK TPM-based
StepFun API Key api.stepfun.com/v1 OpenAI-compatible Account tier
SenseNova API Key + Secret api.sensenova.cn/v1 Custom SDK Concurrency limits
ByteDance (Doubao) AK/SK + Token ark.cn-beijing.volces.com volcenginesdk Complex quota

That's eight providers with eight different auth flows, eight billing consoles, and eight places where a token refresh can break your pipeline at 3 AM. The OpenAI-compatible ones reduce SDK fragmentation, but the operational overhead of managing keys, quotas, and failover logic across providers remains.

AIWave collapses this into a single surface:

POST https://api.aiwave.live/v1/chat/completions
Authorization: Bearer sk-aiwave-xxxxxxxx
Content-Type: application/json

{
  "model": "deepseek/deepseek-v4-pro",
  "messages": [{"role": "user", "content": "Explain the PageRank algorithm"}]
}

Change model to zhipu/glm-5.1 and you're talking to GLM. Change it to qwen/qwen3-max and you're on Qwen. Same endpoint. Same auth header. Same response format. That's the promise. Let's see how it actually works.


First Request: DeepSeek V4 Pro in 4 Lines

If you've got the OpenAI Python SDK installed, you already have everything you need:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.aiwave.live/v1",
    api_key="sk-aiwave-your-key-here"
)

response = client.chat.completions.create(
    model="deepseek/deepseek-v4-pro",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain TCP congestion control in two paragraphs."}
    ],
    temperature=0.7,
    max_tokens=1024
)

print(response.choices[0].message.content)

That's it. No new SDK. No new import. If you're already using openai>=1.0.0, you change two variables and keep shipping.

Here's the same thing with curl:

curl -X POST https://api.aiwave.live/v1/chat/completions \
  -H "Authorization: Bearer sk-aiwave-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-v4-pro",
    "messages": [{"role": "user", "content": "Explain how B+ trees work in 3 sentences."}]
  }'

Response format is identical to OpenAI:

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1718800000,
  "model": "deepseek-v4-pro",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "A B+ tree is a self-balancing tree structure where..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 32,
    "completion_tokens": 67,
    "total_tokens": 99
  }
}


Switching Models Mid-Conversation

This is where the unified API gets genuinely useful. Imagine an app that routes different types of queries to different models based on capability and cost:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.aiwave.live/v1",
    api_key="sk-aiwave-your-key-here"
)

def route_query(user_input: str, task_type: str) -> str:
    model_map = {
        "reasoning":    "deepseek/deepseek-v4-pro",
        "creative":     "moonshot/kimi-k2-thinking",
        "vision":       "zhipu/glm-5.1",
        "code":         "qwen/qwen3-coder-plus",
        "translation":  "qwen/qwen3-max",
        "fast_chat":    "deepseek/deepseek-v4-turbo",
        "agent_tool":   "minimax/minimax-m1",
    }

    model = model_map.get(task_type, "deepseek/deepseek-v4-pro")

    response = client.chat.completions.create(
        model=model,
        messages=[
            {"role": "system", "content": "You are a precise, technical assistant."},
            {"role": "user", "content": user_input}
        ],
        temperature=0.3 if task_type == "reasoning" else 0.8,
        max_tokens=2048
    )

    return response.choices[0].message.content

# Usage
print(route_query("Write a recursive Fibonacci with memoization in Rust", "code"))
print(route_query("Describe what's happening in this chart", "vision"))
print(route_query("Translate this legal document to French", "translation"))

One client instance, one API key, seven different models from four different Chinese AI labs. The route_query function doesn't care which provider is behind the model string -- that's the aggregation layer's problem.


Streaming: Same Code, Different Models

Streaming is where API compatibility really earns its keep. The OpenAI SDK handles chunk parsing, reconnection, and buffered line reading. If your proxy is truly compatible, streaming just works:

from openai import OpenAI
from concurrent.futures import ThreadPoolExecutor

client = OpenAI(
    base_url="https://api.aiwave.live/v1",
    api_key="sk-aiwave-your-key-here"
)

def stream_compare(prompt: str, models: list[str]):
    """Stream responses from multiple models simultaneously for comparison."""

    def stream_one(model: str):
        print(f"\n=== {model} ===")
        stream = client.chat.completions.create(
            model=model,
            messages=[{"role": "user", "content": prompt}],
            stream=True,
            max_tokens=512
        )
        for chunk in stream:
            if chunk.choices[0].delta.content:
                print(chunk.choices[0].delta.content, end="", flush=True)
        print()

    with ThreadPoolExecutor(max_workers=len(models)) as executor:
        executor.map(stream_one, models)

stream_compare(
    "Write a haiku about floating point precision errors",
    ["deepseek/deepseek-v4-pro", "moonshot/kimi-k2-thinking", "qwen/qwen3-max"]
)

No per-provider stream handling. No custom iterators for Qwen's event format vs DeepSeek's SSE implementation. The proxy normalizes all of it upstream.


Production Patterns: Load Balancing and Fallback

A unified API endpoint enables patterns that are genuinely hard to build when you're wiring up individual providers. Here's a production-grade router with fallback logic:

import time
from openai import OpenAI, APIError, APITimeoutError

client = OpenAI(
    base_url="https://api.aiwave.live/v1",
    api_key="sk-aiwave-your-key-here",
    timeout=60.0
)

FALLBACK_CHAIN = {
    "deepseek/deepseek-v4-pro": [
        "deepseek/deepseek-v4-pro",
        "qwen/qwen3-max",
        "zhipu/glm-5.1",
    ],
    "zhipu/glm-5.1": [
        "zhipu/glm-5.1",
        "qwen/qwen3-max",
        "deepseek/deepseek-v4-turbo",
    ],
}

def robust_completion(model: str, messages: list, max_retries: int = 3):
    fallback_models = FALLBACK_CHAIN.get(model, [model])

    for attempt, fb_model in enumerate(fallback_models):
        try:
            return client.chat.completions.create(
                model=fb_model,
                messages=messages,
                temperature=0.7,
                max_tokens=2048
            )
        except (APIError, APITimeoutError) as e:
            if attempt < len(fallback_models) - 1:
                print(f"[WARN] {fb_model} failed ({type(e).__name__}), "
                      f"falling back to {fallback_models[attempt + 1]}")
                time.sleep(1 * (attempt + 1))  # Linear backoff
                continue
            raise

    raise RuntimeError(f"All fallbacks exhausted for {model}")

This pattern alone would require a mess of conditional imports and per-provider exception handling without a unified endpoint. With AIWave's aggregation layer, it's one client instance and a list of model strings.


What's Actually Behind the Curtain

The unified API isn't magic. It's a proxy layer that handles:

1. Authentication translation. Your sk-aiwave-* key maps to the appropriate provider key on AIWave's backend. Each request gets the correct auth header injected for the target provider.

2. Schema normalization. Not every provider implements the OpenAI spec identically. Some use top_p differently. Some require max_tokens to be within model-specific ranges. Others send usage statistics in a slightly different JSON structure. The proxy normalizes requests and responses so the client sees a consistent interface.

3. Response streaming standardization. Server-Sent Events (SSE) implementations vary across providers. Some chunk on token boundaries, others on word boundaries. Some include finish_reason in the final chunk, others in a separate [DONE] frame. The proxy standardizes chunking behavior.

4. Rate limiting and quota management. Instead of tracking eight different rate limit schemes, you get one unified quota on your AIWave account. The platform handles per-provider rate limits internally.


Model Availability: What's Actually Under One Roof

Here's a snapshot of what's available through the /v1/models endpoint as of June 2026:

Provider Model Count Flagship Best For
DeepSeek 5 deepseek-v4-pro Reasoning, math, code
Zhipu (GLM) 6 glm-5.1 Vision, bilingual, multimodal
Qwen (Alibaba) 8 qwen3-max General purpose, translation
Moonshot (Kimi) 4 kimi-k2-thinking Long context, creative writing
MiniMax 3 minimax-m1 Agent tools, function calling
ByteDance (Doubao) 4 doubao-2.0-pro Fast inference, cheap
StepFun 3 step-3-flash Vision, OCR
SenseNova 3 sensenova-6 Domain-specific (medical, legal)
01.AI (Yi) 3 yi-vision-v3 Open-source focused
Baidu (ERNIE) 3 ernie-5.0 Chinese enterprise
Other providers 10+ - Various

That's roughly 50+ models from 10+ providers, all accessible through the same POST /v1/chat/completions call.


Performance Considerations: Latency and Throughput

Routing through a proxy adds a hop. The question is whether the added latency matters. From production testing:

Scenario Direct Provider Through AIWave Overhead
DeepSeek V4 Pro (first token) 420ms 445ms 25ms (~6%)
GLM-5.1 (first token) 380ms 410ms 30ms (~8%)
Qwen3-Max (completion) 2.3s 2.39s 90ms (~4%)
Streaming throughput 85 t/s 83 t/s 2 t/s (~2%)

The overhead is minimal -- typically 20-50ms for request routing and auth injection. For most use cases (chat, code generation, content creation), it's imperceptible. The real wins come from eliminating the operational complexity of multi-provider management.


When Not to Use a Unified API

The aggregation approach isn't always the right call. Specific scenarios where direct provider access makes sense:

  • Absolute minimum latency. If you're streaming audio in real time and every 20ms counts, go direct.
  • Provider-specific features. DeepSeek's reasoning_effort parameter or GLM's web_search tool calling are provider-specific extensions. Some proxies pass these through; some don't.
  • Fine-tuned models deployed on a specific provider. If you've fine-tuned on Qwen's infrastructure, you're tied to their endpoint.
  • Data residency requirements. If your compliance framework requires data to never touch a third-party proxy, direct access is your only option.

For 90% of use cases -- building apps, prototyping, internal tools, content pipelines -- the unified API is the pragmatic choice.


Getting Started

Head to aiwave.live and grab an API key. The free tier includes a generous token allowance for testing.

The platform is built for teams that want to experiment across the Chinese AI ecosystem without the integration tax. One endpoint, one SDK, 50+ models. Swap model names. Ship faster.


This post is part of the **AIWave* series exploring the economics and engineering of Chinese AI models. Start building at aiwave.live.*