API Reference
Premium Image Generation
POST
https://api.soreal.app/create-image/premium
Description
Generate ultra-high-quality images using advanced AI models for both text prompts and image references. Includes automatic quality enhancement.
This endpoint requires 60 credits per image generated.
Parameters
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
| prompt | string | No | N/A | N/A | The detailed text prompt describing the image to generate. Either prompt or imagePromptUrl is required. Universal quality enhancement is automatically applied. |
| aspectRatio | string | No | 16:9 | 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 9:21 | Aspect ratio of the output image. When using text-only generation: 1:1, 9:16, 16:9, 3:4, 4:3. When using a reference image: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 9:21. |
| imagePromptUrl | string | No | N/A | N/A | URL of an image to use as reference. When provided, the system will use the image as a reference for generation. Either prompt or imagePromptUrl is required. |
| fileFormat | string | No | png | png, jpg | Output file format for the generated image. |
Example Request Headers
{
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}Example Request Body
{
"prompt": "A futuristic cityscape with neon lights and flying cars",
"aspectRatio": "16:9",
"imagePromptUrl": "https://example.com/reference-image.jpg",
"fileFormat": "png"
}Example Response
{
"success": true,
"message": "Premium image generated successfully",
"data": {
"imageUrl": "https://api.soreal.app/assets/users/1/generations/1749381948150.png",
"creditBalance": 940
}
}Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters, Insufficient credits |
| 401 | Unauthorized - Invalid API key |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |