Image generation
POST
/v1/images/generationsGenerate 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
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | An image model ID returned by /v1/models. |
prompt | string | Yes | The image generation or editing prompt. |
image_url | string | No | A reference image URL when supported by the model. |
image_urls | string[] | No | Multiple reference image URLs when supported by the model. |
bbox_list | integer[][][] | No | Reference image regions when supported by the model. |
enable_sequential | boolean | No | Enables sequential generation when supported. |
thinking_mode | boolean | No | Enables model thinking mode when supported. |
n | integer | No | Requested image count; it must be greater than 0. |
size | string | No | Requested dimensions; accepted values depend on the model. |
resolution | string | No | Requested resolution; accepted values depend on the model. |
quality | string | No | Requested quality tier; accepted values depend on the model. |
background | string | No | Background mode when supported by the model. |
mask_url | string | No | Mask URL for local edits when supported by the model. |
style | string | No | A style hint when supported by the model. |
watermark | boolean | No | Requests a watermark when supported by the Provider. |
response_format | string | No | Requests URL, Base64, or another supported response form. |
seed | integer | No | A random seed when supported by the Provider. |
guidance_scale | number | No | Prompt guidance strength; range depends on the model. |
stream | boolean | No | Streaming support depends on the route and is unavailable on some routes. |
output_format | string | No | Output file format when supported by the model. |
sequential_image_generation | string | No | Sequential generation mode when supported. |
sequential_image_generation_options | object | No | Model-specific sequential generation options. |
tools | object[] | No | Model tools forwarded only by supporting routes. |
optimize_prompt_options | object | No | Model-specific prompt optimization options. |
user | string | No | A caller-defined user identifier. |
metadata | object | No | Caller-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_idWhen 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.