GRGlobalRouter Docs
Console

Images / POST

Create image

Creates an OpenAI-compatible image generation request.

Endpoints

Mobile only shows the endpoint list. View parameter details and examples on desktop.

MethodEndpointDescription
POST/v1/images/generationsCreates an OpenAI-compatible image generation request.
POST/v1/images/generations

Used to migrate OpenAI-style image generation calls. GlobalRouter handles model availability, tenant permissions, and billing rules.

Back to Images endpoint list

Request parameters

FieldTypeRequiredDescription
modelstringYesImage model ID.
promptstringYesImage generation prompt.
providerstringNoSpecify provider preferences.
routingobjectNoRouting preference, such as provider or strategy tags.
backgroundstringNoBackground mode; supported values depend on the model.
imagesstring[]NoReference image URL or data URL list.
image_urlstringNoSingle reference image URL.
image_sizestringNoProvider-style image size alias.
input_fidelitystringNoReference image fidelity.
mask_urlstringNoMask URL for partial editing.
sizestringNoOutput size, such as 1024x1024.
aspect_ratiostringNoAspect ratio, such as 1:1, 16:9, or 9:16.
resolutionstringNoResolution tier; supported values depend on the model.
nintegerNoNumber of images to generate.
output_compressionintegerNoOutput compression quality from 0 to 100.
output_formatstringNoOutput format, such as png, jpeg, or webp.
response_formatstringNoReturn url or b64_json, depending on model capability.
qualitystringNoQuality tier; supported values depend on the model.
stylestringNoStyle parameter; supported values depend on the model.
seedintegerNoRandom seed.
payloadstringNoRaw payload marker or content passed through to a compatible provider.
callback_urlstringNoAsync callback URL when supported by the provider.
srobjectNoSuper Resolution post-processing config, including provider, mode, and resolution.
userstringNoApplication-side user identifier.

Response fields

FieldTypeRequiredDescription
createdintegerNoCreation timestamp.
dataarrayYesImage artifact list.
data[].urlstringNoImage artifact URL.
data[].original_urlstringNoOriginal image URL when SR is enabled.
data[].srobjectNoProcessing summary when SR is enabled.
data[].sr.output_urlstringNoSR-enhanced image URL.
usageobjectNoUsage and billing information.

Errors

401UNAUTHORIZED

Missing or invalid Authorization Bearer token.

403FORBIDDEN

The current API key is not allowed to call this scope or model.

429RATE_LIMITED

请求过快或异步任务队列已满,请降低并发或稍后重试。

Notes

  • Image URLs should be treated as short-lived artifact addresses. Download or transfer them in your application when long-term retention is required.