Skip to main content

Generate Images

Create an image given a prompt.

Try It

POST/v1/images/generationshttps://api-platform.ope.ai

Authentication

Uses Bearer Token authentication.

  • Header: Authorization: Bearer <token>
  • Example: Authorization: Bearer sk-xxxxxx

Request body (application/json)

FieldTypeRequiredDescriptionDefault / Range
modelstringYesModel for image generationQwen-Image
promptstringYesText description of the image-
sizestringYesGenerated image sizeExample: 1024x1024
nintegerNoNumber of images to generateDefault: 1

Request examples

The domain below is an example: https://api-platform.ope.ai.

curl -X POST "https://api-platform.ope.ai/v1/images/generations" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen-Image",
"prompt": "Generate an image showcasing AI image generation capabilities.",
"size": "1024x1024"
}'

Response example (200)

{
"created": 0,
"data": [
{
"b64_json": "string",
"url": "string"
}
],
"usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
}
}