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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址