Generate an image

Compatible with the OpenAI Images protocol. Text-to-image when no image is provided; image editing when an image is provided.

post/v1/images/generations

Request

  • Base URL: https://api.octen.ai
  • URL: https://api.octen.ai/v1/images/generations
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Request body

model'openai/gpt-image-2.5-flare' | 'openai/gpt-image-2.5-sunburst' | 'openai/gpt-image-2' | 'openai/gpt-image-1-mini' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' required

The model to use. Aliases nano-banana-pro (= google/gemini-3-pro-image) and nano-banana-2 (= google/gemini-3.1-flash-image) are also accepted.

promptstring required

The text description for the model. The length limit is set by the model.

ninteger

(GPT only) Number of images to generate. For Gemini, request multiple images in the prompt instead.

sizestring

Output size as width x height (e.g. 1024x1024) or auto.

quality'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto'

(GPT only) Generation quality.

background'transparent' | 'opaque' | 'auto'

(GPT only) Background setting.

output_format'png' | 'jpeg' | 'webp'

Output image format. GPT supports png/jpeg/webp; Gemini supports png/jpeg (webp falls back to png).

output_compressioninteger

(GPT only) Compression level (percent). Effective only when output_format is jpeg or webp.

moderation'low' | 'auto'

(GPT only) Content moderation strength.

thinking_level'minimal' | 'high'

(Gemini only) Thinking effort before generation.

response_modalitiesstring[]

(Gemini only) Controls returned modalities. ["text","image"] returns the image plus accompanying text; ["image"] returns only the image.

media_resolution'low' | 'medium' | 'high'

(Gemini only) Processing resolution for input reference images.

response_format'b64_json'

Return format.

streamboolean

(GPT only) Whether to stream the response.

partial_imagesinteger

(GPT only) Number of intermediate preview images to stream. Effective only when stream=true. Each preview costs an extra 100 image output tokens.

userstring

A unique identifier for the end user. Use hashed or pseudonymous identifiers to avoid passing personally identifiable information.

maskstring

(GPT only) Mask image, base64-encoded PNG matching the input size. Transparent areas are repainted. Effective only when image is provided.

Response

Successful image response. When stream=false, returns a single object. When stream=true (GPT only), returns an SSE stream of image_generation.partial_image / image_edit.partial_image preview events followed by a image_generation.completed / image_edit.completed event.

OR

Changes

No recorded changes to this operation across all 1 revision of this API.