Image generation

POST/v1/images/generations

Generate or edit images through a unified OpenAI Images-compatible endpoint.

The gateway always requires model and prompt. Availability and accepted values for other fields, as well as the image response form, depend on the selected model and Provider route.

Read the complete image guide for references, edits, Base64, and backoff polling

Core request fields

FieldTypeRequiredDescription
modelstringYesAn image model ID returned by /v1/models.
promptstringYesThe image generation or editing prompt.
image_urlstringNoA reference image URL when supported by the model.
image_urlsstring[]NoMultiple reference image URLs when supported by the model.
bbox_listinteger[][][]NoReference image regions when supported by the model.
enable_sequentialbooleanNoEnables sequential generation when supported.
thinking_modebooleanNoEnables model thinking mode when supported.
nintegerNoRequested image count; it must be greater than 0.
sizestringNoRequested dimensions; accepted values depend on the model.
resolutionstringNoRequested resolution; accepted values depend on the model.
qualitystringNoRequested quality tier; accepted values depend on the model.
backgroundstringNoBackground mode when supported by the model.
mask_urlstringNoMask URL for local edits when supported by the model.
stylestringNoA style hint when supported by the model.
watermarkbooleanNoRequests a watermark when supported by the Provider.
response_formatstringNoRequests URL, Base64, or another supported response form.
seedintegerNoA random seed when supported by the Provider.
guidance_scalenumberNoPrompt guidance strength; range depends on the model.
streambooleanNoStreaming support depends on the route and is unavailable on some routes.
output_formatstringNoOutput file format when supported by the model.
sequential_image_generationstringNoSequential generation mode when supported.
sequential_image_generation_optionsobjectNoModel-specific sequential generation options.
toolsobject[]NoModel tools forwarded only by supporting routes.
optimize_prompt_optionsobjectNoModel-specific prompt optimization options.
userstringNoA caller-defined user identifier.
metadataobjectNoCaller-defined metadata.

Request examples

curl
curl https://api.noxgate.net/v1/images/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"YOUR_MODEL_ID","prompt":"A quiet library at sunrise","n":1,"size":"1024x1024"}'
Python · requests
import requests

response = requests.post(
    "https://api.noxgate.net/v1/images/generations",
    headers={"Authorization": "Bearer sk-your-api-key"},
    json={"model": "YOUR_MODEL_ID", "prompt": "A quiet library at sunrise", "n": 1},
)
print(response.json())
Node.js · fetch
const response = await fetch("https://api.noxgate.net/v1/images/generations", {
  method: "POST",
  headers: { Authorization: "Bearer sk-your-api-key", "Content-Type": "application/json" },
  body: JSON.stringify({ model: "YOUR_MODEL_ID", prompt: "A quiet library at sunrise", n: 1 }),
});
console.log(await response.json());

Successful response

JSON
{
  "created": 1750000000,
  "data": [{ "url": "https://provider.example/generated-image.png", "size": "1024x1024" }],
  "usage": { "generated_images": 1 }
}

Retrieve an asynchronous task

GET/v1/images/generations/:task_id

When creation returns status and id without usable data, poll this endpoint by task ID. Treat succeeded, failed, and canceled as terminal states and enforce a maximum wait time.

curl
curl "https://api.noxgate.net/v1/images/generations/image_task_example" \
  -H "Authorization: Bearer sk-your-api-key"

Usage notes

  • Do not assume every image model accepts reference images, the same sizes, or the same optional fields.
  • Each response data item may contain url or b64_json; handle the field actually returned.
  • Billing follows the selected model configuration and actual usage; this guide does not fix an image price.