Self-hosted web API that exposes free, unlimited access to modern LLM providers through a single, simple HTTP interface. It includes an optional web GUI for configuration and supports running via Python or Docker.
Note: The demo server, when available, can be overloaded and may not always respond.
Pull and run with an optional cookies.json and port mapping. In Docker, setting a GUI password is recommended (and required by some setups).
docker run -p 5500:5500 d0ckmg/free-gpt4-web-api:latest
docker run \
-v /path/to/your/cookies.json:/cookies.json:ro \
-p 5500:5500 \
d0ckmg/free-gpt4-web-api:latest
docker run -p YOUR_PORT:5500 d0ckmg/free-gpt4-web-api:latest
version: "3.9"
services:
api:
image: "d0ckmg/free-gpt4-web-api:latest"
ports:
- "YOUR_PORT:5500"
#volumes:
# - /path/to/your/cookies.json:/cookies.json:ro
Note:
git clone https://github.com/aledipa/Free-GPT4-WEB-API.git
cd Free-GPT4-WEB-API
pip install -r requirements.txt
python3 src/FreeGPT4_Server.py
When using the Web GUI, always set a secure password:
python3 src/FreeGPT4_Server.py --enable-gui --password your_secure_password
The API returns plain text by default.
Examples:
--keyword), replace text with your chosen keyword.curl "http://127.0.0.1:5500/?text=Explain%20quicksort%20in%20simple%20terms"
--file-input in options):fileTMP="$1"
curl -s -F file=@"${fileTMP}" http://127.0.0.1:5500/
import requests
resp = requests.get("http://127.0.0.1:5500/", params={"text": "Give me a limerick"})
print(resp.text)
python3 FreeGPT4_Server.py --enable-gui
From the GUI you can configure common options (e.g., model, provider, keyword, history, cookies).
Show help:
python3 src/FreeGPT4_Server.py [-h] [--remove-sources] [--enable-gui]
[--private-mode] [--enable-history] [--password PASSWORD]
[--cookie-file COOKIE_FILE] [--file-input] [--port PORT]
[--model MODEL] [--provider PROVIDER] [--keyword KEYWORD]
[--system-prompt SYSTEM_PROMPT] [--enable-proxies] [--enable-virtual-users]
Options:
Some providers require cookies to work properly. For the Bing model, only the “_U” cookie is needed.
--cookie-file /cookies.json when running from source-v /path/to/cookies.json:/cookies.json:roEnable proxies to mitigate blocks:
--enable-proxiesgpt-4DuckDuckGo (reliable fallback)Change via flags or in the GUI:
--model gpt-4o --provider Bing
--private-mode requires a private token to access the API--password protects the settings page (mandatory in Docker setups)Important: Always set a password when using the Web GUI to prevent unauthorized access.
Use the GPTMode Apple Shortcut to ask your self-hosted API via Siri.
Shortcut:
Say “GPT Mode” to Siri and ask your question when prompted.
For development and testing:
If you encounter issues:
Contributions are welcome! Feel free to open issues and pull requests to improve features, docs, or reliability.
GNU General Public License v3.0
See LICENSE for details.