DEV Community

YingSuan AI
YingSuan AI

Posted on

Calling Kimi K3 through an OpenAI-compatible API Gateway — a practical walkthrough (with a free tier)

Last week Moonshot AI publicly released the open weights of Kimi K3 — a 2.8-trillion-parameter model with a 1-million-token context, widely rated as one of the strongest open models for coding and agent orchestration. This post shows how to call K3 (plus 9 other models) with a single API key through one OpenAI-compatible gateway, including a no-credit-card free tier.
What is Kimi K3, and why bother?
Kimi K3 is the open-weight model from Moonshot AI (the lab behind the Kimi chatbot). The numbers that matter:
2.8T parameters, Mixture-of-Experts architecture
1M-token context — feed it an entire repo or a long doc
Strong at frontend coding, refactoring, and tool-calling / agent workflows
If you build products, automation scripts, or anything that needs to reason over long text, K3 is worth a look.
The friction of calling Moonshot directly
To call K3 from Moonshot you need an account, a payment method, and your own key management. Want to also try DeepSeek, GLM, or Qwen later? You end up juggling multiple providers, keys, and response formats — more setup than actual coding.
The fix: one gateway, one key, OpenAI shape
Yingsuan AI Gateway puts 10 models (Kimi K3, DeepSeek, GLM, Qwen, MiniMax…) behind a single endpoint with OpenAI-format responses. You only need:
Base URL: https://yingsuan.top/v1
One API key
Any OpenAI client (Python / JS / C# / Go…)
For Southeast Asia-based devs, payment goes through Wise (bank transfer) — no credit card required.
Step 1: Grab a free key (3 models free forever)
Go to https://yingsuan.top/api.html?utm_source=devto&utm_medium=community&utm_campaign=k3_launch , enter your email, get a key instantly. Free tier: 100 requests, 5 req/min, 3 permanently-free models:
glm-4-flash (128K context)
glm-4.7-flash (200K context, solid coding)
Qwen/Qwen2.5-7B-Instruct
Step 2: Try it now with a free model
curl
curl https://yingsuan.top/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4-flash",
"messages": [{"role": "user", "content": "Explain JavaScript Promises in plain English"}],
"max_tokens": 300
}'
Python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://yingsuan.top/v1")

resp = client.chat.completions.create(
model="glm-4-flash",
messages=[{"role": "user", "content": "Write a debounce function in TypeScript"}],
max_tokens=400,
)
print(resp.choices[0].message.content)
Step 3: Call Kimi K3 (requires an upgrade)
K3 is outside the free tier. Upgrade to the Starter plan ($50 one-time) via Wise and it's callable. Code is identical — just change the model:
curl
curl https://yingsuan.top/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3",
"messages": [{"role": "user", "content": "Refactor the following code into async/await..."}],
"max_tokens": 800,
"stream": true
}'
Python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://yingsuan.top/v1")

stream = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Write a small agent that uses tool-calling to check the weather"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
stream: true streams tokens in real time — good for chatbots and agents.
A few things worth noting
1M context: drop a long file into the prompt without truncation.
Drop-in OpenAI: existing code using the openai library just needs a base_url swap.
Streaming works out of the box.
Many models, one key: out of K3? Switch to glm-4.7-flash or DeepSeek without changing keys.
Pricing and payment
Free: 100 requests, 3 models, $0.
Starter: $50 (one-time), unlocks all 10 models, 10 req/min.
Paid via Wise (bank transfer, no card). After transfer, upload the receipt and your key is issued.
Details & upgrade: https://yingsuan.top/payment.html?utm_source=devto&utm_medium=community&utm_campaign=k3_launch
Why it's trustworthy
Yingsuan AI Gateway is listed on the Yunnan Provincial Data Circulation & Trading Platform under a dual-node mechanism — meaning the data sources, metering, transactions, and compliance declarations are all publicly auditable. You're calling a service with a clear legal identity, not an anonymous relay.
Wrap-up
If you want to try K3 without wrangling a dozen provider sign-ups, this gateway is a tidy option: one key, one endpoint, OpenAI shape. Start on the free tier via the link above, call glm-4-flash to confirm it works, then upgrade when you actually need K3.
👉 Start here: https://yingsuan.top/api.html?utm_source=devto&utm_medium=community&utm_campaign=k3_launch

Top comments (0)