Overview
Generate images from text prompts
Credits
512px: 1, 1K: 2, 2K: 3, 4K: 5
Providers
SDK Method
client.generate_image(...)
Modes
The mode parameter is a preset that configures optimal provider routing for common use cases. You can also set individual parameters directly for fine-grained control.
512px
1 creditAbout 512 pixels on the longer side.
The default. Fastest and cheapest.
1K
2 creditsAbout 1024 pixels on the longer side.
Web and social images.
2K
3 creditsAbout 2048 pixels on the longer side.
Hero images and print at small sizes.
4K
5 creditsAbout 3840 pixels on the longer side.
Print and large displays.
Parameters
promptRequiredstring
Image description.
aspect_ratioselect (default: 1:1)
Aspect ratio.
image_sizeselect (default: 512px)
Image size: the longer side, about 512, 1024, 2048 or 3840 pixels. The price depends on it.
Example Response
{
"success": true,
"data": {
"b64_json": "/9j/4AAQSkZJRgABAQAAAQABAAD...(base64 image data)",
"content_type": "image/png",
"prompt": "A minimal blue circle on white background",
"aspect_ratio": "1:1",
"image_size": "512px"
},
"metadata": {
"provider_used": "openai",
"providers_tried": [
"openai"
],
"mode_used": null,
"response_time_ms": 9498,
"request_id": "req_2f408e4c"
},
"credits_used": 1
}Get Started
Create a Suprsonic API key in your dashboard, then call the endpoint with your key in the Authorization header.
Confirm your email and 25 free credits are added, no card needed. After them, your API calls continue with a free 7-day trial of Pro: a card is needed, and nothing is charged until the trial ends. When you need more, subscribe to a plan: Pro is $29 a month for 2,000 credits, Max $99 for 8,000 and Team $249 for 24,000.