Kimi is a model service from Moonshot AI, a Chinese provider, and its China site can be accessed directly without additional networking tools. The "access problems" that teams in China actually run into are usually not an inability to connect, but an account-region mismatch, a wrong endpoint, long-request timeouts, rate limiting, and single points of failure.
This article compares three approaches — direct access, a self-hosted proxy, and a domestic AI gateway — and provides an actionable integration and stability checklist. Models, prices, and availability follow the model pricing page.
Note: Moonshot and Kimi are trademarks of their respective owners. Endpoints, account systems, and rate-limit rules may change. This article reflects common conditions as of October 2026 and defers to the official documentation.
1. Distinguish the Three Entry Points First
| Entry point | Endpoint | Account and billing | Best for |
|---|---|---|---|
| China site (direct) | https://api.moonshot.cn/v1 |
platform.kimi.com, RMB |
Mainland entities, a single model, the shortest path |
| International site (direct) | https://api.moonshot.ai/v1 |
platform.kimi.ai, per international-site rules |
Overseas entities, overseas networks |
| Domestic AI gateway | The unified endpoint provided by the gateway | Gateway account, unified RMB billing | Multiple models, failover, invoicing |
China-site and international-site accounts, balances, and keys are independent. Using a China-site key against the international endpoint, or the reverse, returns 401. This is not a network problem but a region mismatch, and it is the most common "access failure" reported by teams in China.
2. Who Direct Access Suits
Direct access has the shortest path and the fewest variables, which makes problems easier to isolate. It suits the following cases:
- You call only one provider and do not need multi-model routing.
- You have completed enterprise verification and can pay by corporate transfer and receive invoices.
- Your team can handle rate limits, retries, monitoring, and incidents on its own.
- Most requests are short text, with little long-document or long-output traffic.
The weakness of direct access is that it is a single point: if the account, quota, region, or egress network has a problem, there is no backup path. If continuity matters to the business, either build retries and fallback yourself or add a gateway.
A self-hosted proxy is a third option: run a forwarding layer on your own servers to unify egress, hide upstream keys, and record logs. It suits teams with operations capability that do not want to depend on a commercial gateway. But a proxy does not eliminate rate limits or region issues; high availability, certificates, authentication, throttling, and monitoring all become your responsibility, and a poorly run proxy becomes one more point of failure.
3. Five Stability Problems with Direct Access
- Region and key mismatch. The China and international sites are fully isolated, and mixing them returns 401 immediately.
- 504 on long requests. When a non-streaming request waits too long, a gateway may return 504; the official documentation mentions scenarios where the server does not respond for 900 seconds. Prefer streaming for long generations.
- 429 is not always rate limiting. It may be server overload, organization-level RPM/TPM/TPD limits, or an insufficient balance. The three cases require different handling.
- Egress network and proxies. DNS resolution, TLS interception, corporate proxies, and local routing tools can all rewrite requests, showing up as timeouts, 499s, or certificate errors.
- Single point and shared quota. Several workloads sharing one key compete for concurrency and per-minute quota, and fail together at peak.
4. What a Gateway Adds
| Capability | Direct access | Domestic AI gateway |
|---|---|---|
| Multi-model switching | Integrate each provider separately | Unified endpoint and model names |
| Failover | Implement it yourself | Configurable backup channels |
| Billing and invoices | Top up each provider separately | Unified RMB billing |
| Key management | Manage keys per provider | Centralized distribution by the gateway |
| Usage and error monitoring | Build it yourself | Usually built in |
| Latency | Shortest path | One extra hop; measure it |
A gateway is not an "accelerator." It adds a hop and may introduce extra latency; its value lies in a unified entry point, failover, billing, and key isolation. Whether it is worth it should be measured with your own network and real requests, not judged from a marketing page.
5. Minimal Working Integration
- Confirm the account region and choose the matching endpoint.
- Use one minimal request to validate the key, endpoint, and model name together.
- Enable streaming by default for long outputs and long documents.
- Set connection timeouts, read timeouts, and a maximum retry count.
- Log the
request_id, status code, error type, and model name. - Prepare a switchable backup model or backup channel.
- Run a concurrency test before launch to confirm how 429s behave.
export MOONSHOT_API_KEY="your-key"
curl "https://api.moonshot.cn/v1/chat/completions" \
-H "Authorization: Bearer $MOONSHOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2.6",
"max_completion_tokens": 128,
"messages": [{"role": "user", "content": "Reply with OK only"}]
}'
A 200 response means the key, region, and model name are all correct. For 401, check the region and key first; for 404, check the model name; for 429, inspect error.type before touching the prompt.
In production, also enable connection reuse (Keep-Alive) so every request does not require a new handshake. For streaming requests, add heartbeats and idle timeouts to prevent intermediate proxies from cutting connections that stay quiet for too long.
6. Choosing Among the Three Options
| Scenario | Recommendation | Rationale |
|---|---|---|
| Single model, low traffic | China-site direct access | Short path, simple cost structure |
| Multiple models, invoices required | Domestic AI gateway | Unified billing and key management |
| High continuity requirements | Gateway plus a direct backup path | Switchable and degradable |
| Very low latency | Direct access with self-built retries | One fewer hop, but you own disaster recovery |
| Sensitive data, audit requirements | Choose after mapping the data path | Region, retention, and contracts come first |
Whichever you choose, keep one direct path as a control. When something breaks, send the same request to both the direct endpoint and the gateway to determine quickly whether the problem is upstream, the network, or gateway configuration.
FAQ
Does Kimi API require special networking in China?
No. Kimi is a Chinese provider, and the China-site endpoint is directly reachable from mainland China. What you do need to distinguish is the China site from the international site: their accounts, balances, and keys are independent and cannot be mixed.
Will a gateway be slower?
It may be slightly slower because of the extra hop. In most scenarios the difference is acceptable, but measure it on your own network. The main value of a gateway is a unified entry point, failover, and billing.
Why does direct access still return 401?
Check the region first: a China-site key must be paired with the China-site endpoint, and an international-site key with the international endpoint. Then check the product line — keys for the open platform, Kimi Code, and membership products are not necessarily interchangeable.
What should I do if long requests always time out?
Switch to streaming output first, check the SDK and server timeout settings, and confirm that proxies are not closing the connection early. Very long non-streaming requests are more likely to trigger a 504.
Can one key serve multiple workloads?
Technically yes, but it is not recommended. Split keys by project and pair them with budgets and rate limits; that way you can locate problems and prevent one workload from consuming the entire allowance.
Next Steps
Start by creating a test key on the ZSQH AI Gateway, then send the same request to both the direct endpoint and the gateway and compare latency, error rates, and billing before deciding which path production should use. Models and prices follow the model pricing page.
Related reading:
