Skip to main content
Moonshot AI offers 12 models through Lava’s AI Gateway, supporting Chat Completions. Authentication uses Authorization: Bearer. See the Moonshot AI API docs for provider-specific parameters.
Supports both managed API keys (from Lava) and BYOK mode.

Quick Start

const response = await fetch('https://api.lavapayments.com/v1/forward?u=https%3A%2F%2Fapi.moonshot.ai%2Fv1%2Fchat%2Fcompletions', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${forwardToken}`,
  },
  body: JSON.stringify({
    model: 'kimi-k2-0905-preview',
    messages: [{ role: "user", content: "Hello!" }],
  }),
});

Chat Completions

Target URL: https://api.moonshot.ai/v1/chat/completions
Content Typeapplication/json
StreamingYes (set stream: true in request body)
ModelInput / 1M tokensOutput / 1M tokens
moonshot-v1-128k$2.00$5.00
moonshot-v1-128k-vision-preview$2.00$5.00
kimi-k2-turbo-preview$1.15$8.00
kimi-k2-thinking-turbo$1.15$8.00
moonshot-v1-32k$1.00$3.00
moonshot-v1-32k-vision-preview$1.00$3.00
kimi-k2-0905-preview$0.60$2.50
kimi-k2-0711-preview$0.60$2.50
kimi-k2-thinking$0.60$2.50
kimi-latest-8k$0.20$2.00
moonshot-v1-8k$0.20$2.00
moonshot-v1-8k-vision-preview$0.20$2.00

Next Steps