GithubHelp home page GithubHelp logo

gezofg66 / chatgpt-to-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from acheong08/chatgpt-to-api

0.0 0.0 0.0 72 KB

Scalable unofficial ChatGPT API for production.

Python 3.48% Go 92.68% Dockerfile 3.84%

chatgpt-to-api's Introduction

ChatGPT-to-API

Create a fake API using ChatGPT's website

API endpoint: http://127.0.0.1:8080/v1/chat/completions.

Help needed

  • Documentation.

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

#!/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

Proxy used by default or export API_REVERSE_PROXY="https://your.own.proxy.com/api/conversation"

Docker build & Run

docker build -t chatgpt-to-api .

# Running the API
docker run --name chatgpttoapi -d -p 127.0.0.1:8080:8080 chatgpt-to-api

# API path
http://127.0.0.1:8080/v1/chat/completions

Admin API docs

https://github.com/acheong08/ChatGPT-to-API/blob/master/docs/admin.md

API usage docs

https://platform.openai.com/docs/api-reference/chat

Docker compose

Hub address

version: '3'

services:
  app:
    image: acheong08/chatgpt-to-api # Use latest tag
    container_name: chatgpttoapi
    restart: unless-stopped
    ports:
      - '8080:8080'
    environment:
      SERVER_HOST: 0.0.0.0
      SERVER_PORT: 8080
      ADMIN_PASSWORD: TotallySecurePassword
      # If the parameter API_REVERSE_PROXY is empty, the default request URL is https://ai.fakeopen.com/api/conversation

chatgpt-to-api's People

Contributors

jjkoh95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.