request_base {gptstudio} | R Documentation |
Base for a request to the OPENAI API
Description
This function sends a request to a specific OpenAI API task
endpoint at
the base URL https://api.openai.com/v1
, and authenticates with
an API key using a Bearer token.
Usage
request_base(task, token = Sys.getenv("OPENAI_API_KEY"))
Arguments
task |
character string specifying an OpenAI API endpoint task |
token |
String containing an OpenAI API key. Defaults to the OPENAI_API_KEY environmental variable if not specified. |
Value
An httr2 request object
[Package gptstudio version 0.4.0 Index]