Kimi K3 API Guide: One Key to Call the Largest Open-Weight Model on EXAIV
Kimi K3 API Guide: One Key to Call the Largest Open-Weight Model on EXAIV
Kimi K3 is Moonshot AI's open-weight flagship released in July 2026: a mixture-of-experts architecture with 2.8 trillion total parameters and roughly 104 billion active per forward pass, a 1,000,000-token context window, and native image plus video understanding. It scores 93.5% on GPQA and 91.2% on AIME, and its 80.6% on the Arena.ai frontend coding benchmark is the best open-weight result. EXAIV's cloud catalog carries it under the model ID kimi-k3, served through a standard OpenAI-compatible endpoint β you keep your existing OpenAI SDK and change three lines of configuration. This guide walks through integration, streaming, structured output, and troubleshooting in one place.
30-second version
Model ID: kimi-k3. Three changes to integrate: set base_url to https://exaiv.com/api/ai/v1, use your EXAIV API key, and set model to kimi-k3. Everything else matches the official OpenAI API, so no SDK swap is needed.
What this model actually is
Kimi K3 was released on July 16, 2026, with full weights published on July 27. What makes it unusual is not a single benchmark number but three things being true at once:
| Dimension | kimi-k3 |
|---|---|
| Total / active parameters | 2.8T / ~104B (MoE) |
| Context window | 1,000,000 tokens (shared input + output) |
| Native multimodality | Image + video |
| GPQA / AIME | 93.5% / 91.2% |
| Arena.ai Frontend Code | 80.6% (best open) |
| Open weights | Yes (custom Kimi license) |
Open weights mean you can run a copy entirely offline. The license has two notable clauses: name display, and additional terms if you offer the model as a service above a $20M revenue threshold. Personal use, research, and internal systems are not affected by those clauses. For developers outside China, that combination β free to self-host and directly callable through one API key β is rare.
Integration steps
Step 1: get an API key. Register on EXAIV and generate a key in the console. Keys are shown once at creation, so save it to an environment variable immediately β never commit it to a repository.
Step 2: confirm the endpoint.
| Setting | Value |
|---|---|
| Base URL | https://exaiv.com/api/ai/v1 |
| Chat endpoint | https://exaiv.com/api/ai/v1/chat/completions |
| Auth | Authorization: Bearer <API Key> |
Step 3: set model to kimi-k3. Runnable examples in three languages follow.
Verify with curl
Confirm the pipeline works with curl before touching your SDK code:
curl https://exaiv.com/api/ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $EXAIV_API_KEY" \
-d '{
"model": "kimi-k3",
"messages": [
{"role": "system", "content": "You are a precise technical assistant"},
{"role": "user", "content": "Explain how MoE saves compute in three sentences"}
]
}'
The response shape matches the official OpenAI API: choices[0].message.content holds the answer and usage reports the tokens consumed.
Python
from openai import OpenAI
const client = new OpenAI({
apiKey: process.env.EXAIV_API_KEY,
baseURL: "https://exaiv.com/api/ai/v1",
});
const resp = await client.chat.completions.create({
model: "kimi-k3",
messages: [
{ role: "user", content: "Turn this requirement into a development task list" },
],
});
console.log(resp.choices[0].message.content);
Streaming output
Interactive interfaces should always stream, otherwise users stare at a blank screen. kimi-k3 supports standard SSE streaming:
stream = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Compare open weights versus closed API access"}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta
if delta and delta.content:
print(delta.content, end="", flush=True)
For SSE event parsing and reconnection logic, see the streaming guide. On long answers kimi-k3 stays coherent, which makes the streamed experience feel close to a local chat session.
Structured output
For data processing, ticket classification, and information extraction, asking the model to return JSON directly is far more reliable than post-hoc regex parsing. kimi-k3 supports strict structured output:
resp = client.chat.completions.create(
model="kimi-k3",
messages=[
{"role": "system", "content": "Extract people, companies, and dates from text, output JSON"},
{"role": "user", "content": "Zhang San met Li Si in Hangzhou last Friday to discuss a partnership"},
],
response_format={"type": "json_object"},
)
print(resp.choices[0].message.content)
Troubleshooting common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 Unauthorized | Wrong or deleted key | Regenerate the key, verify the env var is loaded |
| 404 model not found | Typo in model, or catalog change | Check the current ID on the models page |
| 429 | Concurrency or rate limit hit | Add backoff and retry, reduce concurrency |
| Truncated replies | max_tokens set too low | Raise max_tokens or generate in batches |
| Input rejected as too long | Input exceeds the context window | Rare at 1M tokens; check for duplicated concatenation first |
For general engineering practices β exponential backoff, idempotency, handling mid-stream failures β see the error-handling guide.
Model IDs follow the live catalog
kimi-k3 is the real ID in EXAIV's catalog as of this writing. Catalogs change as upstreams update, so verify the current ID on the models page before shipping to avoid 404s on stale names.
Cloud API or self-hosting
Both routes are legitimate; pick by scenario:
- Cloud API (EXAIV): best for production. No GPU management, no upgrade maintenance, token-based billing, elastic capacity. The 1M-token context covers most business workloads.
- Self-hosting (open weights): best for privacy-sensitive teams, air-gapped environments, or deep fine-tuning. The K3 weights are public; local deployment goes through community GGUF, with VRAM planning and step-by-step instructions in the local deployment guide.
The decision rule is simple: if your data cannot leave your infrastructure and you have compute budget, self-host; if you want fastest time-to-production and operational stability, use the cloud. Replay the same prompt set on both and the outputs should be consistent.
Sending images for analysis
K3 is natively multimodal, so the same chat endpoint accepts images alongside text. The standard multimodal message format takes base64 data URLs or public URLs:
import base64
with open("chart.png", "rb") as f:
data_url = "data:image/png;base64," + base64.b64encode(f.read()).decode()
resp = client.chat.completions.create(
model="kimi-k3",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Describe the trend in this chart and list the outliers"},
{"type": "image_url", "image_url": {"url": data_url}},
],
}],
)
This unlocks screenshot-to-UI workflows, document understanding, and video-input agents without a separate vision API. The full screenshot-to-frontend walkthrough lives in the vibe coding guide.
Key parameters worth knowing
Most OpenAI parameters behave identically; a few deserve deliberate choices on a 1M-context model:
| Parameter | Guidance |
|---|---|
max_tokens | Cap it deliberately β output occupies the shared window |
temperature | Lower for extraction and structured tasks, higher for ideation |
response_format | Use json_object for machine-consumed output |
stream | Always stream for interactive surfaces |
tools | Standard function definitions; K3 supports dynamic tool loading |
Using it inside frameworks
Because the endpoint is OpenAI-compatible, popular frameworks connect with one configuration change. A LangChain example:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="kimi-k3",
api_key=os.environ["EXAIV_API_KEY"],
base_url="https://exaiv.com/api/ai/v1",
)
LlamaIndex, Dify, LobeChat, and Cherry Studio follow the same pattern β set the base URL, paste the key, name the model. Nothing else changes.
Environment setup done right
Most first-run failures are configuration, not code. A setup that avoids the usual traps:
# .env β never commit this file
EXAIV_API_KEY=sk-...your-key...
EXAIV_BASE_URL=https://exaiv.com/api/ai/v1
import os
from dotenv import load_dotenv
from openai import OpenAI
load_dotenv()
client = OpenAI(
api_key=os.environ["EXAIV_API_KEY"],
base_url=os.environ["EXAIV_BASE_URL"],
)
Three habits worth adopting from day one: load keys from the environment rather than literals (keeps them out of version control and logs), keep the base URL in configuration too (makes switching between EXAIV and a local deployment a one-line change), and add the key to your secret manager's rotation schedule so a leaked key has a bounded lifetime. The API key rotation guide covers the operational side.
Error codes reference
The compatibility layer maps errors onto standard HTTP semantics:
| Code | Meaning | Typical fix |
|---|---|---|
| 400 | Malformed request | Validate JSON body and parameter types |
| 401 | Key invalid or revoked | Regenerate; check trailing whitespace in env vars |
| 404 | Unknown model or path | Confirm the model ID against the live catalog |
| 413 | Payload too large | Trim inputs; compress images before sending |
| 429 | Rate limited | Exponential backoff with jitter |
| 5xx | Upstream issue | Retry with backoff; check status page |
Wrap your client with a thin retry helper that treats 429 and 5xx as retryable and everything else as fail-fast β that single decision prevents both silent data loss and retry storms. The full error-handling guide has ready-made backoff implementations.
A note on latency
Expectations should differ by request shape. Short prompts on a fast path typically return within seconds, while long-context requests scale with input size β reading 100K tokens takes measurably longer than 1K, on any model. Design for this: keep interactive calls short-context and reserve the deep-context reads for background or streamed work. If a UI must wait on a long request, stream the response so users see progress instead of a spinner, and consider kicking off the heavy call asynchronously while the interface renders a skeleton. Latency tuning after this comes down to prefix caching (stable system prompts), smaller inputs (the selection stage from earlier), and honest budget-setting with stakeholders about what deep reading costs in wall-clock time.
Limitations and scope
This guide covers integration and calling patterns, not model quality judgments. Benchmark numbers quoted here come from the official Kimi model card, not from our own testing; we did not independently re-run them. The catalog changes as upstreams update, so the model IDs in this article reflect the live catalog only as of the publication date. Pricing is deliberately not hard-coded β check the pricing page for current rates. Long-context, multimodal, and agent behavior described here follows documented capabilities; verify edge cases against your own prompts before shipping to production.
FAQ
Is the kimi-k3 on EXAIV the same as the official Kimi?
Do I need a Moonshot account?
Can kimi-k3 process images and video?
What does a 1M-token context mean in practice?
Where do I find pricing?
What does the weight license restrict commercially?
What this article answers
- how to integrate the Kimi K3 API
- how to call kimi-k3 with one key
- how to write streaming and structured output
Use-case quick map
| If you need to | Go to |
|---|---|
| get integration working fast | Integration steps |
| analyze an image | Sending images |
| diagnose errors | Troubleshooting common errors |
Looking ahead
Catalogs and weights keep evolving; the integration and calling conventions here follow the official documentation at publication time.
Sources and verification
Key facts in this article come from the official Kimi K3 model card, the EXAIV models page, and the OpenAI API reference and were verified on 2026-11-09. Model IDs, pricing, and availability follow the platform's live catalog β deliberately no hard-coded numbers that go stale. Code samples follow the API contract at publication time; check the official docs before wiring anything into production.
Scope and audience
Audience: developers integrating Kimi K3 into an application. Covered: integration configuration, calling, streaming, structured output, and common troubleshooting. Not covered: model internals, fine-tuning methods, or pricing negotiation.
Editorial note and corrections
Written by the EXAIV content team from verifiable facts, with sources and code checked before publication. If anything is outdated or incorrect, the official release page and the live catalog take precedence β tell us through the page feedback channel so we can correct it.
Related reading
- Kimi K3 and GLM Integration Guide β dual-flagship comparison and task routing
- Kimi K3 Long-Context Guide β long-document patterns
- Screenshot-to-UI with Kimi K3 β multimodal coding workflow
- OpenAI SDK Migration β general migration steps
- Qwen API Troubleshooting β general API error diagnosis