> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Strukturierte Ausgabe (AI SDK)

> Erzeuge schemageprüfte JSON-Objekte mit Phaseo und Vercel AI SDK.

Verwende `generateObject` für typisierte Ausgaben.

```ts theme={null}
import { phaseo } from "@phaseo/ai-sdk-provider";
import { generateObject } from "ai";
import { z } from "zod";

const { object } = await generateObject({
  model: phaseo("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);
```

## Hinweise

* Bevorzuge explizite Enums und Pflichtfelder in Schemas.
* Stimme Prompts auf die Struktur des Schemas ab.
* Behandle Parsing- und Validierungsfehler im aufrufenden Code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.