Passa al contenuto principale

Images Generations

POST 

/v1/images/generations

Follows the OpenAI Responses API spec: https://developers.openai.com/api/reference/resources/images/methods/generate

Request​

Body

required

    model stringrequired

    Identifier of the model to use.

    prompt stringrequired

    Prompt provided to the model.

    n integer

    Number of images to generate.

    Possible values: >= 1 and <= 10

    size string

    Image size between 1x1 and 512x512.

    Possible values: Value must match regular expression ^(0|[1-9][0-9]{0,2}|[1-4][0-9]{2}|512)x(0|[1-9][0-9]{0,2}|[1-4][0-9]{2}|512)$

    Default value: 512x512
    style string

    Possible values: [vivid, natural, auto]

    quality string

    Quality of image to generate Note: This property is accepted but ignored by the API.

    Possible values: [low, standard, hd]

    response_format string

    Format of image to generate Note: This property is accepted but ignored by the API.

    Possible values: [url, b64_json]

    Default value: b64_json
    user string

    User that requested image generation. Note: This property is accepted but ignored by the API.

Responses​

Successful Response

Schema

    created int64required
    background

    data

    object

    required

    b64_json string

    Base64-encoded image.

    revised_prompt stringnullable
    url urinullable
    output_format string
    quality
    size stringrequired

    Image size.

    usage

    object

    total_tokens integer
    input_tokens integer

    input_tokens_details

    object

    image_tokens integer
    text_tokens integer
    output_tokens integer
Loading...