v26

latestOpenAPI 3.1.0raw.githubusercontent.com2026-01-285194311.8 KB
agents
characters
evaluation

[Deprecated, use /api/v1/images/text-to-image instead] Generate images based on text description

Generate background images based on prompt, save directly to GCS, return image URLs

post/api/v1/ai/agents/text-to-image

Request body

promptstring required

Text description of the image, typically a list of comma separated keywords/tags/properties

negative_promptstring nullable

Negative prompt to avoid generating images with certain features, e.g. 'blurry, low quality, explicit, NSFW'

enhance_promptboolean nullable

Whether to enhance the prompt to improve the quality of the image. The default is True for backward comaptibility. This enhancement is different than the underlying imagen API's own enhancement. This parameter is also required to allow this api to be used as a text-to-image wrapper. As a wrapper, we'll not want to apply enhancement to the prompt.

countinteger

Number of images to generate

modelstring nullable

Model to use for image generation. If not specified, auto-selects based on subscription status. Supports: google/imagen-, fal-ai/flux-, etc.

request_idstring nullable

Example request

{
  "count": 2,
  "enhance_prompt": true,
  "negative_prompt": "blurry, low quality, explicit, NSFW",
  "prompt": "A beautiful mountain landscape with sunset"
}

Response

Successful Response

codeinteger
messagestring
dataobject nullable