Kimi K3 API: Access and Usage Guide (Python + curl)
Released by Moonshot AI on July 16, 2026, Kimi K3 has visibly raised the bar for open-weight models: a roughly 2.8-trillion-parameter Mixture-of-Experts architecture, a 1-million-token context window, and 4th place out of 189 models on the Artificial Analysis index. This guide covers what K3 actually brings, where it stands against the Claude and GPT families, how to get API access step by step, and how to make your first call with Python and curl. Every example runs against Onysoft AI Gateway's OpenAI-compatible endpoint, so if you already use the OpenAI SDK, switching is a two-line change.
What Kimi K3 Brings
Kimi K3 is Moonshot AI's new flagship, and it ships open-weight. Under the hood is a Mixture-of-Experts design with roughly 2.8 trillion parameters; because only a subset of the expert networks activates per request, that enormous scale lifts quality while keeping inference manageable.
Three features stand out in practice:
- A 1M-token context window (1,048,576 tokens exactly) — enough to carry a multi-file codebase, a stack of long contracts, or the full history of an extended agent session in a single request.
- Built-in vision — screenshots, diagrams, and document images are processed through the same endpoint, with no separate vision model required.
- Always-on reasoning — there is no separate "thinking mode" to toggle; the model applies its reasoning layer to every response.
The API identifier is moonshotai/kimi-k3, callable from any OpenAI-compatible SDK or tool. Notably, there is no long-context surcharge: pricing stays flat across the entire 1M window. We cover the details in the pricing section below.
Benchmark Standing: Where K3 Lands Against the Competition
On the Artificial Analysis Intelligence Index, Kimi K3 scores 57, placing 4th out of 189 models. Only two closed models rank ahead of it: Claude Fable 5 and GPT-5.6 Sol in their reasoning configurations. It sits ahead of Claude Opus 4.8, GPT-5.5, Claude Sonnet 5, and GLM-5.2 — which makes K3 the strongest open-weight model on the index.
The domain scores are equally strong: a coding score of 76.2 puts it in the 98th percentile, and it reaches 93.5 on GPQA, the PhD-level scientific reasoning benchmark. For code generation, multi-step analysis, and technical document processing, it genuinely plays in the same league as the closed flagships.
The neutral read: the absolute quality ceiling still belongs to Fable 5 and GPT-5.6 Sol. K3's claim is being the open-weight model that gets closest to that ceiling — while combining 1M context, vision, and reasoning in a single model. The most reliable comparison for your own workload is running the same prompt against several models side by side in the Playground.
Getting Kimi K3 API Access, Step by Step
You don't need a separate Moonshot AI contract to use Kimi K3 — Onysoft AI Gateway exposes it through a single OpenAI-compatible API, and setup takes about five minutes:
- Create a free account — pay-as-you-go, no subscription or monthly commitment.
- Generate an API key with the
sk-ony-prefix from the dashboard. - Add balance; usage is deducted as you go, and you can see per-request costs in the panel.
- Try
moonshotai/kimi-k3in the Playground before writing code — running the same prompt against the economical Kimi K2.x models side by side is the fastest way to pick the right tier. - Point your SDK's
base_urltohttps://api.onysoft.com/v1, set the model name, and ship.
If you already have an OpenAI integration, migration is a two-line change: base_url and model. The same key unlocks the entire 708+ model catalog — one balance, one invoice, one API. Teams in Türkiye additionally get local-currency billing and compliant corporate e-invoicing out of the box.
First Request with Python and curl
Because the Onysoft endpoint follows the OpenAI schema exactly, the official openai Python package works as-is:
from openai import OpenAI
client = OpenAI(
base_url="https://api.onysoft.com/v1",
api_key="sk-ony-YOUR_KEY",
)
response = client.chat.completions.create(
model="moonshotai/kimi-k3",
messages=[
{"role": "user", "content": "Extract the risky clauses from this contract set as a bullet list."}
],
)
print(response.choices[0].message.content)The same request with curl:
curl https://api.onysoft.com/v1/chat/completions \
-H "Authorization: Bearer sk-ony-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "moonshotai/kimi-k3",
"messages": [{"role": "user", "content": "Summarize the difference between Kimi K3 and the K2.x models."}]
}'Add "stream": true to the request body for streaming; function calling (tools) and JSON mode use the same schema as well. For image input, use the standard OpenAI image_url content blocks on the same endpoint — K3's vision is built in, so there is no separate model to select. Full parameter references, error codes, and per-language examples are in the API documentation.
Pricing and Cost Strategy: K3 or K2.x?
Kimi K3 pricing on Onysoft is straightforward: $4.50 per 1M input tokens and $22.50 per 1M output tokens. The detail that matters most: there is no long-context surcharge. While many providers step prices up once prompts cross a threshold, K3 keeps the same rate across the entire 1M window — a real advantage for keeping huge-context workloads predictable.
Does every job need K3? No. The economical members of the Kimi family — kimi-k2.5, kimi-k2.6, and the code-focused kimi-k2.7-code — are in the catalog too; current pricing is on the models page. A practical division of labor:
- Send to K3: steps that need complex reasoning, repo-scale code analysis, combined image-plus-text work, and long agent sessions.
- Send to K2.x: high-volume summarization, classification, and extraction endpoints; for routine code completion,
kimi-k2.7-codeis the economical alternative. - Model your monthly spend in the cost calculator, and see our cost optimization guide for the finer points of tiered model routing.
In short: K3 for the steps that define quality, K2.x for the steps that carry volume — in most production architectures, that two-tier setup yields the best price-performance balance.
Frequently Asked Questions
How do I get Kimi K3 API access?
Sign up for Onysoft AI Gateway, generate an sk-ony- prefixed API key from the dashboard, and add balance. Then point any OpenAI-compatible SDK at https://api.onysoft.com/v1 and set the model to moonshotai/kimi-k3. There is no separate Moonshot AI contract, waitlist, or subscription — it's pay-as-you-go from the first request.
How much does Kimi K3 cost?
On Onysoft, Kimi K3 is priced at $4.50 per 1M input tokens and $22.50 per 1M output tokens, on a pay-as-you-go basis. There is no long-context surcharge — the same rate applies across the entire 1M-token window, which keeps large-context workloads predictable to budget.
What is Kimi K3's context window?
Kimi K3 offers a full 1,048,576-token (1M) context window — enough to process multi-file codebases, long contract sets, or the complete history of an extended agent session in a single request. Pricing stays flat across the whole window, with no long-context surcharge. Vision is built in, so images go in the same request.
Where does Kimi K3 rank on benchmarks?
It scores 57 on the Artificial Analysis Intelligence Index, ranking 4th out of 189 models; only Claude Fable 5 and GPT-5.6 Sol in their reasoning configurations rank higher. It places ahead of Claude Opus 4.8, GPT-5.5, Claude Sonnet 5, and GLM-5.2. Its coding score is 76.2 (98th percentile) and its GPQA score is 93.5, making it the strongest open-weight model on the index.
Will my existing OpenAI code work with Kimi K3?
Yes. The Onysoft endpoint is fully OpenAI-compatible: in the official openai SDK, change base_url to https://api.onysoft.com/v1 and set the model to moonshotai/kimi-k3 — that's the entire migration. Streaming, function calling, JSON mode, and image input work unchanged, and the same key gives you access to the rest of the model catalog.
Related pages
Ready to build?
Access 708+ AI models through a single API. Pay as you go — no subscription.