Image Edits

MethodPath
POST/v1/images/edits

This endpoint uses multipart/form-data and forwards the original body and Content-Type upstream, so clients should call POST /v1/images/edits with multipart upload semantics.

bash
curl https://api.modelgo.ai/v1/images/edits \
  -H "Authorization: Bearer $MODELGO_API_KEY" \
  -F "model=<model>" \
  -F "prompt=add a neon background" \
  -F "image=@./cat.png"

If the routed upstream model does not support image editing, the gateway returns provider_unsupported.

Response shape

The data[] delivery shape depends on the model the request is routed to:

  • gpt-image family (gpt-image-2 / gpt-image-2.5-*): the upstream does not accept response_format, so the gateway strips it before forwarding without an error; images are always returned as data[].b64_json — there is no url form.
  • Qwen Image, Seedream and other models: follow each model's official behavior; the gateway does not convert. Qwen Image returns data[].url (b64_json is ignored); Seedream defaults to url and accepts response_format: "b64_json". Full table: Image generation.

Clients should therefore handle both shapes:

python
item = resp["data"][0]
if item.get("b64_json"):
    image = base64.b64decode(item["b64_json"])
else:
    image = urllib.request.urlopen(item["url"]).read()

Values such as size / quality follow what can actually be delivered; an unsupported value returns 400 with a reason. See GPT Image for the accepted values.