Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

acheong08/ShareGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShareGPT

To allow the sharing of API keys to create a free OpenAI API.

Requirements

Configuration

export REDIS_ADDRESS="HOST:PORT"
export REDIS_PASSWORD="..."

Installation

go install github.com/acheong08/ShareGPT@latest

export PATH=$PATH:$(go env GOPATH)/bin

Running

ShareGPT

API

GET /ping

Response: {"message": "pong"}

POST /api_key/submit

Request:

{ "api_key": "..." }

Response: A float64 with the amount of credit remaining

POST /api_key/delete

Request:

{ "api_key": "..." }

Response:

{
  "message": "API key deleted"
}

POST /v1/chat

This is the same as OpenAI's API

curl http://HOST:PORT/v1/chat \
 -H 'Content-Type: application/json' \
 -d '{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "user",
      "content": "Say this is a test"
    }
  ]
}'

About

To allow the sharing of API keys to create a free OpenAI API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages