Skip to content
English

Image generation and edits

These direct image endpoints are separate from the image_generation tool inside Responses. Capabilities depend on the selected model.

Model Current direct API scope
gpt-image-2 Single-image generation
doubao-seedream-5-0-pro-260628 Text-to-image, one or multiple reference images, single-image output
Terminal window
curl https://api.nexinfer.com/v1/images/generations \
-H "Authorization: Bearer $NEXINFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "A clean product illustration of an API gateway",
"size": "1024x1024",
"n": 1
}'

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 that only support multipart edits can use /v1/images/edits with uploaded Seedream reference images:

Terminal window
curl https://api.nexinfer.com/v1/images/edits \
-H "Authorization: Bearer $NEXINFER_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"

Seedream returns exactly one output; n must be 1. The first reference image 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.

OpenAI’s official Images API supports model-dependent size, quality, count, format, streaming, and edits. NexInfer currently guarantees one generated image for gpt-image-2. Tests did not preserve requested low/medium/high quality or exact 1024x1024 / 1024x1536 dimensions, and n=2 was rejected. Do not design against the complete official capability matrix; use the live NexInfer model catalog and request logs for current pricing and billing.

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