Skip to content

Commit

Permalink
Update README.MD
Browse files Browse the repository at this point in the history
Update usage section and add command line arguments.
Also added docstring comments for documentation.
  • Loading branch information
Amm1rr committed Aug 5, 2023
1 parent 05fe616 commit e99db0d
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 53 deletions.
70 changes: 44 additions & 26 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Free Chatbot API

This project implements a Python web API that offers free access to three leading AI chatbots **ChatGPT**, **Google Bard**, and **Claude** through a single interface.

**Key features:**
Expand All @@ -7,14 +8,10 @@ This project implements a Python web API that offers free access to three leadin
- Leverages the free web/browser versions of each AI service by managing cookies and sessions. Avoid costs of paid API access.
- Simple API for text completion, question answering, and conversational queries. Integrate AI capabilities easily.
- Lightweight Python server using FastAPI. Easily self-host locally or on your own infrastructure.
- Full support for streaming responses.

- Full support for streaming responses.

<br>

It's a personal project to use tools like [ShellGPT](https://github.com/TheR1D/shell_gpt) and others.


-**_Google Bard_** integration available now.
-**_Claude-2_** integration is also fully implemented and available.
-**_ChatGPT_** integration is fully complete and available now.
Expand All @@ -27,24 +24,32 @@ It's a personal project to use tools like [ShellGPT](https://github.com/TheR1D/s

## Upcoming Tasks

- Implement OpenAI endpoints for ChatGPT, (`v1/chat/completions`)
- Use proxy
- Use multiple accounts
- Implement OpenAI endpoints for ChatGPT.
- The beta endpoint of `v1/chat/completions` is available now ⏳

<br>

<br>
- Authorization is accomplished by logging into [cloud.ai](https://claude.ai/) using a web browser, without requiring manual cookie configuration.
- Done ✅

<br><br>

**NOTE:** This project is currently under active development.
**NOTE:** It's a personal project to use tools like [ShellGPT](https://github.com/TheR1D/shell_gpt) and others.<br>

<br>

## Usage

#### How to Find Your Free Tokens
#### How to Find Your Tokens

First you need to add your tokens to the **`Config.conf`** file (see **[Configuration](#configuration)** section).

<br>

**Note**: For Claude, all you need to do is [login](https://claude.ai/) to your account using your web browser. Alternatively, you can follow the instructions below.

<br>

<details>

<summary>
Expand Down Expand Up @@ -78,9 +83,13 @@ which is your **Secure-1PSID** cookie, is included in the request. ([Screenshot]

[![Image](assets/Claude-Thumb.jpg)](assets/Claude.jpg)

_`Claude:`_ You can get cookie from the browser's developer tools network tab ( see for any claude.ai requests check out cookie ,copy whole value ) or storage tab ( You can find cookie of claude.ai ,there will be four values ) ([Screenshot](assets/Claude.jpg))
**Method 1:** <br>
For Claude, all you need to do is [login](https://claude.ai/) to your account using your web browser. (Firefox, Chrome, Safari)

1. Login to [claude.ai/chats](https://claude.ai/chats)
**Method 2:** <br>
_`Claude:`_ You can get cookie from the browser's developer tools network tab ( see for any [claude.ai](https://claude.ai/) requests check out cookie ,copy whole value ) or storage tab ( You can find cookie of claude.ai ,there will be four values ) ([Screenshot](assets/Claude.jpg))

1. Login to [claude.ai](https://claude.ai/)
2. Open `Developer Tools` (Press **F12**)
3. Go to `Network Tab`
4. Select an ajax request (like step 3 in [picture](assets/Claude.jpg))
Expand Down Expand Up @@ -125,7 +134,7 @@ Before using the APIs, sign up for free accounts to get access credentials if yo

- ChatGPT: https://openai.com/api/
- Google Bard: https://bard.google.com/
- Claude: https://claude.ai/chat/
- Claude: https://claude.ai/

Then, add your token(s) to the **`Config.conf`** file. (see **[Configuration](#configuration)** section).

Expand All @@ -140,7 +149,7 @@ Then, add your token(s) to the **`Config.conf`** file. (see **[Configuration](#c
```
git clone https://github.com/Amm1rr/Free-Chatbot-API.git && cd Free-Chatbot-API
python -m .venv venv
python -m venv .venv
source .venv/bin/activate
Expand All @@ -155,15 +164,28 @@ pip install -r requirements.txt
Navigate into the **`src`** directory, and run the web server using one of the methods below:

```
uvicorn main:app --reload --port 8000
-- OR --
cd src/
python main.py
-- OR --
-------------- or --------------
cd src/
sudo chmod -x ./Run-Server.sh
./Run-Server.sh
-------------- or --------------
cd src/
uvicorn main:app --reload --port 8000
```

<br>
Expand Down Expand Up @@ -238,7 +260,9 @@ curl -X 'POST' \

## Configuration

[How to Find Your Free Tokens](#usage)
[How to Find Your Tokens](#usage)

**Note**: Claude presents two authentication options - logging in through your browser or configuring Claude using the provided config file.

#### Config File Path:

Expand All @@ -260,12 +284,6 @@ SESSION_ID=[YOURS]

<br>

## Implementation

(NOTE: This guide is still in progress.)

<br>

## Sources

[Google Bard API](https://github.com/ra83205/google-bard-api) | [Claude API](https://github.com/KoushikNavuluri/Claude-API) | [revChatGPT](https://github.com/acheong08/ChatGPT/)
Expand Down
Loading

0 comments on commit e99db0d

Please sign in to comment.