=encoding utf8

=head1 NAME

OpenAPI::Client::OpenAI::Path::images-variations - Documentation for the /images/variations path.

=head1 OPERATIONS

=head2 POST /images/variations

=head3 createImageVariation

  $client->create_image_variation({
      body => { ... },
  });

Creates a variation of a given image. This endpoint only supports C<dall-e-2>
.

=head4 Responses

B<200 - OK>

Content-Type: application/json

Example:

    {
       "background" : "transparent",
       "created" : 1713833628,
       "data" : [
          {
             "b64_json" : "..."
          }
       ],
       "output_format" : "png",
       "quality" : "high",
       "size" : "1024x1024",
       "usage" : {
          "input_tokens" : 50,
          "input_tokens_details" : {
             "image_tokens" : 40,
             "text_tokens" : 10
          },
          "output_tokens" : 50,
          "total_tokens" : 100
       }
    }

=head1 SCHEMAS

=head2 CreateImageVariationRequest

Properties:

=over

=item * C<image> (string, required) - The image to use as the basis for the variation(s). Must be a valid PNG file,
less than 4MB, and square.

=item * C<model> (anyOf) - The model to use for image generation. Only C<dall-e-2> is supported at this
time.

Default: dall-e-2

=item * C<n> (integer) - The number of images to generate. Must be between 1 and 10.

Default: 1

=item * C<response_format> (string) - The format in which the generated images are returned. Must be one of C<url>
or C<b64_json> . URLs are only valid for 60 minutes after the image has been
generated.

Allowed values: url, b64_json

Default: url

=item * C<size> (string) - The size of the generated images. Must be one of C<256x256> , C<512x512> , or
C<1024x1024> .

Allowed values: 256x256, 512x512, 1024x1024

Default: 1024x1024

=item * C<user> (string) - A unique identifier representing your end-user, which can help OpenAI to
monitor and detect abuse.
L<Learn more|https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids>
.

=back

=head2 Image

Properties:

=over

=item * C<b64_json> (string) - The base64-encoded JSON of the generated image. Returned by default for the
GPT image models, and only present if C<response_format> is set to C<b64_json>
for C<dall-e-2> and C<dall-e-3> .

=item * C<revised_prompt> (string) - For C<dall-e-3> only, the revised prompt that was used to generate the image.

=item * C<url> (string) - When using C<dall-e-2> or C<dall-e-3> , the URL of the generated image if
C<response_format> is set to C<url> (default value). Unsupported for the GPT
image models.

=back

=head2 ImageGenInputUsageDetails

Properties:

=over

=item * C<image_tokens> (integer, required) - The number of image tokens in the input prompt.

=item * C<text_tokens> (integer, required) - The number of text tokens in the input prompt.

=back

=head2 ImageGenOutputTokensDetails

Properties:

=over

=item * C<image_tokens> (integer, required) - The number of image output tokens generated by the model.

=item * C<text_tokens> (integer, required) - The number of text output tokens generated by the model.

=back

=head2 ImageGenUsage

Properties:

=over

=item * C<input_tokens> (integer, required) - The number of tokens (images and text) in the input prompt.

=item * C<input_tokens_details> (ImageGenInputUsageDetails, required)

See L</ImageGenInputUsageDetails> below for shape.

=item * C<output_tokens> (integer, required) - The number of output tokens generated by the model.

=item * C<output_tokens_details> (ImageGenOutputTokensDetails)

See L</ImageGenOutputTokensDetails> below for shape.

=item * C<total_tokens> (integer, required) - The total number of tokens (images and text) used for the image generation.

=back

=head2 ImagesResponse

Properties:

=over

=item * C<background> (string) - The background parameter used for the image generation. Either C<transparent>
or C<opaque> .

Allowed values: transparent, opaque

=item * C<created> (integer, required) - The Unix timestamp (in seconds) of when the image was created.

=item * C<data> (array of Image) - The list of generated images.

=item * C<output_format> (string) - The output format of the image generation. Either C<png> , C<webp> , or
C<jpeg> .

Allowed values: png, webp, jpeg

=item * C<quality> (string) - The quality of the image generated. Either C<low> , C<medium> , or C<high> .

Allowed values: low, medium, high

=item * C<size> (string) - The size of the image generated. Either C<1024x1024> , C<1024x1536> , or
C<1536x1024> .

Allowed values: 1024x1024, 1024x1536, 1536x1024

=item * C<usage> (ImageGenUsage)

See L</ImageGenUsage> below for shape.

=back

=head1 SEE ALSO

L<OpenAPI::Client::OpenAI::Path>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.14.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
