GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenAI::API::Request::Image::Generation(3) User Contributed Perl Documentation OpenAI::API::Request::Image::Generation(3)

OpenAI::API::Request::Image::Generation - generates images from a prompt

    use OpenAI::API::Request::Image::Generation;
    my $request = OpenAI::API::Request::Image::Generation->new(
        prompt => 'A cute baby sea otter',
        size   => '256x256',
        n      => 1,
    );
    my $res = $request->send();
    my @images = @{ $res->{data} };

Creates an image given a prompt.

new()

  • prompt

    A text description of the desired image(s).

  • n [optional]

    The number of images to generate. Must be between 1 and 10. Defaults to 1.

  • size [optional]

    The size of the generated images. Must be one of "256x256", "512x512", or "1024x1024". Defaults to "1024x1024".

  • response_format [optional]

    The format in which the generated images are returned. Must be one of "url" or "b64_json". Defaults to "url".

  • user [optional]

    A unique identifier representing your end-user.

send()

Sends the request and returns a data structured similar to the one documented in the API reference.

OpenAI API Reference: Models <https://platform.openai.com/docs/api-reference/images>

2023-03-26 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.