> ## 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.

# Images (AI SDK)

> Generate images with Vercel AI SDK and the Phaseo provider.

Use `generateImage` with `phaseo.imageModel(...)`.

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

const result = await generateImage({
  model: phaseo.imageModel("openai/gpt-image-1"),
  prompt: "A minimalist poster of a lighthouse at dawn.",
  size: "1024x1024",
});

console.log(result.images[0].mediaType);
console.log(result.images[0].uint8Array.length);
console.log(result.providerMetadata);
```

## Notes

* Available `size` values depend on the selected model.
* URL-backed gateway image responses are normalized into the AI SDK file output shape, so `uint8Array` and `mediaType` are the stable fields to read first.
* For deterministic workflows, persist prompt + model + params together.
* Prefer storing returned image metadata with asset references.
