ShareGPT

command module
v0.0.0-...-5bdc60f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2023 License: Unlicense Imports: 13 Imported by: 0

README

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"
    }
  ]
}'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
This file contains checks for the validity of OpenAI API keys and how much credit is left.
This file contains checks for the validity of OpenAI API keys and how much credit is left.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL