Create image
Create an image from a prompt.
Authorizations
Body
Parameters required to generate an image.
promptstringRequired
The prompt to generate the image from.
aspect_ratiostring · enumRequiredPossible values:
The aspect ratio of the image.
image_style_idstring | nullOptional
The ID of the image style to use. Use the List image styles endpoint to get a list of available image styles.
scene_idstring | nullOptional
If you want to add the generated image to a video scene you can specify it here.
wait_for_generationbooleanOptionalDefault:
If false, this endpoint immediately returns the incomplete image record, and you can poll the Get image endpoint until the task completes. If true, this endpoint waits until the image generation completes, then returns the complete image record. Defaults to false.
false
modelstring · enumOptionalDefault:
OpenAI
Possible values: qualitystring · enumOptionalDefault:
high
Possible values: source_media_idstring | nullOptional
The ID of the media to use as a source for the image.
Responses
200
Successful response
application/json
400
Invalid request
application/json
401
Unauthorized request
application/json
post
POST /api/v1/images HTTP/1.1
Host: shortgenius.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 162
{
"prompt": "text",
"aspect_ratio": "9:16",
"image_style_id": null,
"scene_id": null,
"wait_for_generation": false,
"model": "OpenAI",
"quality": "high",
"source_media_id": null
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"url": null,
"type": "text",
"state": "pending",
"created_at": "text",
"updated_at": null,
"prompt": "text",
"is_nsfw": true,
"aspect_ratio": "9:16",
"image_style_id": null
}
Last updated