> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# AI Models guides

> Validate structured text output before passing it to your application, and track an image task until the image file is usable.

Pass model output downstream only after the output reaches a defined ready state. A support classification is ready when the fields from `choices[0].message.content` pass schema validation. A product image is ready when the task from `POST /v1/images/tasks` reaches `succeeded` and the image URL opens.

## Pass a support classification to your application

Follow the [text SDK setup](/faq/model-sdk-setup) and confirm that your model supports structured output on the chosen protocol. In Chat Completions, specify your application's structure with `response_format`. For example, require `category` and `summary`, with `category` limited to Setup, Payment and Other.

Check `finish_reason`, parse `choices[0].message.content` and validate the parsed object against the same schema. A record with category Setup and a non-empty summary goes to the setup queue. Send records with incomplete fields, truncation or refusals to manual review.

## Submit an image task and track it to completion

Send JSON to `POST https://api.beatapi.io/v1/images/tasks` with BeatAPI Bearer authentication:

```json
{"model":"nano-banana","prompt":"A plain product photo of a reusable bottle on a light gray tabletop.","aspect_ratio":"1:1","output_format":"png"}
```

Generate an `Idempotency-Key` for the image request before sending the request. Save the returned `data.id`, and schedule `GET /v1/tasks/{task_id}` with `data.poll_after_seconds`. On `succeeded`, take the image URL from `data.output.media`, check that the image opens, and save the task ID on the asset record. If the connection drops during submission, see [idempotent image retries](/faq/model-idempotent-retry).

[AI model FAQ](/faq/models) · [BeatAPI pricing](https://beatapi.io/pricing)