OpenAI Images Compatible

OpenAI Images Compatible Image Generation

Use `POST /v1/images/generations` to call the unified image generation entry point, and select compatible models such as `gpt-image-1`, `dall-e-3`, and `dall-e-2` via `model`.

POSThttps://zx1.deepwl.net/v1/images/generations
Request
curl -X POST https://zx1.deepwl.net/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '
{
  "model": "gpt-image-1",
  "prompt": "A minimalist illustration for an API platform homepage, white background with teal accents",
  "n": 1,
  "size": "1024x1024",
  "quality": "auto",
  "response_format": "url"
}'
Response
{
  "created": 1735689600,
  "data": [
    {
      "url": "https://.../images/img-abc123.png",
      "revised_prompt": "A minimalist illustration for an API platform homepage, white background with teal accents"
    }
  ]
}

Submit text-to-image requests through the unified image generation entry point, and return an OpenAI Images-style response.

  • A unified image generation API that selects different image models through model.
  • Preserves the OpenAI Images response structure: created + data[].
  • Supports both url and b64_json response formats.
  • Size restrictions for dall-e-2 and dall-e-3 are validated directly by the unified layer.
  • When n is omitted or explicitly set to 0, the unified layer automatically defaults it to 1.

Request Headers

Authorizationstring必填

Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.

Content-Typestring必填

Request content type, must be application/json.

Request Body

modelstring必填

Model name. The unified layer requires this field to be present.

promptstring

Generation prompt. For image generation, it should be treated as required semantically; whether the request is ultimately blocked is determined jointly by the unified layer and the upstream provider.

ninteger

Number of images to generate. If omitted or explicitly set to 0, the unified layer falls back to 1.

sizestring

Output size. dall-e-2 accepts only 256x256, 512x512, and 1024x1024; dall-e-3 accepts only 1024x1024, 1024x1792, and 1792x1024.

qualitystring

Image quality. dall-e-3 defaults to standard; gpt-image-1 defaults to auto.

response_formatstring

Response format. Common values are url and b64_json. When b64_json or base64 is requested, the unified layer returns Base64 image data.

stylestring | object

Style field, passed through unchanged to supported upstream providers.

backgroundstring | object

Background control field, passed through unchanged to supported upstream providers.

watermarkboolean

Explicit watermark switch. false is semantically different from omitting it: omission means the default strategy is used, while false explicitly disables it.

Request Examples

Response Examples

Response Fields

createdinteger

Generation timestamp.

dataarray<object>

Array of generation results.

urlstring

The image URL returned when response_format = url.

b64_jsonstring

The Base64 image data returned when response_format = b64_json.

revised_promptstring

Some upstream providers rewrite the prompt and return it in this field.

metadataobject

Additional metadata. Whether it exists depends on the specific channel.

Use Cases

Basic Image Generation

curl -X POST https://zx1.deepwl.net/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-1",
    "prompt": "Generate a clean product poster"
  }'

High-Quality DALL·E 3

curl -X POST https://zx1.deepwl.net/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A sci-fi city nightscape illustration",
    "size": "1792x1024",
    "quality": "hd",
    "response_format": "url"
  }'

Base64 Output

curl -X POST https://zx1.deepwl.net/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-1",
    "prompt": "Generate a clean poster of an icon set",
    "response_format": "b64_json"
  }'

Notes

This page describes only the common semantics of the unified entry point, and does not mean that all image channels support exactly the same fields. Whether fields such as style, background, and watermark actually take effect depends on the final channel that is hit.