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.
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
Model relay interface recognition. Request heading: Autoration: Bearer .
In: header
Request Body
application/json
Picture model name.
"gpt-image-2"Inverted words. Range: 1 to 200000 characters, with a specific upper limit based on the model official interface.
Returns the number of pictures. Creates the number of candidates. Scope: 1 to 10; specific ceilings are based on the model official interface.
1 <= value <= 10Generates dimensions, such as FD_PROTEC_0.
Generates a quality slot.
Generates style.
Picture returns format, e. g. FD_PROTEC_0 or FD_PROTEC_1__.
End-user identification.
Response Body
application/json
Model Selection
| Model ID | Capability | Description |
|---|---|---|
gpt-image-2 | Image generation | Example model for the OpenAI-style image generation endpoint. |
Common Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The example uses gpt-image-2. |
prompt | string | Yes | Generation prompt. |
size | string | No | Image size. |
n | integer | No | Number 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