Routescope APIRoutescope API
Image ModelsOpenAI-Style Images

Image Generation

OpenAI-style image generation API

The OpenAI-style image generation endpoint is suitable for applications already integrated with the OpenAI Images protocol. The endpoint request timeout is 150 seconds.

POST
/v1/images/generations
curl -X POST "https://api.routescope.ai/v1/images/generations" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-image-2",    "prompt": "The ability to describe this API gateway in plain Chinese."  }'
{
  "created": 1,
  "data": {}
}

Authorization

BearerAuth

AuthorizationBearer <token>

Model relay interface recognition. Request heading: Autoration: Bearer .

In: header

Request Body

application/json

model*string

Picture model name.

Default"gpt-image-2"
prompt*string

Inverted words. Range: 1 to 200000 characters, with a specific upper limit based on the model official interface.

n?integer

Returns the number of pictures. Creates the number of candidates. Scope: 1 to 10; specific ceilings are based on the model official interface.

Range1 <= value <= 10
size?string

Generates dimensions, such as FD_PROTEC_0.

quality?string

Generates a quality slot.

style?string

Generates style.

response_format?string

Picture returns format, e. g. FD_PROTEC_0 or FD_PROTEC_1__.

user?string

End-user identification.

Response Body

application/json

Model Selection

Model IDCapabilityDescription
gpt-image-2Image generationExample model for the OpenAI-style image generation endpoint.

Common Parameters

FieldTypeRequiredDescription
modelstringYesThe example uses gpt-image-2.
promptstringYesGeneration prompt.
sizestringNoImage size.
nintegerNoNumber of images to generate.

Example Code

curl https://api.routescope.ai/v1/images/generations \
  -H "Authorization: Bearer $ROUTESCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Generate a modern API documentation cover",
    "size": "1024x1024",
    "n": 1
  }'

How is this guide?

Last updated on