---
title: "Generate items from a prompt"
method: POST
path: "/boards/{boardId}/ai/generate"
tags: ["AI"]
---

# Generate items from a prompt

`POST /boards/{boardId}/ai/generate`

## Request

- Base URL: `https://api.mockflow.com/v1`
- URL: `https://api.mockflow.com/v1/boards/{boardId}/ai/generate`
- Auth: HTTP bearer

Mida turns a prompt into one or more items on the board. With one `outputTypes` entry the
matching generator runs directly; with none, Mida's planner decides what to build, as it does
in the editor. `skill` applies a saved skill's instructions and output type. `withImages`
lets Mida generate pictures inside the result. Plus and Max only; charged in AI credits.
`dryRun` returns an estimate without spending anything.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `callbackUrl` string, uri: Optional. When the job this request starts finishes or fails, a short body is POSTed here once: `{ eventId, status, boardId, boardUrl, imageUrl }`, where status is `succeeded` or `failed` and imageUrl is a picture of what the job drew, or null. Signed with the workspace's callback secret (GET /webhooks/callback-secret). https to a public host. The full job is on GET /jobs/{jobId}.
  - `prompt` string, required
  - `outputTypes` ItemType[]
  - `skill` string: A skill id or slug from GET /skills.
  - `withImages` boolean
  - `model` string: A text model id from the editor's model picker. Omit for Mida's default.
  - `dryRun` boolean

## Response `200`

The dry run estimate.

- object
  - `dryRun` boolean
  - `estimate` object
    - `items` integer
    - `credits` integer
    - `note` string
  - `credits` object
    - `remaining` integer
    - `total` integer
  - `plan` string
  - `canGenerate` boolean

## Other responses

- `202`: Generation started.
- `402`: The workspace plan does not allow this, or AI credits are exhausted.
- `429`: Too many requests.

---

[API](https://skmtc.dev/mockflow/apis/mockflow-boards-api.md) - [All operations](https://skmtc.dev/mockflow/apis/mockflow-boards-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mockflow/apis/mockflow-boards-api/revisions/1a890390518c?raw)
