From 2174ac6015a5e5259bb8ba443e7bf7e3f56387b4 Mon Sep 17 00:00:00 2001 From: Antonio Cheong Date: Wed, 12 Apr 2023 18:54:54 +0800 Subject: [PATCH] add script --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index a500c40..583939a 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,36 @@ Create a fake API using ChatGPT's website **API endpoint: http://127.0.0.1:8080/v1/chat/completions.** ## Setup + +### Authentication Access token retrieval has been automated: https://github.com/acheong08/ChatGPT-to-API/tree/master/tools/authenticator +Converting from a newline delimited list of access tokens to `access_tokens.json` +```bash +#!/bin/bash + +START="[" +END="]" + +TOKENS="" + +while read -r line; do + if [ -z "$TOKENS" ]; then + TOKENS="\"$line\"" + else + TOKENS+=",\"$line\"" + fi +done < access_tokens.txt + +echo "$START$TOKENS$END" > access_tokens.json +``` + +### Cloudflare annoyances +`export PUID="user-..."` +or +`export API_REVERSE_PROXY="https://bypass.churchless.tech/api/conversation"` + ## Docker build & Run ```bash