China API Gateway for Openclaw

An OpenAI-compatible gateway skill that aggregates, load-balances, and manages routing for Chinese LLM providers like MiMo, DeepSeek, Qwen, and GLM.

qqyougitcom
v1.5.0
Jun 18, 2026
0
462
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install mimo-china-api-gateway

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install mimo-china-api-gateway using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is China API Gateway?

Integrating multiple Chinese AI providers can be highly repetitive and complex, as each platform has its own API format and onboarding flows. The China API Gateway skill solves this by wrapping services like MiMo, DeepSeek, Alibaba Qwen, and Zhipu GLM into a single OpenAI-compatible interface. This allows developers to easily transition between models or stack them to leverage massive free token credits.

As a core integration within your Openclaw Skills ecosystem, this skill simplifies load balancing, failover handling, and cost management. Rather than hardcoding different client SDKs, developers can configure a central, resilient gateway to handle high-frequency requests, automated retries, and prioritized routing across domestic LLMs.

China API Gateway Use Cases

  • Optimized Cost Management: Harvest free tier allowances from various domestic APIs such as MiMo and DeepSeek to run applications at near-zero cost.
  • Production-Grade Failover: Implement automated failover systems that redirect traffic to backup providers if a rate limit (429) or authentication error occurs on your primary endpoint.
  • Unified Codebase Maintenance: Interact with a broad spectrum of specialized models (such as deepseek-coder for coding or CogView for image creation) through a single, clean OpenAI-compatible SDK call.
  • Traffic Distribution: Set up priority, random, or round-robin routing logic to balance request loads across multiple accounts or platforms.

How China API Gateway Works

  1. Analyze Requirements: The skill identifies the user's workload type (e.g., chat, coding, image generation, or embeddings), budget boundaries, and desired capabilities.
  2. Select Target Provider: It matches the workload against a dynamic decision matrix of Chinese LLM providers (e.g., routing 1M long-context code requests to GLM-5.2 or zero-budget chat to MiMo).
  3. Map Endpoints: It standardizes the outbound query format to conform directly with the chosen provider's API structures within the framework of Openclaw Skills.
  4. Execute Load Balancing: If specified in the gateway configuration, the request runs through priority, round-robin, or random routing rules.
  5. Perform Fallback Retries: If the preferred model fails or returns rate-limiting responses, the router automatically attempts the execution on configured backup nodes.

China API Gateway Setup

To initialize the gateway config within your project, follow these setup guidelines.

First, set up your respective provider API Keys in your environment:

export MIMO_API_KEY="your-mimo-key"
export DEEPSEEK_API_KEY="your-deepseek-key"
export ALI_API_KEY="your-alibaba-dashscope-key"

Next, install the required OpenAI Python client:

pip install openai

Deploy a self-hosted API gateway container (using New API or One API) for robust visual routing controls:

docker run -d \
  --name new-api \
  -p 3000:3000 \
  -v ./data:/data \
  calm/new-api:latest

China API Gateway Data Schema & Taxonomy

The skill relies on a structured routing layout and maps incoming requests to corresponding provider metadata as structured below:

Gateway Routing Configuration Schema (gateway.yaml)

Parameter Type Description Required
providers Array A list of structured provider configurations. Yes
routing.strategy String Execution method: priority, round_robin, or random. Yes
routing.fallback Boolean Activates automated failovers to secondary providers. Yes
routing.timeout Integer Connection limit in seconds before fallback triggers. Yes

Example Routing Gateway Object

providers:
  - name: mimo
    base_url: https://api.xiaomimimo.com/v1
    api_key: ${MIMO_API_KEY}
    models: [mimo-v2.5]
    priority: 1
  - name: deepseek
    base_url: https://api.deepseek.com/v1
    api_key: ${DEEPSEEK_API_KEY}
    models: [deepseek-chat]
    priority: 2

China API Gateway Advanced Features

  • Dynamic Priority Routing: Configure multi-provider backends with priority levels to exhaust free credits first, then fall back to paid, highly reliable services.
  • Unified Multi-Model SDK Calls: Toggle from conversing with a 1M long-context model (GLM-5.2) to coding generators (DeepSeek-Coder) seamlessly without modifying application code.
  • One-Click Gateway Deployment: Effortlessly spin up pre-configured, dockerized Open Source gateway interfaces like One API / New API.
  • Streamed Chunk Redirection: Full support for real-time streaming output responses using the OpenAI compatible Python SDK.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*