Forge is available: build a website with AI from your RodiumAi account.

Try Forge
RodiumAi docs
API

POST /v1/images/generations

Generate images with provider-scoped model ids. Optional image / images to edit (GPT Image and Gemini Image). Images come back as base64 in data[].b64_json.

POSThttps://api.rodiumai.io/v1/images/generations

Body parameters

ParameterTypeRequiredDescription
modelstringRequiredImage model id (e.g. openai/gpt-image-1.5, google/gemini-3.1-flash-image). List them with GET /v1/models.
promptstringRequiredText description of the image to generate or edit instruction.
imageobject | stringOptionalOptional reference image to edit. Accepts { b64_json }, a data URL or raw base64; gs:// URIs on Gemini Image models only. HTTP(S) URLs are rejected. On GPT Image models the request is sent to the provider's edit API. Aliases: input_image, image_url.
imagesarrayOptionalSeveral reference images (same encodings as image), max 14. Alias: input_images. Use for multi-image edits and merges.
nintegerOptionalNumber of images (1–10). Default 1.
sizestringOptionalOutput size, e.g. "1024x1024", "1536x1024", "1024x1536" (mapped to an aspect ratio on Gemini Image models).
qualitystringOptionalQuality when supported (GPT Image: low, medium, high). Also selects the price tier of flat-priced models.
maskobject | stringOptionalGPT Image edits only: PNG mask (same encodings as image) marking the area to change.
background / output_formatstringOptionalForwarded to GPT Image models (e.g. background: transparent, output_format: webp).

Text → image examples

…

Image → image (edit)

GPT Image and Gemini Image models. Pass image or images (max 14) as { b64_json } or a data URL (gs:// on Gemini only). HTTP(S) URLs are rejected.

…

Models and input images

FamilyText to imageInput imagesEncodings
GPT Image (openai/gpt-image-1.5, openai/gpt-image-1-mini, …)YesYes: the gateway calls the provider's edit API; mask supported{ b64_json }, data URL, raw base64
Gemini Image (google/gemini-3.1-flash-image, google/gemini-3-pro-image, …)YesYes, up to 14 (image or images){ b64_json }, data URL, raw base64, gs://

Remote http(s):// image URLs are never fetched by the gateway: encode the file as base64. Keep the whole request under 10 MiB, or it is rejected with 413.

Response

  • Images come back as base64 in data[].b64_json (OpenAI routes also add mime_type). GPT Image models always answer in base64, so response_format is not needed.
  • Decode b64_json and write the bytes to a file, as in the examples above. Some models may return data[].url instead; handle both.
  • Billing: per image (flat-priced models, by quality and size) or per token (GPT Image), see Pricing.

Image generation guide