Skip to main content
POST
Generates one or more images from a text prompt. Supported fields, sizes, output formats, and quality controls depend on the selected image model.

Endpoint

Headers

Authorization
string
required
API key using the format Bearer $YELU_API_KEY.
Content-Type
string
required
Must be application/json.

Request body

model
string
required
An image-capable model ID available to your account.
prompt
string
required
Description of the image to create. Prompt length limits are model-specific.
n
integer
default:"1"
Number of images to generate when supported. Validate this value to control cost.
size
string
Requested dimensions such as 1024x1024. Accepted values depend on the model.
quality
string
Model-specific quality setting such as standard or hd, when supported.
style
string
Model-specific style control, when supported.
response_format
string
default:"url"
url or b64_json, subject to model support. URLs can expire; download them promptly.
user
string
Stable, non-sensitive end-user identifier for abuse monitoring and attribution.

Response

created
integer
required
Unix timestamp for generation.
data
array
required
Generated image objects. Each object contains url or b64_json, and can include revised_prompt.

Error codes

The response URL above uses the reserved .invalid domain to illustrate the response shape. Real successful responses contain a provider or Yelu delivery URL, or base64 image data when requested and supported.
Last modified on July 13, 2026