Краткий вывод
- Supports prompt-based image generation for marketing, e-commerce, and creative workloads.
- Supports reference_images (up to 5) for image-to-image and style control.
- Supports mask_url for local inpainting and targeted edits.
Ключевые параметры
- model | string | обяз. | gpt-4o-image | - | Exact model identifier from ToAPIs.
- prompt | string | обяз. | - | - | Primary image instruction prompt.
- size | string | опц. | 1:1 | 1:1 | 2:3 | 3:2 | Output aspect ratio.
- n | integer | опц. | 1 | 1-4 | Number of images to generate per request.
- reference_images | file[] | опц. | - | max 5 | Reference image array for image-to-image and style control.
- mask_url | string | опц. | - | - | Mask image URL for local edits/inpainting.
Частые ошибки
- 400 invalid_request_error: триггер=Missing fields, invalid types, or out-of-range values.; исправление=Validate model/prompt/size/n/reference_images/mask_url fields.; повтор=Retry after fixing payload.
- 401 authentication_error: триггер=Missing or invalid API key.; исправление=Verify Authorization header and key scope.; повтор=Retry after authentication is fixed.
- 429 rate_limit_exceeded: триггер=Request rate, concurrency, or current quota hits upstream rate limiting.; исправление=Apply exponential backoff first, then review request rate, concurrency, and quota usage.; повтор=Use 1s/2s/4s backoff with jitter; if it persists, reduce submission pressure.


