Moonshot AI

Kimi models over a first-class Swift provider pack.

MoonshotModel reads MOONSHOT_API_KEY and targets https://api.moonshot.ai/v1.

let model = MoonshotModel("kimi-k2.7-code")
let result = try await generateText(model: model, prompt: "Say hello.")
print(result.text)

Pass apiKey:, baseURL:, headers:, or queryParams: to override the defaults. Tools, structured output, and streamed reasoning ride the shared chat-completions wire; reasoning traces surface as .reasoningDelta.

Models

As of July 2026:

Model IDNotes
kimi-k2.7-codeNewest code-tuned Kimi
kimi-k2.7-code-highspeedFaster code tier
kimi-k2.6General flagship
kimi-k2.5Prior flagship
moonshot-v1-8k / -32k / -128kv1 context tiers

Check Moonshot's model list for the current lineup. Any id the API serves works.

On this page