Skip to content
Dashboard

xAI joins the Vercel Marketplace

, , , Justin Kropp, Fabio Benedetti, Alex Martin, René-Pier Deshaies-Gélinas, Jake Uskoski
import { xai } from "@ai-sdk/xai";
import { streamtext } from "ai";
const result = streamText({
model: xai("grok-2-1212"),
prompt: "What is the meaning of life?",
});
for await (const textPart of result.textStream) {
process.stdout.write(textPart); // The answer is 42.
}

vercel install xai

Ready to deploy?