gptimage2

gptimage2

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.

Published price
Output $1.379 / 1M tokens
Billing unit
/ 1M tokens
Context / Max output
— / —
Listed routes
1
Base URL
https://api.openany.si/v1
POST
/v1/images
POST
/v1/images/edit
Authentication
Authorization: Bearer $OPENANY_API_KEY

Provider

Call method
Published price Output $1.379 / 1M tokens

Request parameters

ParameterType / rangeDefault valueRequiredDescription
modelstring—YesThe model to use
backgroundstring · transparent | opaque | autoautoNoBackground transparency setting. Available values are transparent, opaque, and auto. The custom-imagemodel-gt model does not support transparent.
imagesarray—NoInput image references. Supports 1 to 16 images. Each image reference must use either image_url or file_id, but not both. edit only.
logo_addinteger · 0 | 11NoSwitch 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.
maskobject—NoMask 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.
ninteger · 1 ~ 101NoNumber of images to generate. Must be between 1 and 10. Values greater than 1 may fail when compute capacity is insufficient.
output_compressioninteger · 0 ~ 100100NoOutput compression level from 0 to 100. This parameter is only supported when output_format is jpeg.
output_formatstring · png | jpeg—NoOutput image format. Available values are png and jpeg.
promptstring—NoText description for image generation or editing. Maximum length is 32,000 characters.
qualitystring · auto | high | medium | low—NoOutput image quality. Available values are auto, high, medium, and low.
response_formatstring · url | b64_jsonurlNoResponse format for generated images. Available values are url and b64_json.
routeobject—NoOpenModel route configuration, including provider and other routing parameters. Example: {"provider":"Tencent"}.
sizestringautoNoGenerated 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

JSON
{
  "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."
    }
  }
}

Model API questions

How do I call gptimage2 through OpenAny?

Use model ID gptimage2 with an OpenAny key and the operation published in this model's API tab. The model API base is https://api.openany.si/v1. Confirm the protocol and request schema; model availability does not imply every OpenAI API operation is supported.

How is gptimage2 billed?

Compare the published rate and billing unit of the selected provider route. Input, output and cache token rates may differ. Image, audio and video models can use other units. Recorded usage determines the charge under that route's billing contract.

Are Community and Verified routes the same as an official publisher API?

No. Inspect the provider name and supply classification for the specific route. A marketplace listing or a supply label is not a claim of publisher endorsement, identical service or measured uptime. Different route prices may reflect different supply and conditions.

Where do these prices come from, and when were they updated?

Rates come from the provider routes in OpenAny's public model catalog, not an independent quote from the model publisher. The catalog does not supply a price update timestamp. A page or catalog snapshot date is not a price revision date. Compare supply, billing units, tiers and conditions; a lower listed rate alone does not establish equivalent service or explain the price difference.

Use gptimage2 with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.