Chat
async ({ ai }) => {
const text = await ai.chat("Name three follow-up questions for a demo.")
const parsed = await ai.chat("Return JSON { questions: string[] }", true)
return { text, parsed }
}Images and embeddings
ai.analyzeImage reads an image. ai.image generates one. ai.embedding returns a vector for a string. Each call spends credits based on the work it does.