Minimal, copy-paste examples for calling Chinese frontier models through a single OpenAI-compatible endpoint — chat, image generation, and video generation with one base URL and one API key.
- 🔌 Drop-in OpenAI-compatible — change
base_url, keep your existing OpenAI SDK code. - 🧠 Text: DeepSeek V4, Qwen 3.7, GLM-5.2, Kimi K3 (2.8T MoE · native vision · 1M context), MiniMax M3, Doubao Seed 2.0, Hunyuan.
- 🎨 Image: Doubao Seedream 5.0, Hunyuan Image, cogview-3-flash ($0/image).
- 🎬 Video: Doubao Seedance 2.0, Hunyuan Video, cogvideox-flash ($0/generation).
- 🆓 New keys get $2 free credit, no credit card → https://aiapi-pro.com
Endpoint base URL:
https://aiapi-pro.com/v1Get an API key: https://aiapi-pro.com
from openai import OpenAI
client = OpenAI(
api_key="YOUR_NOVAI_KEY",
base_url="https://aiapi-pro.com/v1",
)
resp = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Explain MoE models in one paragraph."}],
)
print(resp.choices[0].message.content)img = client.images.generate(
model="doubao-seedream-5.0",
prompt="a red panda coding on a laptop, studio ghibli style",
size="2048x2048",
n=1,
)
print(img.data[0].url)Video is asynchronous: submit a job, then poll until it's ready.
import requests, time
BASE = "https://aiapi-pro.com/v1"
H = {"Authorization": "Bearer YOUR_NOVAI_KEY", "Content-Type": "application/json"}
job = requests.post(f"{BASE}/video/generations", headers=H, json={
"model": "doubao-seedance-2.0",
"prompt": "a paper plane flying over a neon city at night, cinematic",
"resolution": "720p",
"duration": 5,
}).json()
task_id = job["id"]
while True:
r = requests.get(f"{BASE}/video/generations/{task_id}",
headers=H, params={"model": "doubao-seedance-2.0"}).json()
if r.get("status") == "succeeded":
print("video:", r["content"]["video_url"])
break
if r.get("status") == "failed":
raise RuntimeError(r)
time.sleep(4)cogview-3-flash (image) and cogvideox-flash (video) are billed at $0 on NovAI — email signup,
no credit card. They are flash-tier models (lower fidelity than Seedream/Seedance), which makes them
ideal for prototyping and CI. Runnable examples:
python/free_video_image.py ·
node/free_video_image.mjs ·
curl/free_video_image.sh
img = client.images.generate(
model="cogview-3-flash", # $0 / image
prompt="isometric illustration of a tiny server room",
)
print(img.data[0].url)Runnable versions of all three are in python/, node/, and curl/. See also the Kimi K3 examples — python/kimi_k3.py · node/kimi_k3.mjs · curl/kimi_k3.sh — chat, streaming, vision, and 1M-token long-context, all drop-in via model="kimi-k3".
| Type | Model IDs |
|---|---|
| Text | deepseek-v4-pro · deepseek-v4-flash · qwen3.7-max · glm-5.2 · kimi-k3 · kimi-k2.6 · minimax-m3 · doubao-seed-2.0-pro |
| Vision | glm-4.6v · glm-4.6v-flash (free) · glm-5v-turbo |
| Image | doubao-seedream-5.0 · doubao-seedream-5.0-pro · hy-image-v3.0 · cogview-3-flash (free) |
| Video | doubao-seedance-2.0 · doubao-seedance-2.0-fast · hy-video-1.5 · cogvideox-flash (free) |
Full list: GET https://aiapi-pro.com/v1/models. Live playground: https://aiapi-pro.com/playground
NovAI is not universally the cheapest — it's a unified gateway. Some models are meaningfully cheaper than other aggregators (e.g. Qwen3.7-Max ~45% cheaper, Doubao-Seed-2.0-Lite ~53% cheaper than OpenRouter), some are at parity (DeepSeek-V4-Pro), and a few cost more. The point of this repo is one API surface for text + image + video across every major Chinese lab, not a price war. Check current numbers at https://aiapi-pro.com/pricing.
- 📝 Walkthrough (dev.to): One OpenAI-compatible API for DeepSeek, Qwen, and Chinese image/video models
- 🆓 Free AI video generation API guide · Free AI image generation API guide
- 💰 Video generation API pricing comparison 2026
- 🌐 Homepage & keys: https://aiapi-pro.com
▶️ Live playground: https://aiapi-pro.com/playground
MIT — see LICENSE. Not affiliated with OpenAI. Model names are trademarks of their respective owners (DeepSeek, Alibaba, Zhipu, ByteDance, Moonshot, MiniMax, Tencent).