Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt

Use this file to discover all available pages before exploring further.

Use generateObject for typed outputs.
import { aiStats } from "@ai-stats/ai-sdk-provider";
import { generateObject } from "ai";
import { z } from "zod";

const { object } = await generateObject({
  model: aiStats("openai/gpt-5-nano"),
  schema: z.object({
    title: z.string(),
    priority: z.enum(["low", "medium", "high"]),
    actions: z.array(z.string()),
  }),
  prompt: "Create a short incident follow-up plan.",
});

console.log(object);

Notes

  • Prefer explicit enums and required fields in schemas.
  • Keep prompts aligned with the schema shape.
  • Handle parse/validation errors in caller code.
Last modified on March 16, 2026