NAME OpenAI::API - Perl interface to OpenAI API VERSION 0.28 SYNOPSIS use OpenAI::API; use OpenAI::API::Request::Chat; my $config = OpenAI::API->new(); # uses OPENAI_API_KEY environment variable my $request = OpenAI::API::Request::Chat->new( model => "gpt-3.5-turbo", messages => [ { "role" => "system", "content" => "You are a helpful assistant." }, { "role" => "user", "content" => "Who won the world series in 2020?" }, { "role" => "assistant", "content" => "The Los Angeles Dodgers won the World Series in 2020." }, { "role" => "user", "content" => "Where was it played?" } ], ); my $res = $request->send($config); DESCRIPTION OpenAI::API is a Perl module that provides an interface to the OpenAI API, which allows you to generate text, translate languages, summarize text, and perform other tasks using the language models developed by OpenAI. To use the OpenAI::API module, you will need an API key, which you can obtain by signing up for an account on the OpenAI website . INSTALLATION If you have cpanm, you only need one line: % cpanm OpenAI::API Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan OpenAI::API As a last resort, you can manually install it: perl Makefile.PL make make test make install If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation . DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc OpenAI::API AUTHOR Nelson Ferraz SUPPORT This module is developed on GitHub . Send ideas, feedback, tasks, or bugs to GitHub Issues . COPYRIGHT AND LICENSE Copyright (C) 2022, 2023 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.30.2 or, at your option, any later version of Perl 5 you may have available.