APIMaster.ai

Image API — Choose the Model and Endpoint

Compare GPT Image 2 / 2.5, Gemini Flash Image and Seedream image endpoints. Use multipart edits for GPT reference images and follow each model's own input format.

Image API overview

APIMaster provides image APIs under https://apimaster.ai/v1. Image-to-image does not use one universal input format across all models. Choose the model first, then use its documented endpoint and reference fields.

Model and endpoint guide

Model Text-to-image Image-to-image Guide
gpt-image-2 JSON /images/generations Multipart /images/edits, image / image[] files GPT Image 2 / 2.5
gpt-image-2.5-sunburst JSON /images/generations Multipart /images/edits, image / image[] files GPT Image 2 / 2.5
gpt-image-2.5-flare JSON /images/generations Multipart /images/edits, image / image[] files GPT Image 2 / 2.5
gemini-3.1-flash-image-preview JSON /images/generations JSON /images/generations with image_urls Gemini Flash Image
grok-imagine-image-2.0 JSON /images/generations JSON /images/generations with image_urls (up to 5) Grok Imagine Image 2.0
doubao-seedream-5-0-pro-260628 JSON /images/generations JSON /images/generations with image Seedream 5.0 Pro
midjourney-v8.2 Async /midjourney/generations JSON image_urls references Midjourney v8.2 / Niji 7
midjourney-niji-7 Async /midjourney/generations JSON image_urls references Midjourney v8.2 / Niji 7

For Grok Imagine Image 2.0, use synchronous /images/generations with image_urls. The client async and /images/edits paths are not supported; see the Grok Imagine Image 2.0 guide.

For GPT reference images, upload actual files to /images/edits for an image response or /images/edits/async for a task response; do not copy the Gemini or Seedream JSON format. Mentioning references in the prompt is not an upload. GPT Image 2.5 is a separate model family, not a GPT Image 2 alias.

Midjourney v8.2 and Niji 7 create asynchronous tasks through /midjourney/generations; poll GET /tasks/{task_id}. See the Midjourney v8.2 / Niji 7 guide for parameters and examples.

Authentication and responses

  • Create a key in the console; send Authorization: Bearer YOUR_API_KEY.
  • JSON generation calls use Content-Type: application/json. For multipart edits, let the HTTP client generate the Content-Type and boundary.
  • Synchronous image responses contain data[] with url or b64_json; handle both formats. Download temporary URLs promptly.
  • Optional fields, reference limits, sizes and prices depend on the model and available route. Check the model guide and marketplace.

Asynchronous work

POST /images/generations/async, POST /images/edits/async and GET /tasks/{task_id}?model=MODEL_ID provide task-based image workflows for supported models. This is not a universal mode for every image operation:

  • For GPT Image 2, Sunburst and Flare, use JSON generations/async for text-to-image and multipart edits/async for editing. Upload the same files as synchronous edits, then poll with the submitting account and the same model ID.
  • Generation or editing may finish before the async submission returns a task ID; do not assume submission is instantaneous. Do not resubmit an existing task while polling it. Completion can be succeeded, success or completed; tracked results use a string url, while legacy results may contain a URL array.
  • Gemini has its own async generation flow; follow its guide for reference inputs.
  • Seedream 5.0 Pro uses synchronous generations and does not support /images/generations/async.

See the model guides for complete cURL/Python examples, polling states and troubleshooting. An HTTP 200 response alone does not verify reference-image fidelity.