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

Try Forge
RodiumAi docs
Core concepts

Image generation

From zero: install openai, set base_url, call images.generate. Pass optional reference images to edit. Billed per image or per token in RODI.

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

RodiumAi exposes OpenAI-compatible image generation. Text-to-image works with OpenAI GPT Image and Google Gemini Image models. Pass image or images on the same endpoint to edit: GPT Image requests are routed to the provider's edit API, Gemini Image models edit natively.

When to use

  • Product heroes, ads, and social creatives from a text brief.
  • Edit or restyle a still with GPT Image or Gemini Image (image / images).
  • Batch variants (n, size, quality) or feed a still into Veo.

Recipes

Product hero

Describe lighting, angle, and brand mood in the prompt. Start with 1024x1024 medium quality.

Note: Billed per image in RODI, check GET /v1/pricing before large n.

Image edit

Use a GPT Image or Gemini Image model and pass image (or images[]) as { b64_json } or a data URL. HTTP(S) URLs are rejected.

Note: gs:// references are accepted by Gemini Image models only; send b64_json or a data URL to GPT Image.

Image → video

Generate or edit a still here, then POST /v1/videos/generations with image.b64_json (not an HTTPS URL).

Note: See the video guide image-to-video recipe.

Text → image examples

…

Image → image (edit)

Send prompt plus image or images (max 14). Same encodings as video: { b64_json }, data URL, or gs://. HTTP(S) image URLs are rejected.

…

Request 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).

API reference: images

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.