POST /image/generate

Generate images based on the provided prompt and parameters

application/json

Body Required

  • prompt string Required
  • model string Required
  • provider string Required
  • number_of_images integer

    Number of images to generate

    Default value is 1.

  • aspect_ratio string

    Desired image dimensions, format: WIDTHxHEIGHT

    Values are 1:1, 9:16, 16:9, 4:3, or 3:4. Default value is 1:1.

  • safety_filter_level string | null

    Values are block_most, block_some, block_few, or block_fewest. Default value is block_few.

  • person_generation string | null

    Values are dont_allow, allow_adult, or allow_all. Default value is allow_all.

  • seed integer | null
  • negative_prompt string | null

Responses

  • 200 application/json

    Successfully generated image(s)

    Hide response attributes Show response attributes object
    • images array[string] Required

      Base64 encoded images data (without mime prefix)

    • error string | null
    • count integer

      Number of Images

      Default value is 1.

  • 400

    Bad request - invalid input parameters

  • 500

    Internal server error - image generation failed

POST /image/generate
curl \
 --request POST 'http://localhost:8080/api/image/generate' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"prompt":"string","model":"string","provider":"string","number_of_images":1,"aspect_ratio":"1:1","safety_filter_level":"block_few","person_generation":"allow_all","seed":42,"negative_prompt":"string"}'
Request examples
{
  "prompt": "string",
  "model": "string",
  "provider": "string",
  "number_of_images": 1,
  "aspect_ratio": "1:1",
  "safety_filter_level": "block_few",
  "person_generation": "allow_all",
  "seed": 42,
  "negative_prompt": "string"
}
Response examples (200)
{
  "images": [
    "string"
  ],
  "error": "string",
  "count": 1
}