Create image

Create image

post

Create an image from a prompt.

Authorizations
Body

Parameters required to generate an image.

promptstringRequired

The prompt to generate the image from.

aspect_ratiostring · enumRequired

The aspect ratio of the image.

Possible values:
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_generationbooleanOptional

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.

Default: false
modelstring · enumOptionalDefault: OpenAIPossible values:
qualitystring · enumOptionalDefault: highPossible values:
source_media_idstring | nullOptional

The ID of the media to use as a source for the image.

Responses
200
Successful response
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