跳转到主要内容
POST
/
v1
/
images
/
generations
Generate Image
curl --request POST \
  --url https://utoken-test.uuzu.com/v1/images/generations/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "model": "<string>",
  "n": 123,
  "size": "<string>",
  "background": "<string>",
  "moderation": "<string>",
  "quality": "<string>",
  "stream": "<string>",
  "style": "<string>",
  "user": "<string>"
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>"
    }
  ],
  "usage": {
    "total_tokens": 123,
    "input_tokens": 123,
    "output_tokens": 123,
    "input_tokens_details": {
      "text_tokens": 123,
      "image_tokens": 123
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.utoken.wgame-hk.com/llms.txt

Use this file to discover all available pages before exploring further.

请求体

application/json
prompt
string
必填

A text description of the desired image(s). The maximum length is 32000 characters for gpt-image-1, 1000 characters for dall-e-2, and 4000 characters for dall-e-3.

model
string

The model to use for image generation. Must be one of dall-e-2, dall-e-3, or gpt-image-1. Defaults to dall-e-2 unless using parameters specific to gpt-image-1.

n
integer

The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.

size
string

The size of the generated images. For gpt-image-1, must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default). For dall-e-2, must be one of 256x256, 512x512, or 1024x1024. For dall-e-3, must be one of 1024x1024, 1792x1024, or 1024x1792.

background
string

Allows setting transparency for the background of generated images. This parameter only supports gpt-image-1. Must be one of transparent, opaque, or auto (default). When using auto, the model will automatically determine the optimal background for the image.

If transparent, the output format needs to support transparency, so it should be set to png (default) or webp.

moderation
string

Controls the content moderation level for images generated by gpt-image-1. Must be low for less restrictive filtering or auto (default).

quality
string

The quality of the generated image.

stream
string
style
string
user
string

响应

200 - application/json

Response

created
integer
必填
data
object[]
必填
usage
object
必填