Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.
SprytinPublic archive

About

πŸ” 🌱 Reverse engineered ChatGPT API based on https://github.com/acheong08/ChatGPT proxy

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

10 Commits

Folders and files

Repository files navigation

Kotlin Spring ChatGPT REST API

Kotlin Spring REST API version of reverse engineered ChatGPT API https://github.com/acheong08/ChatGPT proxy

You can use multiple tokens, and the load between them will be balanced.

Technologies Used

  • Kotlin 1.7.22
  • Spring Boot 3.0.3

Installation

  1. clone
git clone https://github.com/Sprytin/ChatGPT.git
  1. add your tokens
bridge:
  #Cloudflare bypass proxy url
  proxyUrl: https://chatgpt.duti.tech/api/conversation  
  #https://chat.openai.com/api/auth/session chatGPT access token
  tokens:
    - "<TOKEN>"
    - "<SECOND_TOKEN>"
    - ...
  1. run
./gradlew bootRun

How to use

curl -X POST http://localhost:8080/api/v1/ask \
  -H 'Content-Type: application/json' \
  -d '{"message":"Hello, how are you?"}'

Stream endpoint

curl -X POST http://localhost:8080/api/v1/ask/stream \
  -H 'Content-Type: application/json' \
  -d '{"message":"Hello, how are you?"}'

With conversationId and parentMessageId

curl -X POST http://localhost:8080/api/v1/ask \
  -H 'Content-Type: application/json' \
  -d '{"message": "What is your name?", "conversationId": "<conversation_id>", "parentMessageId": "<parent_message_id>"}'

Answer

{
    "answer": "My name is ChatGPT.",
    "messageId": "ec5d559b-7085-4b4d-adb1-0e4e3d07d42c",
    "conversationId": "0d6cf11e-5c77-41b4-b732-0f7a537fff2c"
}

TODO()

Error Handling

About

πŸ” 🌱 Reverse engineered ChatGPT API based on https://github.com/acheong08/ChatGPT proxy

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages