Image Generation

MethodPath
POST/v1/images/generations

The request body follows the OpenAI Images-compatible shape and is forwarded to an upstream provider that supports image generation. The main entrypoint is POST /v1/images/generations.

bash
curl https://api.modelgo.ai/v1/images/generations \
  -H "Authorization: Bearer $MODELGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<model>","prompt":"a cat in neon city"}'

Common optional fields include size, quality, and n, subject to upstream model support.

Response shape

Whether data[] carries url or b64_json follows each model's official behavior: the gateway does not convert between the two and does not host images on your behalf. response_format is forwarded to models that accept it; for models that do not, see the table below.

ModelDefault shaperesponse_format
gpt-image family (gpt-image-2 / gpt-image-2.5-*)b64_jsonNot accepted upstream; the gateway strips it before forwarding without an error, and always returns b64_json
Qwen Image (qwen-image-3.0 / qwen-image-3.0-pro)url (link valid for 24 hours)b64_json does not error but is ignored; the response still carries a url
Seedream (doubao-seedream-*)url (link valid for 24 hours)Both url and b64_json are supported

When switching models, do not hard-code data[0].url or data[0].b64_json; read whichever field is present (example: Image editing). Per-model details: GPT Image, Qwen Image, Seedream.

Seedream size limit example

Models such as doubao-seedream-5.0-lite impose a lower bound on size; too small a value is rejected upstream (HTTP 400 provider_invalid). For example, 1024x1024 may fail while 2048x2048 succeeds. See the official documentation for the exact minimum; full curl: API catalog.