Text to Image

Create a Text to Image task

Generate a 2D image from a prompt. Consumes credits; see https://docs.meshy.ai for pricing.

post/v1/text-to-image

Request

  • Base URL: https://api.meshy.ai/openapi
  • URL: https://api.meshy.ai/openapi/v1/text-to-image
  • Auth: HTTP bearer

Request body

ai_model'nano-banana' | 'nano-banana-pro' | 'nano-banana-2' | 'nano-banana-2-lite' | 'gpt-image-2' | 'gpt-image-2-5-flare' | 'gpt-image-2-5-sunburst' required

Image model to use.

promptstring required

Text prompt.

generate_multi_viewboolean nullable

Produce a 4-view split image instead of a single image.

pose_mode'a-pose' | 't-pose'

Force a rest pose (may upgrade the model and require a higher tier).

aspect_ratio'1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '3:2' | '2:3'

Output aspect ratio. Supported values depend on the model (GPT Image models: 1:1,16:9,9:16,4:3,3:4,3:2,2:3; nano-banana family: 1:1,16:9,9:16,4:3,3:4). Cannot be combined with generate_multi_view.

remove_backgroundboolean

Return a transparent RGBA cutout (single-image only).

Response

Task accepted for processing.

resultstring required

The created task's ID.

Changes

No recorded changes to this operation across all 1 revision of this API.