Image generation · UltraGPT API

Image generation

POST /images/generations with prompt, n (1–4) and response_format (b64_json or url), plus the options the model supports: aspect_ratio, resolution (1K/2K/4K), size, quality, background, output_format, output_compression, moderation and seed. GET /models/{model} lists them in its images block (aspect_ratios, resolutions, sizes, qualities, backgrounds, output_formats, seed, max_input_images); an option the model can't honour returns 400 with param set, never a silent default, and the response echoes the options used. Multimodal image models also accept image: [urls] for edits, or upload files to POST /images/edits (multipart image / image[], what the OpenAI SDK's images.edit() sends; mask is not supported). If some of n images fail, you get and pay for the ones that succeeded. Billed at the provider's reported cost.

curl https://api.ultragpt.pro/v1/images/generations \
  -H "Authorization: Bearer $ULTRAGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "grok-imagine-image-2.0", "prompt": "A lighthouse at dawn, watercolor", "response_format": "url" }'