Provide free GPT-3.5 API service by reverse engineering the login-free ChatGPT website.

Overview

ChatGPT Free API

CI Docker Pulls

Provide free GPT-3.5 API service by reverse engineering the login-free ChatGPT website.

Note: This service requires the IP to be able to use the login-free Chatgpt normally.

Install

Docker

docker run -d -p 3040:3040 --name chatgpt-free-api xsigoking/chatgpt-free-api

Binaries for macOS, Linux, and Windows

Download it from GitHub Releases, unzip, and add chatgpt-free-api to your $PATH.

Usage

Run server

chatgpt-api-server                                  # Listening on 0.0.0.0:3040, no proxy
PORT=8080 chatgpt-api-server                        # Listening on port 8080
ALL_PROXY=http://localhost:18080 chatgpt-api-server # Use a proxy

Request Example

curl http://127.0.0.1:3040/v1/chat/completions \
  -i -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
  }'

License

The project is under the MIT License, Refer to the LICENSE file for detailed information.

Comments
  • Failed to get answer caused by: Invalid header value:

    Failed to get answer caused by: Invalid header value: "application/json"

    I tried:

    • running the server from the released binary
    • docker: docker run -d --name chatgpt-free-api xsigoking/chatgpt-free-api
    • docker-compose:
    version: '3'
    services:
      chatgpt-free-api:
        image: xsigoking/chatgpt-free-api:latest
        restart: always
        ports:
          - "3040:3040"
    

    Everything led to the same error:

    Screenshot 2024-04-10 at 12 07 41 Screenshot 2024-04-10 at 12 09 53

    System Software Overview:

      System Version: macOS 14.4.1 (23E224)
      Kernel Version: Darwin 23.4.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: echo
      User Name: Basil (bf)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 12 days, 20 hours, 11 minutes
    

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: Mac14,9
      Model Number: MPHE3SM/A
      Chip: Apple M2 Pro
      Total Number of Cores: 10 (6 performance and 4 efficiency)
      Memory: 16 GB
      System Firmware Version: 10151.101.3
      OS Loader Version: 10151.101.3
      Serial Number (system): M77K97QL9N
      Activation Lock Status: Disabled
    
    opened by bs10x 12
  • Error Decoding Response Body

    Error Decoding Response Body

    chatgpt-free-api service running on a proxy in the USA

    curl http://127.0.0.1:3040/v1/chat/completions   -i -X POST   -H "Content-Type: application/json"   -d '{
        "model": "gpt-3.5-turbo",
        "messages": [
          {
            "role": "user",
            "content": "Hello!"
          }
        ],
        "stream": false
      }'
    

    returns:

    HTTP/1.1 200 OK
    content-type: application/json
    access-control-allow-origin: *
    access-control-allow-methods: GET,POST,PUT,PATCH,DELETE
    access-control-allow-headers: Content-Type,Authorization
    content-length: 98
    date: Thu, 18 Apr 2024 09:05:57 GMT
    
    {"status":false,"error":{"message":"error decoding response body","type":"invalid_request_error"}}
    

    log of the service:

    Access the API server at: http://0.0.0.0:3040/v1/chat/completions
    
    Environment Variables:
      - PORT: change the listening port, defaulting to 3040
      - ALL_PROXY: configure the proxy server, supporting HTTP, HTTPS, and SOCKS5 protocols
      - AUTHORIZATION: only for internal use to protect the API and will not be sent to OpenAI
    
    Please contact us at https://github.com/xsigoking/chatgpt-free-api if you encounter any issues.
    
    [2024-04-17T10:56:13Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T10:58:57Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:00:57Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:01:10Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:13:07Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:44:44Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:47:40Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:48:11Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:48:37Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:50:04Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:50:46Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:51:10Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:52:01Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T11:52:19Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T12:01:21Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-17T12:07:59Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T07:48:47Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T08:57:13Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:00:32Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:00:44Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:01:01Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:02:21Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:02:42Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:04:54Z ERROR] POST /v1/chat/completions 200 error decoding response body
    [2024-04-18T09:05:57Z ERROR] POST /v1/chat/completions 200 error decoding response body
    
    opened by bs10x 2
  • What is the reason for the error message?

    What is the reason for the error message?

    What is the reason for the error message { "status": false, "error":{ "message": "Failed to meet chat requirements, error decoding response body", "type": "invalid_request_error" } }

    opened by kutemao 1
  • The ChatGPT page is not working properly.  error is displayed:

    The ChatGPT page is not working properly. error is displayed:

    {"status":false,"error":{"message":"The requested endpoint was not found.","type":"invalid_request_error"}}

    opened by AndyLin2020 1
  • Failed to check the chat requirements, `{

    Failed to check the chat requirements, `{"details":"Unauthorized"}`

    Login-free ChatGPT is being gradually launched. It may not be available in your current region.

    OpenAI, April 1, 2024

    Starting today, you can use ChatGPT instantly, without needing to sign-up. We're rolling this out gradually, with the aim to make AI accessible to anyone curious about its capabilities.

    Run the following command to check if it is available

    curl 'https://chat.openai.com/backend-anon/sentinel/chat-requirements' \
      -H 'accept: */*' \
      -H 'accept-language: en' \
      -H 'cache-control: no-cache' \
      -H 'content-type: application/json' \
      -H 'oai-device-id: 31d07b2e-40ae-4af8-9501-573ed853e39b' \
      -H 'oai-language: en-US' \
      -H 'origin: https://chat.openai.com' \
      -H 'pragma: no-cache' \
      -H 'referer: https://chat.openai.com/' \
      -H 'sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "Windows"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-origin' \
      -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' \
      --data-raw '{}'
    

    If curl returns {"details":"Unauthorized"}, then login-free ChatGPT is not available in your current region.

    opened by xsigoking 0
  • feat: protect api with AUTHORIZATION

    feat: protect api with AUTHORIZATION

    AUTHORIZATION: only for internal use to protect the API and will not be sent to OpenAI

    AUTHORIZATION="Bearer abc" chatgpt-free-api
    
    # If api server have been runned  with `AUTHORIZATION` environment variable,
    # then the request must also have `Authorization` header. 
    curl -H 'Authorization: Bearer abc' localhost:3040/v1/models
    
    opened by xsigoking 0
Releases(v0.6.0)
Owner
null
All in One AI Chat Tool( GPT-4 / GPT-3.5 /OpenAI API/Azure OpenAI)

WeChatAI Create All in One personal AI chat assistant English | 中文介绍 This project is not for reward and profit, only used for personal Screenshot Supp

null 38 Apr 25, 2023
Haylou Smart Watch 2 (LS02) reverse-engineering project

Haywatch Haywatch Hello Haylou Watch features Device communication General command structure Pairing Unpairing Battery Firmware Date and time Pulses U

XorTroll 5 Dec 16, 2022
A reverse-engineering of Speedball 2 for the Sega Megadrive

Reverse engineering of Speedball 2 for Sega Megadrive (Genesis) This repo is a reverse engineering of Speedball 2, using Ghidra to reverse the assembl

Simon Frankau 4 Jan 6, 2023
ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code

ChatGPT-Code-Review is a Rust application that uses the OpenAI GPT-3.5 language model to review code. It accepts a local path to a folder containing code, and generates a review for each file in the folder and its subdirectories.

Greg P. 15 Apr 22, 2023
📸 website screenshots as a service

website-screenshot ?? website screenshots as a service Features ?? powered by Rust ?? blazing fast ?? ‍‍ built-in ratelimiter ?? built-in storage prov

Tomio 13 Oct 22, 2022
ChatGPT-rs is a lightweight ChatGPT client with a graphical user interface, written in Rust

ChatGPT-rs is a lightweight ChatGPT client with a graphical user interface, written in Rust. It allows you to chat with OpenAI's GPT models through a simple and intuitive interface.

null 7 Apr 2, 2023
Navigating around TUM with excellence – An API and website to search for rooms, buildings and other places

NavigaTUM NavigaTUM is a non-official tool developed by students for students, that aims to help you get around at TUM. Feel free to contribute. Featu

TUM Developers 21 Dec 22, 2022
Lemurs - A lightweight TUI display/login manager written in Rust 🐒

Lemurs ?? A TUI Display/Login Manager written in Rust WIP: Whilst the project is working and installable, there are still a lot of bugs and limitation

Gijs Burghoorn 136 Jan 1, 2023
Testing out if Rust can be used for a normal Data Engineering Pipeline.

RustForDataPipelines Testing out if Rust can be used for a normal Data Engineering Pipeline. Check out the full blog post here. https://www.confession

Daniel B 7 Feb 17, 2023
A mono-repo for the Engineering Practice Domains of Development, Data, Infrastructure, Testing, and Platforms

Engineering Practice Domains Introduction Welcome to the Engineering Practice Domains at Fearless! This repository serves as a monorepo for our collab

Fearless 7 Apr 29, 2024
Rust-based CLI library for OpenAI ChatGPT API

This is a Rust library that provides a CLI (command-line interface) for easy and convenient access to the OpenAI ChatGPT API. The library offers a simple and straightforward way to integrate the ChatGPT API into your Rust-based applications.

bigduu 10 Mar 9, 2023
A command-line interface for interacting with the ChatGPT API from OpenAI

cligpt cligpt is a command-line interface for interacting with the ChatGPT API from OpenAI. With cligpt, you can quickly and easily generate text by s

Felipe S. S. Schneider 6 Apr 4, 2023
A tool for chatting using the ChatGPT API, written in Rust CLI.

ChatGPT CLI A tool for chatting using the ChatGPT API, written in Rust CLI. You can use this tool to chat, just by setting your API Key. You can modif

null 6 Apr 5, 2023
A simple common-line interface for ChatGPT API.

heygpt A simple common-line interface for ChatGPT API. ?? Streaming output! ?? One-shot mode to get a quick answer ?? Interactive mode to have a conve

Eric Fu 88 Apr 17, 2023
UpVent Website (Powered by Rust + Svelte & Fernet Branca).

UpVent Website Source Build Status Description This is the source code for the UpVent's website under upvent.codes. Development occurs on the master b

UpVent 3 Dec 2, 2022
Use the osu!direct button on the osu! website to download beatmaps directly to osu

osum!direct-web Use the osu!direct button on the osu! website to download beatmaps directly to osu! - without osu! supporter. Badges Usage Run the app

oSumAtrIX 1 Jan 21, 2022
Are we lang yet? A simple website providing information about the status of Rust's language development ecosystem.

Are We Lang Yet This project answers the question "Is the Rust ecosystem ready to use for language development yet?". arewelangyet.com What is this? C

null 8 Dec 7, 2022
A website for the Leptos Web Framework!

Leptos Website A Repo for the public facing Leptos website. Still a WIP. Client Side Rendering This example cannot be built as a trunk standalone CSR-

Leptos 7 May 2, 2023
🌊 ~ seaward is a crawler which searches for links or a specified word in a website.

?? seaward Installation cargo install seaward On NetBSD a pre-compiled binary is available from the official repositories. To install it, simply run:

null 3 Jul 16, 2023