gptimage2
gptimage2Use the GPTimage2 API for AI image generation. Describe the subject, composition, and style in the image request. Create illustrations, design concepts, and visual assets. Compare the available provider routes, request examples, and usage prices on OpenAny.
Auto route pricing
Route source: Tencent
- Input / Output
- Input: Price not suppliedOutput: $1.379
- Cache read / write
- Cache read: Price not suppliedCache write: Price not supplied
- Context / Max output
- — / —
- Live routes
- 1
Rates / 1M tokens
Image output: Price not supplied
These are separate usage rates, not a total request price.
On this page
Overview
Use the GPTimage2 API for AI image generation. Describe the subject, composition, and style in the image request. Create illustrations, design concepts, and visual assets. Compare the available provider routes, request examples, and usage prices on OpenAny.
Playground
Result preview
Tencent · 284ms
Response example. Run to see the actual response.

{
"data": [
{
"url": "https://openmodels.market/api/v1/public/files/download?key=key-market%2Fplaygrounds%2F2026%2F09%2F11%2Fd02700b5-7252-4d2f-8e96-4dfaf93a2275.png"
}
],
"size": "1024x1024",
"created": 1789137470,
"quality": "low",
"background": "opaque",
"request_id": "f6f115a5-2fe2-4e83-9634-f833246b41db",
"output_format": "png",
"tokenhub_usage": {
"total_tokens": 3974
},
"openmodels_cost": 5887
}Agent handoff preview
Providers
| Provider | Pricing | Latency | Uptime | Supply | Route |
|---|---|---|---|---|---|
Live | Output $1.379 / 1M tokens Input — Cache read — Cache write — | 284ms | — | Verified |
- Output
- $1.379
Source: the selected provider route in OpenAny's public model catalog. A price update timestamp is not supplied.
API
- Base URL
https://api.openany.si/v1- POST
/v1/images- POST
/v1/images/edit- Authentication
Authorization: Bearer $OPENANY_API_KEY
Request parameters
| Parameter | Type / range | Default value | Required | Description |
|---|---|---|---|---|
model | string | — | Yes | The model to use |
background | string · transparent | opaque | auto | auto | No | Background transparency setting. Available values are transparent, opaque, and auto. The custom-imagemodel-gt model does not support transparent. |
images | array | — | No | Input image references. Supports 1 to 16 images. Each image reference must use either image_url or file_id, but not both. edit only. |
logo_add | integer · 0 | 1 | 1 | No | Switch for adding an AI-generated content label. 1 adds the label, 0 disables it only after console approval. Other values are treated as 1 by default. |
mask | object | — | No | Mask image reference. Transparent areas are treated as editable regions. PNG format is required. Use either image_url or file_id, but not both. edit only. |
n | integer · 1 ~ 10 | 1 | No | Number of images to generate. Must be between 1 and 10. Values greater than 1 may fail when compute capacity is insufficient. |
output_compression | integer · 0 ~ 100 | 100 | No | Output compression level from 0 to 100. This parameter is only supported when output_format is jpeg. |
output_format | string · png | jpeg | — | No | Output image format. Available values are png and jpeg. |
prompt | string | — | No | Text description for image generation or editing. Maximum length is 32,000 characters. |
quality | string · auto | high | medium | low | — | No | Output image quality. Available values are auto, high, medium, and low. |
response_format | string · url | b64_json | url | No | Response format for generated images. Available values are url and b64_json. |
route | object | — | No | OpenModel route configuration, including provider and other routing parameters. Example: {"provider":"Tencent"}. |
size | string | auto | No | Generated image size. Standard values include 1024x1024, 1536x1024, 1024x1536, and auto. Custom sizes are also supported: each side must be no more than 3840px, width and height must be multiples of 16, aspect ratio must be no more than 3:1, and total pixels must be between 655,360 and 8,294,400. |
Request example
curl 'https://api.openany.si/v1/images' \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gptimage2",
"prompt": "小猫跳舞",
"quality": "low",
"size": "auto",
"background": "auto",
"logo_add": 1,
"n": 1,
"output_compression": 100,
"response_format": "url"
}'Response example
Configured response example · not a live result
{
"data": [
{
"url": "https://openmodels.market/api/v1/public/files/download?key=key-market%2Fplaygrounds%2F2026%2F09%2F11%2Fd02700b5-7252-4d2f-8e96-4dfaf93a2275.png"
}
],
"size": "1024x1024",
"created": 1789137470,
"quality": "low",
"background": "opaque",
"request_id": "f6f115a5-2fe2-4e83-9634-f833246b41db",
"output_format": "png",
"tokenhub_usage": {
"total_tokens": 3974
},
"openmodels_cost": 5887
}Error handling
400Check the model ID and request fields.429Retry with exponential backoff.5xxRetry only temporary provider failures.JSON Schema
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"model"
],
"properties": {
"n": {
"type": "integer",
"default": 1,
"maximum": 10,
"minimum": 1,
"description": "Number of images to generate. Must be between 1 and 10. Values greater than 1 may fail when compute capacity is insufficient."
},
"mask": {
"type": "object",
"description": "Mask image reference. Transparent areas are treated as editable regions. PNG format is required. Use either image_url or file_id, but not both. edit only."
},
"size": {
"type": "string",
"default": "auto",
"description": "Generated image size. Standard values include 1024x1024, 1536x1024, 1024x1536, and auto. Custom sizes are also supported: each side must be no more than 3840px, width and height must be multiples of 16, aspect ratio must be no more than 3:1, and total pixels must be between 655,360 and 8,294,400."
},
"model": {
"type": "string",
"description": "The model to use"
},
"route": {
"type": "object",
"description": "OpenModel route configuration, including provider and other routing parameters. Example: {\"provider\":\"Tencent\"}."
},
"images": {
"type": "array",
"items": {
"type": "object"
},
"description": "Input image references. Supports 1 to 16 images. Each image reference must use either image_url or file_id, but not both. edit only."
},
"prompt": {
"type": "string",
"description": "Text description for image generation or editing. Maximum length is 32,000 characters."
},
"quality": {
"enum": [
"auto",
"high",
"medium",
"low"
],
"type": "string",
"description": "Output image quality. Available values are auto, high, medium, and low."
},
"logo_add": {
"enum": [
0,
1
],
"type": "integer",
"default": 1,
"description": "Switch for adding an AI-generated content label. 1 adds the label, 0 disables it only after console approval. Other values are treated as 1 by default."
},
"background": {
"enum": [
"transparent",
"opaque",
"auto"
],
"type": "string",
"default": "auto",
"description": "Background transparency setting. Available values are transparent, opaque, and auto. The custom-imagemodel-gt model does not support transparent."
},
"output_format": {
"enum": [
"png",
"jpeg"
],
"type": "string",
"description": "Output image format. Available values are png and jpeg."
},
"response_format": {
"enum": [
"url",
"b64_json"
],
"type": "string",
"default": "url",
"description": "Response format for generated images. Available values are url and b64_json."
},
"output_compression": {
"type": "integer",
"default": 100,
"maximum": 100,
"minimum": 0,
"description": "Output compression level from 0 to 100. This parameter is only supported when output_format is jpeg."
}
}
}Examples
Request example
POST /v1/imagescurl 'https://api.openany.si/v1/images' \
-H "Authorization: Bearer $OPENANY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gptimage2",
"prompt": "小猫跳舞",
"quality": "low",
"size": "auto",
"background": "auto",
"logo_add": 1,
"n": 1,
"output_compression": 100,
"response_format": "url"
}'