new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

moonshotai/setup

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Moonshot AI provider installation

The Moonshot AI provider is available via the @ai-sdk/moonshotai module and can be installed with npm install @ai-sdk/moonshotai or equivalent.

Moonshot AI provider import and instantiation

Import the default provider instance moonshotai from @ai-sdk/moonshotai. For custom configuration, import createMoonshotAI and create a provider instance with const moonshotai = createMoonshotAI({ apiKey: process.env.MOONSHOT_API_KEY ?? '' }).

Moonshot AI provider configuration options

The Moonshot AI provider supports the following optional settings: baseURL (string, default https://api.moonshot.ai/v1) to use a different URL prefix; apiKey (string, defaults to MOONSHOT_API_KEY environment variable) sent via Authorization header; headers (Record<string,string>) for custom headers; fetch (custom fetch implementation matching (input: RequestInfo, init?: RequestInit) => Promise<Response>).

Moonshot AI language model creation example

Language models are created using the provider instance. Example: const { text } = await generateText({ model: moonshotai('kimi-k3'), prompt: 'Write a vegetarian lasagna recipe for 4 people.' }). Models can also be created with moonshotai.chatModel('kimi-k3') or moonshotai.languageModel('kimi-k3').

Moonshot AI API key source

API keys for Moonshot AI can be obtained from the Moonshot Platform at https://platform.moonshot.ai.

Give your agent this brain