Imagen 4 Fast Generate
Model Overview
Setup your API Key
API Schema
post
Body
modelstring · enumRequiredPossible values:
promptstring · max: 400Required
The text prompt describing the content, style, or composition of the image to be generated.
convert_base64_to_urlbooleanOptionalDefault:
If True, the URL to the image will be returned; otherwise, the file will be provided in base64 format.
truenum_imagesinteger · max: 4OptionalDefault:
The number of images to generate.
1seedinteger · max: 4294967295Optional
The same seed and the same prompt given to the same version of the model will output the same image every time.
enhance_promptbooleanOptionalDefault:
Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment.
trueaspect_ratiostring · enumOptionalDefault:
The aspect ratio of the generated image.
1:1Possible values: person_generationstring · enumOptionalDefault:
Allow generation of people.
allow_adultPossible values: safety_settingstring · enumOptionalDefault:
Adds a filter level to safety filtering.
block_medium_and_abovePossible values: add_watermarkbooleanOptionalDefault:
Add an invisible watermark to the generated images.
falseResponses
200Success
application/json
post/v1/images/generations
curl -L \
--request POST \
--url 'https://api.aimlapi.com/v1/images/generations' \
--header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "google/imagen-4.0-fast-generate-001",
"prompt": "A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses."
}'200Success
{
"data": [
{
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
"b64_json": null
}
],
"meta": {
"usage": {
"credits_used": 120000
}
}
}Quick Example

Last updated
Was this helpful?