# What changed in @ai-sdk/moonshotai

> 27 changes in @ai-sdk/moonshotai 0.0 to 3 from its official release notes, upgrade guides and advisories: 1 breaking, 7 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/@ai-sdk/moonshotai/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @ai-sdk/moonshotai 3

### New APIs and options

- Adds max as a portable reasoning level, widening LanguageModelV4CallOptions['reasoning'] and the derived ReasoningLevel type. Exhaustive switches and mappings must handle it. (3.0.64) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.64)

### Behavior and default changes

- Unknown model IDs retain JSON schemas for structured output instead of silently falling back to JSON object mode, supporting future Moonshot models. (0.0.31, 2.0.63, 3.0.68) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.68), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.63), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.31)

### Fixes and other changes

- The User-Agent header now complies with standards. (3.0.60) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.60)
- Fixes streamed tool calls when their IDs are missing, blank, or repeated. (3.0.59) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.59)
- Preserves reasoning streams across empty tool-call deltas. (3.0.49) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.49)
- Preserves documented Moonshot API error codes in HTTP and streaming errors. (0.0.24, 2.0.53, 3.0.41) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.41), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)
- Preserves complete raw usage objects. (2.0.53, 3.0.41) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.41), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53)
- Prevents negative text output token counts when providers report reasoning tokens by treating Perplexity reasoning tokens separately from completion tokens. (2.0.49, 3.0.38) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.38), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.49)
- Fixes handling of empty string tool call IDs. (3.0.36) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%403.0.36)

## @ai-sdk/moonshotai 2

### Breaking changes

- Strict validation is enabled by default for Moonshot structured outputs. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)

### New APIs and options

- Adds provider-specific names for Moonshot AI system, user, and assistant messages. (0.0.24, 2.0.53) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)
- Adds first-class support for Moonshot V1 auto and vision-preview model IDs while retaining support for custom and retired model IDs. (0.0.24, 2.0.53) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)
- Adds Moonshot AI Partial Mode support for continuing a final assistant message. (2.0.53) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53)
- Adds predicted output support. (2.0.53) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53)

### Behavior and default changes

- Adds support for Kimi K3 dynamic tool-loading system messages. (0.0.24, 2.0.53) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.53), [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)
- Maximum output tokens are sent using the current Moonshot request field. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)
- Official Moonshot V1 models use native JSON Schema structured outputs. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)

### Fixes and other changes

- Choice-level usage is preserved in Moonshot streaming responses. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)
- Moonshot streaming tool calls without indices are accepted. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)
- Moonshot structured output schemas are normalized. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)
- Unsupported image and video media types are rejected before Moonshot chat requests are sent. (2.0.51) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.51)
- Non-object root schemas now fail with a clear client-side error instead of Moonshot's opaque 400. (2.0.47) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.47)
- Tool schemas are normalized for Moonshot's MFJS validator: tuple items become prefixItems, and type next to anyOf moves into the branches. The original schema remains in use for AI SDK result validation. (2.0.47) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%402.0.47)

## @ai-sdk/moonshotai 0.0

### New APIs and options

- Adds support for chat log probabilities. (0.0.24) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)
- Adds support for Moonshot predicted outputs. (0.0.24) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)

### Behavior and default changes

- Supports Partial Mode for final assistant message prefixes. (0.0.24) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)

### Fixes and other changes

- Preserves Moonshot chat response metadata in generated and streamed responses. (0.0.24) — [release notes](https://github.com/vercel/ai/releases/tag/%40ai-sdk/moonshotai%400.0.24)
