Skip to main content
POST
/
v1
/
ai
/
text-to-image
/
imagen4-fast
curl --request POST \
  --url https://api.magnific.com/v1/ai/text-to-image/imagen4-fast \
  --header 'Content-Type: application/json' \
  --header 'x-magnific-api-key: <api-key>' \
  --data '
{
  "prompt": "A futuristic cityscape at night with neon lights",
  "aspect_ratio": "widescreen_16_9",
  "person_generation": "allow_adult",
  "safety_settings": "block_medium_and_above",
  "seed": 12345,
  "enhance_prompt": true,
  "language": "en",
  "output_options": {
    "mime_type": "image/png",
    "compression_quality": 75
  }
}
'
{
  "data": {
    "generated": [],
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "IN_PROGRESS"
  }
}

Authorizations

x-magnific-api-key
string
header
required

Your Magnific API key. Required for authentication. Learn how to obtain an API key

Body

application/json
prompt
string
required

The text prompt for the image

Example:

"A beautiful sunset over a calm ocean"

webhook_url
string<uri>

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example:

"https://www.example.com/webhook"

aspect_ratio
enum<string>
default:square_1_1

Aspect ratio for the generated image

Available options:
square_1_1,
social_story_9_16,
widescreen_16_9,
traditional_3_4,
classic_4_3
Example:

"square_1_1"

person_generation
enum<string>
default:allow_adult

Allow person generation

Available options:
dont_allow,
allow_adult,
allow_all
safety_settings
enum<string>
default:block_medium_and_above

Safety settings options

Available options:
block_low_and_above,
block_medium_and_above,
block_only_high,
block_none
seed
integer

Seed for the image generation. If not provided, a random seed will be used. Does not work with enhance_prompt enabled.

Required range: 1 <= x <= 4294967295
enhance_prompt
boolean

Use LLM-based prompt rewriting for higher quality images that better reflect the original prompt's intent.

language
enum<string>
default:en

Language code for the text prompt

Available options:
auto,
en,
zh,
zh-CN,
hi,
ja,
ko,
pt,
es
output_options
object

Response

OK - The request has succeeded and the Imagen4 Fast process has started.

data
object
required
Example:
{
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED",
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
]
}