Skip to content

Simple API for interacting with OpenAI's ChatGPT. Currently supports gpt3.5-turbo

Notifications You must be signed in to change notification settings

ElmosHomie492/chatgpt-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chatgpt-api-logo

About

You already know what ChatGPT is. This API is a simple implementation of the OpenAI API for GPT. In short...you can ask it questions!

Running

Before you begin, create a new API key here. Then, just set an environment variable called CHATGPT_API_KEY to the API key that was just generated. Then run go run main.go.

To test the API, run the following cURL command (replace APIKey with your base64 encoded API key):

curl --request POST \
  --url http://localhost:8080/askGPT \
  --header 'APIKey: YOUR_BASE64_ENCODED_API_KEY_HERE' \
  --header 'Content-Type: multipart/form-data' \
  --form 'question=what is 2+2?'

Base64 Encoding Help

If you don't know how to base64 encode a string, don't fear! It's really easy. Just run this:

echo $CHATGPT_API_KEY | base64

About

Simple API for interacting with OpenAI's ChatGPT. Currently supports gpt3.5-turbo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages