blob: e07ca468d806541a57604bd07a9ed3994b6a6eb0 [file] [log] [blame]
ben-aaron18885c32a02022-09-10 20:30:30 +02001% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/authenticate.R
3\name{gpt3_authenticate}
4\alias{gpt3_authenticate}
5\title{Set up the authentication with your API key}
6\usage{
7gpt3_authenticate(path)
8}
9\arguments{
10\item{path}{The file path to the API key}
11}
12\value{
13A confirmation message
14}
15\description{
16Access to GPT-3's functions requires an API key that you obtain from \url{https://openai.com/api/}. \code{gpt3_authenticate()} looks for your API key in a file that you provide the path to and ensures you can connect to the models. \code{gpt3_endsession()} overwrites your API key \emph{for this session} (it is recommended that you run this when you are done). \code{check_apikey_form()} is a simple check if any information has been provided at all.
17}
18\details{
19The easiest way to store you API key is in a \code{.txt} file with \emph{only} the API key in it (without quotation marks or other common string indicators). \code{gpt3_authenticate()} reads the single file you point it to and retrieves the content as authentication key for all requests.
20}
21\examples{
22# Starting a session:
23gpt3_authenticate(path = './YOURPATH/access_key.txt')
24# After you are finished:
25gpt3_endsession()
26}