Providers

Moonshot AI

Configure Moonshot AI for Kimi K3, Kimi K2.5, and Kimi thinking models.

Setup

pnpm add @ai-sdk/moonshotai
import { AiSdkProvider } from "noumen";
import { createMoonshotAI } from "@ai-sdk/moonshotai";

const moonshot = createMoonshotAI({
  apiKey: process.env.MOONSHOT_API_KEY!,
});

const provider = new AiSdkProvider({
  model: moonshot("kimi-k3"),
  providerFamily: "moonshot",
});

For quick setup, use the string shorthand:

import { LocalAgent } from "noumen/local";

const agent = LocalAgent({ provider: "moonshot", cwd: "." });

The shorthand reads MOONSHOT_API_KEY and defaults to kimi-k3.

Options

Connection options come directly from createMoonshotAI:

OptionDescription
apiKeyMoonshot API key. Defaults to MOONSHOT_API_KEY in the AI SDK.
baseURLAPI URL override. Defaults to https://api.moonshot.ai/v1.
headersCustom headers sent with every request.
fetchCustom fetch implementation.

Reasoning and thinking

Kimi K3 always reasons. Use reasoningEffort: "max" when constructing ChatParams, or enable the agent's standard thinking option:

const agent = LocalAgent({
  provider: "moonshot",
  cwd: ".",
  options: {
    model: "kimi-k3",
    thinking: { type: "enabled", budgetTokens: 10_000 },
  },
});

For models such as kimi-k2-thinking, noumen maps thinking.budgetTokens to Moonshot's native thinking configuration and enforces its 1,024-token minimum. Reasoning history is preserved across tool calls and subsequent turns.

Models

Common model IDs include:

  • kimi-k3 — latest reasoning model and noumen's default.
  • kimi-k2.5 — general-purpose model with multimodal support.
  • kimi-k2-thinking — reasoning model with a configurable thinking budget.
  • kimi-k2-thinking-turbo — faster K2 thinking variant.

Any model exposed by the Moonshot API can be passed to createMoonshotAI.