Prompt
How do I set aspect ratio and style controls in an image API?
Latest observation
Nov 10, 2026
OpenAI APIWeb search: off
To set aspect ratio and style controls in an image API, you typically pass them as parameters in your request body. The exact names depend on the provider, but the pattern is usually the same.
Common parameters
1) Aspect ratio
Used to control the output shape, for example:
1:1— square16:9— widescreen9:16— portrait4:3— standard
Example:
{
"prompt": "A futuristic city at sunset",
"aspect_ratio": "16:9"
}
2) Style controls
These influence the look and feel of the image. Common style-related fields include:
style: broad visual preset, like"photorealistic","anime","illustration"stylize: how artistic or stylized the result should bequality: rendering fidelity or detail levelseed: for reproducibilitynegative_prompt: what to avoidreference_imageorimage_prompt: to guide style from an example
Example:
{
"prompt": "A futuristic city at sunset",
"aspect_ratio": "16:9",
"style": "cinematic",
"stylize": 700,
"quality": "high"
}
Example API request
curl https://api.example.com/v1/images/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic city at sunset",
"aspect_ratio": "16:9",
"style": "cinematic",
"stylize": 700
}'
Notes
- Some APIs use numeric sizes instead of aspect ratio, like
1024x1024or1536x864. - Some only allow a fixed set of aspect ratios.
- Style controls can be provider-specific, so check the API docs for supported values.
If you want, I can show you exact request examples for a specific API like OpenAI, Stability AI, Midjourney-style APIs, or Replicate.