Generate an image
Generate one or more images from a text prompt. Beyond the standard fields, each model accepts its own model-specific sizing and quality parameters such as resolution, aspect_ratio, width/height, and quality. Send the ones your chosen model supports. Call GET /v1/models to see each model’s supported parameters; pricing is shown on deepshi.ai and every response returns the actual usage.cost. Set stream: true for Server-Sent Events on slow, high-resolution generations.
Authorizations
Your Deepshi API key, sent as Authorization: Bearer <key>.
Body
Image generation request. model and prompt are required. The remaining fields are optional; a model safely ignores any field it does not support. Model-specific sizing/quality fields (width/height, aspect_ratio, resolution, quality, image_size) apply only to the models that declare them — see GET /v1/models. Additional model-specific parameters not listed here may also be sent and are forwarded to the model.
The image model id to use. See GET /v1/models.
"nano-banana-pro"
Text description of the image to generate.
"a serene canal in Venice at sunset"
Number of images to generate (1–4).
1 <= x <= 4How images are returned. url returns an inline base64 data: URI, not a hosted link.
b64_json, url Encoding of the returned image. Not all models honor every format.
png, jpeg, webp Stream the result as Server-Sent Events. Use it for slow, high-resolution generations that would otherwise time out.
Seed for reproducible output. Omit for a random seed.
Model-specific. Output width in pixels, for pixel-dimension models (e.g. flux-2-pro).
Model-specific. Output height in pixels, for pixel-dimension models.
Model-specific. Aspect ratio for aspect-ratio and resolution-tier models.
"16:9"
Model-specific. Resolution tier for resolution-tier models (e.g. nano-banana-2, nano-banana-pro, grok-imagine-quality). Determines the billed price for those models.
"2K"
Model-specific. Quality tier for the GPT Image models (gpt-image-1.5, gpt-image-2). Higher tiers cost more, and the price depends on the image size and quality you pick. Omit to use the model's default tier.
low, medium, high Model-specific. Named output size for preset-size models (e.g. seedream-4.5).
"auto_2K"
Response
The generated image(s). When stream: true, the response is a Server-Sent Events stream (text/event-stream): periodic keepalive comments followed by a terminal image_generation.completed event carrying the final image (see the ImageStreamEvent schema).