https://github.com/jellydn/gpt4free-demo
A slow guide on setting up a free OpenAI GPT-4 API on your local machine.
https://github.com/jellydn/gpt4free-demo
gpt gpt4free raycast-extension
Last synced: 6 months ago
JSON representation
A slow guide on setting up a free OpenAI GPT-4 API on your local machine.
- Host: GitHub
- URL: https://github.com/jellydn/gpt4free-demo
- Owner: jellydn
- Created: 2023-06-11T06:05:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T17:30:22.000Z (6 months ago)
- Last Synced: 2025-04-09T18:41:01.037Z (6 months ago)
- Topics: gpt, gpt4free, raycast-extension
- Language: TypeScript
- Homepage:
- Size: 694 KB
- Stars: 105
- Watchers: 3
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Welcome to gpt4free-demo 👋
Set up a free OpenAI GPT-4 API on your own## Demo
![]()
![]()
## Usage
Follow these steps to get gpt4free-demo up and running:
1. **Clone the Repository**:
```bash
git clone https://github.com/username/gpt4free-demo.git
cd gpt4free-demo
```2. **Set Up Environment Variables**: Copy the example environment file and set up your own variables:
```bash
cp .env.example .env
```Open `.env` with your preferred text editor and fill in your own values for the given variables. Save and close the file when you're finished.
3. **Start the Services**: Start your services using Docker Compose:
```bash
docker-compose up -d
```
If you change any environment variables in your `.env` file, restart your services with `docker-compose down` and `docker-compose up -d`.
4. **Access the API**: Once the services are running, the API will be accessible at:
- Find supports model and site: `http://127.0.0.1:13000/supports` [GET]
- Return when chat is complete: `http://127.0.0.1:13000/ask?prompt=***&model=***&site=***` [POST/GET]
- Return with event stream: `http://127.0.0.1:13000/ask/stream?prompt=***&model=***&site=***` [POST/GET]More usage examples can be found at [xiangsx/gpt4free-ts](https://github.com/xiangsx/gpt4free-ts#-lets-use-gpt4).
Certainly! If you want to include instructions on how to use `hurl` to test the API in the README, you can add a new section like this:
## Testing with Hurl
[Hurl](https://hurl.dev/) is a command-line tool to run HTTP requests. You can use it to test the endpoints in this API. Here's how you can get started:
1. **Install Hurl**: Follow the instructions on the [official website](https://hurl.dev/docs/installation.html) to install Hurl on your system.
2. **Create a Hurl File**: You can create a file with a `.hurl` extension to define the HTTP requests you want to test. Here's an example `gpt.hurl` file for this project:
```hurl
# List all supports model
GET http://127.0.0.1:13000/supports# Call Vita model
GET http://127.0.0.1:13000/ask
[QueryStringParams]
site: vita
model: gpt-3.5-turbo
prompt: Tell me a joke about Software Engineering
```3. **Run the Hurl File**: Use the following command to execute the `gpt.hurl` file:
```bash
hurl --verbose gpt.hurl
```This will run the defined HTTP requests and print the responses to the terminal.
4. **Read the Documentation**: For more advanced usage, you can refer to the [samples documentation](https://hurl.dev/docs/samples.html).
## Resources
- [xiangsx/gpt4free-ts](https://github.com/xiangsx/gpt4free-ts)
- [xtekky/gpt4free](https://github.com/xtekky/gpt4free)
- [Create Your First Extension - Raycast API](https://developers.raycast.com/basics/create-your-first-extension)## Reference Videos
- [](https://www.youtube.com/watch?v=llThjxFb7KU)
- [](https://www.youtube.com/watch?v=sY01NrxVQJM)## Author
- Website: [productsway.com](https://productsway.com/)
- Twitter: [@jellydn](https://twitter.com/jellydn)
- Github: [@jellydn](https://github.com/jellydn)## Show your support
[](https://ko-fi.com/dunghd)
[](https://paypal.me/dunghd)
[](https://www.buymeacoffee.com/dunghd)