Skip to content
Auto
English

Image generation and edits

Relyven provides both OpenAI Images-compatible and native Gemini-compatible APIs. Direct image endpoints use a different request format from the image_generation tool in Responses.

Model Common name Best for Size and output
gpt-image-2 Generation, localized or masked edits, and multi-image composition n=1–10; arbitrary valid sizes with either side up to 3840; PNG/JPEG
gemini-2.5-flash-image Nano Banana Fast generation and reference-image edits About 1K by default; returns text and image parts
gemini-3-pro-image Nano Banana Pro High-quality editing, complex text, and composition 10 aspect ratios; 1K, 2K, or 4K
gemini-3.1-flash-image Nano Banana 2 Faster generation and editing with balanced quality 10 aspect ratios; 512, 1K, 2K, or 4K
doubao-seedream-5-0-pro-260628 Generation, single-reference edits, and multi-reference fusion Up to 10 references; one output; n=1

Common names are labels, not callable model IDs. Always send the complete model ID shown in the table.

gpt-image-2 and Seedream use POST /v1/images/generations. This example requests two 1024×640 images from gpt-image-2:

Terminal window
curl https://api.relyven.com/v1/images/generations \
-H "Authorization: Bearer $RELYVEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A clean product illustration of an API gateway",
"size": "1024x640",
"quality": "low",
"n": 2,
"output_format": "png"
}'

For gpt-image-2, width and height must be multiples of 16, each side must not exceed 3840, aspect ratio must not exceed 3:1, and total pixels must be 655,360–8,294,400. Use POST /v1/images/edits for localized edits, masks, and multi-image composition; repeat image[] for multiple references.

The Nano Banana family uses the native Gemini request shape. Replace the model in the URL with any Gemini model in the table. For edits, include the prompt plus inlineData or fileData image parts.

Terminal window
curl https://api.relyven.com/v1beta/models/gemini-3.1-flash-image:generateContent \
-H "x-goog-api-key: $RELYVEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [{"text": "A clean product illustration of an API gateway"}]}],
"generationConfig": {
"responseModalities": ["TEXT", "IMAGE"],
"imageConfig": {"aspectRatio": "16:9", "imageSize": "2K"}
}
}'

Pro and 3.1 Flash support 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9. Only 3.1 Flash also accepts imageSize: "512".

Seedream uses the same generation endpoint for edits and multi-image fusion. Send image as one URL/Data URL or an array of up to 10 references:

{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "Keep the subject and use the second image as the visual style.",
"image": [
"https://example.com/subject.png",
"https://example.com/style.png"
],
"size": "1024x1024",
"n": 1
}

OpenAI-compatible clients can use /v1/images/edits with uploaded Seedream or gpt-image-2 reference images:

Terminal window
curl https://api.relyven.com/v1/images/edits \
-H "Authorization: Bearer $RELYVEN_API_KEY" \
-F "model=doubao-seedream-5-0-pro-260628" \
-F "prompt=Replace the background with a neutral studio backdrop" \
-F "image=@./input.png" \
-F "n=1"

For Seedream, the first reference is included in the base price. Each additional reference costs 1/15 of the base image price. Output up to 2.36 megapixels uses the lower output tier; larger output uses the higher tier shown in the model catalog.

Results use a data array with a URL or Base64 payload. Verify the actual image count, signature, dimensions, and request log. Temporary URLs may expire. After a network timeout, do not blindly retry a paid image request; first check the request ID and usage log.

Official reference: OpenAI image generation guide