import type { Metadata } from 'next'; import { TipBox } from '@/components/docs/shared/TipBox'; import { Table } from '@/components/docs/shared/Table'; import { CodeBlock } from '@/components/docs/shared/CodeBlock'; import { DocPage } from '@/components/docs/layout/DocPage'; import { JsonLd } from '@/components/seo/JsonLd'; import { createDocsMetadata, DOCS_PAGES } from '@/config/docs-seo'; import { createBreadcrumbSchema, createTechArticleSchema } from '@/config/docs-schema'; import { Hero, SectionHeader, InlineCode, EndpointCard, ResponseBlock, } from '@/components/docs/blocks'; const PAGE = DOCS_PAGES['api-generations']; export const metadata: Metadata = createDocsMetadata(PAGE); const breadcrumbSchema = createBreadcrumbSchema([ { name: 'Home', path: '/' }, { name: 'Documentation', path: '/docs/' }, { name: 'API Reference', path: '/docs/api/' }, { name: 'Generations', path: '/docs/api/generations/' }, ]); const articleSchema = createTechArticleSchema(PAGE); const tocItems = [ { id: 'create-generation', text: 'Create Generation', level: 2 }, { id: 'list-generations', text: 'List Generations', level: 2 }, { id: 'get-generation', text: 'Get Generation', level: 2 }, { id: 'update-generation', text: 'Update Generation', level: 2 }, { id: 'regenerate', text: 'Regenerate', level: 2 }, { id: 'delete-generation', text: 'Delete Generation', level: 2 }, { id: 'next-steps', text: 'Next Steps', level: 2 }, ]; export default function GenerationsAPIPage() { return ( <>
Create Generation

Generate a new image from a text prompt.

Request Body

prompt, string, Yes, 'Text description of the image to generate', ], [ aspectRatio, string, No, '1:1, 16:9, 9:16, 3:2, 21:9 (default: 1:1)', ], [ referenceImages, string[], No, 'Array of image IDs or @aliases to use as references', ], [ flowId, string, No, 'Associate with existing flow', ], [ alias, string, No, 'Project-scoped alias (@custom-name)', ], [ autoEnhance, boolean, No, 'Enable prompt enhancement (default: true)', ], [ meta, object, No, 'Custom metadata', ], ]} />

Example Request

Response

List Generations

Retrieve all generations for your project with optional filtering.

Query Parameters

flowId, 'string', 'Filter by flow ID'], [status, 'string', 'Filter by status: pending, processing, success, failed'], [limit, 'number', 'Results per page (default: 20, max: 100)'], [offset, 'number', 'Number of results to skip'], ]} />

Example Request

Get Generation

Retrieve a single generation by ID.

Example Request

Update Generation

Update generation parameters. Changing prompt or aspectRatio triggers automatic regeneration.

Request Body

prompt, 'string', 'New prompt (triggers regeneration)'], [aspectRatio, 'string', 'New aspect ratio (triggers regeneration)'], [flowId, 'string | null', 'Change flow association'], [meta, 'object', 'Update custom metadata'], ]} />
Changing prompt or aspectRatio triggers a new generation. The image ID and URL remain the same — only the content changes.
Regenerate

Create a new image using the exact same parameters. Useful for getting a different result or recovering from failures.

Example Request

Delete Generation

Delete a generation and its output image. Images with project aliases are preserved.

Example Request

Response

); }