Kimi API Developer Hub

The Kimi API gives developers programmatic access to Moonshot AI’s models through OpenAI-compatible HTTP endpoints. This hub organizes our independent setup guides, model references, pricing notes and test methodology in one place.

We use official Kimi API documentation as the primary source, then separate documented capabilities from anything we have tested ourselves. A code sample is not described as “verified” until we have executed it, recorded the model and date, removed secrets and documented the test limits.

Start here: Read the Kimi API setup guide for the endpoint, authentication and first request. Check Kimi API pricing before running a large prompt.

Kimi API essentials

ItemCurrent value
API base URLhttps://api.moonshot.ai/v1
Chat endpointPOST /chat/completions
AuthenticationAuthorization: Bearer $MOONSHOT_API_KEY
Main interfaceOpenAI-compatible Chat Completions format
Current flagship modelkimi-k3
Coding-focused modelkimi-k2.7-code
General-purpose alternativekimi-k2.6
BillingPay as you go; input, cached input and output priced separately

Kimi documents compatibility with the OpenAI SDKs for Python and Node.js. Compatibility refers to the request and response format; Kimi-specific parameters and feature behavior still require Kimi’s documentation.

Developer guides

Kimi API: setup and first request

Create a key, store it safely and send a minimal request using cURL, Python or Node.js. The guide also covers response usage fields, common errors and a pre-production checklist.

Kimi API Tool Calling: Python, Node.js & 8/8 Test

Implement Kimi function tools with allowlisted handlers, strict argument validation and bounded multi-turn loops. The guide includes Python and Node.js examples plus a downloadable offline kit built from our retained 8/8 single-pass K3 tool-selection pilot.

Kimi API Errors: Private Decoder and Fix Guide

Decode Kimi API HTTP statuses and documented error types in a deterministic browser-local tool. It provides redaction guidance, retry boundaries and safe next actions without sending the entered diagnostic data to Kimi or storing it in the browser.

Kimi Code CLI: Setup, Models and Login Test

Install the official CLI, distinguish Kimi Code model labels from Open Platform model IDs and review our dated setup and authentication record. The attempted first-project run stopped at membership verification, so the page does not claim a completed code-quality test.

Kimi API pricing explained

Compare current K3, K2.7 Code and K2.6 rates. Includes arithmetic examples for cached and uncached input, the separate web-search fee and Batch API pricing.

Kimi API Cost Calculator

Estimate cached and uncached input, output, eligible Batch discounts and web-search charges without entering an API key. Use it for workload planning; the live Open Platform remains the billing authority.

Testing methodology

See how KI AI Team designs reproducible model and product tests, records parameters, handles nondeterminism and separates observed results from vendor claims.

Kimi API reliability lab

These pages are bounded implementation tests, not duplicates of the setup or pricing guides. The Kimi API setup guide owns authentication and the first request, while Kimi API pricing owns general rate intent. Custom function execution stays in the Tool Calling guide; Official Tools covers Kimi-hosted Formula tools. Files API lifecycle testing is separate from uploading files inside Kimi Chat.

Kimi API Streaming: SSE, Usage & Tool Deltas

Inspect sanitized SSE locally and rebuild content, usage and fragmented tool arguments. The frozen text stream passed once; the separately frozen specific-tool request returned HTTP 400 before SSE and was not retried.

Kimi API Structured Output & JSON Schema Test

Validate JSON and supported schema rules locally, then review a 15-case live matrix. K3 and K2.7 Code passed 5/5 each; K2.6 returned empty visible content at the frozen limits and passed 0/5.

Kimi Files API: Upload, Extract, Q&A & Delete

Follow one synthetic PDF through upload, extraction, Q&A and delete. Extraction passed 10/10, strict Q&A passed 2/5, and the final verification GET returned HTTP 500; DOCX and CSV remained not run under the frozen stop rule.

Kimi API Context Caching: Hits, Cost & Latency

Compare fixed and mutated prefixes using retained token, latency and cost data. The cached-token sequence was 0/937/0/937, while all four visible exact-answer checks failed at the frozen K2.6 output limits.

Kimi Batch API: JSONL, Status & Cost Test

Validate JSONL locally and inspect one six-request Batch. Answers matched 6/6, but the nested status field matched the documented 200 example 0/6 and owned-file verification remained cleanup-pending after HTTP 500 responses.

Kimi API Official Tools: Formula Test & Trace

Separate Kimi-hosted Formula tools from developer-defined functions. All three synthetic tool chains completed and two answers matched exactly; the date case failed without isolating the cause between model choice, Formula handling and contract ambiguity.

Model references

Kimi K3

Kimi’s current flagship API model has a documented one-million-token context window, native visual input and configurable reasoning effort. Use it when long context or the strongest available model capability matters more than the lowest token rate.

Kimi K2.7 Code

A coding-focused model with a 256K context window and text, image and video input. Kimi offers standard and high-speed API variants. Do not confuse the API model with the ready-made Kimi Code membership product.

Kimi K2.6

A general-purpose model with a 256K context window and thinking and non-thinking modes. Its published API price is lower than K3, making it a useful evaluation baseline for general chat, visual work and agents.

Choose the right Kimi access route

The word “Kimi” can refer to several separate products:

GoalProductBilling
Use Kimi in a browser for personal workKimi MembershipMonthly or annual
Use Kimi’s coding agent in a terminal or IDEKimi CodeCurrently included with paid membership; limits apply
Call Kimi models from your own codeKimi API Open PlatformPay per token and paid tool use
Manage a multi-user organization workspaceKimi BusinessAnnual per-seat plan

An Open Platform API key does not turn a personal account into a paid member. A Kimi membership does not create API credit. See the Kimi pricing comparison before purchasing.

Recommended developer workflow

  1. Define a test task. Include the input type, acceptable result and maximum cost.
  2. Choose two candidate models. Start with K3 for capability and K2.6 or K2.7 Code as the cost-focused comparison.
  3. Create a project-specific API key. Never paste a real key into browser code, screenshots or public repositories.
  4. Run a small request. Log the model name, parameters, timestamp, response status and token usage.
  5. Repeat before judging quality. Model outputs are nondeterministic; one successful response is not a benchmark.
  6. Add failure handling. Treat 401, 429, timeouts and 5xx responses as expected operational cases.
  7. Set a budget. Limit output length, monitor the console and separate experimental keys from production keys.
  8. Review data sensitivity. Read Kimi’s terms, privacy information and any enterprise agreement before sending confidential data.

What we verify on API pages

Every developer page should state:

  • the official source URL and verification date;
  • the exact model identifier rather than only a marketing name;
  • whether code was executed or only checked against documentation;
  • the endpoint, SDK version and parameters used in any live test;
  • token usage and cost when a paid request was run;
  • known limitations, errors and regional or account prerequisites; and
  • when a claim comes from Kimi rather than our own observation.

This prevents a documentation summary from being presented as independent testing.

Current documentation caveats

Kimi’s product and API pages can change quickly. At the time of this review:

  • the Open Platform WebSearch guide lists a $0.005 trigger fee;
  • Kimi’s current API pricing Help Center article states $0.004;
  • some model pricing tables are rendered dynamically; and
  • legacy Moonshot V1 documentation says the series is expected to be sunset.

We track conflicts on Sources & Corrections. Until a dated live billing record or aligned official documentation resolves this one, our calculator shows a $0.004-$0.005 range rather than silently choosing either number.

About this hub

Kimi AI Guide is independent and is not affiliated with Moonshot AI or Kimi. KI AI Team maintains this developer hub for educational and research use. Official documentation and your live console remain the final authority for service availability, billing and terms.

Official starting points