Generate Image
client.images.generate(params)/v1/images/generationsGenerate images through SandBase's synchronous OpenAI Images-compatible endpoint. This endpoint is distinct from the general /v1/run model API.
Request body
ImageGenerateParamsUse gpt-image-2 on this endpoint.
Text description of the image to generate.
Number of images to generate when supported.
Output dimensions supported by the model.
Output quality such as low, medium, high, or auto.
Background setting such as transparent, opaque, or auto.
Output encoding such as png, webp, or jpeg.
Output compression level from 0 to 100.
Provider-compatible moderation setting.
Provider-compatible end-user identifier.
Synchronous only
stream=true, mode=stream, and mode=async are rejected. Use the returned data array directly.
Compatible fields
Additional JSON fields are forwarded unchanged, but support remains model- and provider-specific.
Errors
Invalid JSON, unsupported model, streaming mode, or provider request.
Missing or invalid API key.
Organization or API Key spending limit reached.
API key scope does not authorize this endpoint.
The routed image model is unavailable.
Rate limit exceeded.
Request persistence or response processing failed.
The provider returned an invalid native response.
No provider route succeeded.