Kimi API guide

Kimi API access and setup

Choose an official platform or provider route, create the right API key and verify the K3 request contract before connecting a coding or production workflow.

Current model ID

kimi-k3

Direct API base

api.moonshot.ai/v1

Primary protocol

OpenAI-compatible

Evidence

DECLARED

Official Kimi platform · checked July 28, 2026

Setup sequence

From account to first verified request

  1. 01

    Choose the official platform

    Use the global or China platform that matches your account, billing currency and deployment requirements.

  2. 02

    Create an API key

    Create the key in that platform's console. Store it in a secret manager or environment variable, never in client-side code.

  3. 03

    Select the model ID

    Use `kimi-k3` for direct API and compatible integrations unless the official integration guide specifies an alias.

  4. 04

    Verify the response contract

    Test streaming, tool calls, reasoning fields, usage reporting and error handling before migrating a production workflow.

Minimal Python request
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MOONSHOT_API_KEY"],
    base_url="https://api.moonshot.ai/v1",
)

response = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Explain this repository."}],
    reasoning_effort="low",
)

Example uses a placeholder environment variable. Never commit a real API key.

Official vs third-party access

The key identifies an account route, not just a model.

Official global API

Moonshot AI

DECLARED

Endpoint

https://api.moonshot.ai/v1

Key source

Kimi global platform console

OpenAI-compatible API; K3 materials also document an Anthropic-compatible route.

Global API docs

Last checked: July 28, 2026

Official China API

Moonshot AI China platform

DECLARED

Endpoint

https://api.moonshot.cn/v1

Key source

Kimi China platform console

Keep the China account, endpoint and CNY billing route distinct from the global platform.

China API docs

Last checked: July 28, 2026

Third-party provider example

Fireworks AI or another selected provider

DECLARED

Endpoint

Provider-specific; Fireworks publishes its own K3 model path

Key source

Provider console

The provider issues the credential and service terms. A provider route is not a Moonshot official API route, even when it serves K3 weights.

Provider declaration

Last checked: July 28, 2026

K3 integration notes

Compatibility is not equivalence.

Verify request fields, tools, streaming, limits and provider behavior in the exact route you will deploy.

  • K3 runs in thinking mode and supports `reasoning_effort` values `low`, `high` and `max`.
  • For multi-turn work, preserve the complete assistant response fields required by the official K3 guide.
  • Direct API calls use `kimi-k3`; a client-specific guide may require a different alias or configuration field.
  • A compatible API shape does not prove that two providers expose identical features, limits or data handling.

Coding integration boundary

Compatible does not mean interchangeable

The API product, coding client and credential source are separate choices. Verify all three before assuming a setup is supported.

Direct API or OpenAI-compatible SDK

DECLARED

Use the platform key, the matching regional base URL and `kimi-k3`. This is the clearest baseline for testing the model contract.

Claude Code

DECLARED

Kimi publishes an Anthropic-compatible Claude Code path. Follow the current Kimi tutorial because its base URL, key product and model alias can differ from a direct OpenAI-compatible call.

OpenCode

UNKNOWN

OpenCode supports custom OpenAI-compatible providers, but a current Kimi K3-specific support contract is not verified here. Test the direct API first, then validate tools, streaming and reasoning fields in OpenCode.

API route

Managed access

The provider operates inference, rate limits and service delivery. Review platform terms, region, retention and spend controls.

Self-hosted route

Infrastructure control

Your team takes on runtime, capacity, updates and security. Review the K3 license and serving requirements before planning deployment.

API Radar bridge URL pending confirmation.