6:
7: ---
8:
-Written by [@xtekky](https://github.com/xtekky)
9:+<p align="center"><strong>Written by <a href="https://github.com/xtekky">@xtekky</a></strong></p>
10:
11: <div id="top"></div>
12:
17: > _"gpt4free"_ serves as a **PoC** (proof of concept), demonstrating the development of an API package with multi-provider requests, with features like timeouts, load balance and flow control.
18:
19: > [!NOTE]
-> <sup><strong>Lastet version:</strong></sup> [](https://pypi.org/project/g4f) [](https://hub.docker.com/r/hlohaus789/g4f)
20:+> <sup><strong>Latest version:</strong></sup> [](https://pypi.org/project/g4f) [](https://hub.docker.com/r/hlohaus789/g4f)
21: > <sup><strong>Stats:</strong></sup> [](https://pepy.tech/project/g4f) [](https://pepy.tech/project/g4f)
22:
23: ```sh
29: ```
30:
31: ## 🆕 What's New
- - **For comprehensive details on new features and updates, please refer to our [Releases](https://github.com/xtekky/gpt4free/releases) page**
- - **Installation Guide for Windows (.exe):** 💻 [#installation-guide-for-windows](#installation-guide-for-windows-exe)
32:+ - **For comprehensive details on new features and updates, please refer to our** [Releases](https://github.com/xtekky/gpt4free/releases) **page**
33:+ - **Installation Guide for Windows (.exe):** 💻 [Installation Guide for Windows (.exe)](#installation-guide-for-windows-exe)
34: - **Join our Telegram Channel:** 📨 [telegram.me/g4f_channel](https://telegram.me/g4f_channel)
- - **Join our Discord Group:** 💬 [discord.gg/XfybzPXPH5](https://discord.gg/XfybzPXPH5)
35:+ - **Join our Discord Group:** 💬🆕️ [discord.gg/6yrm7H4B](https://discord.gg/6yrm7H4B)
36:+
37:
38: ## 🔻 Site Takedown
39:
54: - [ ] 🚧 Improve compatibility and error handling
55:
56: ## 📚 Table of Contents
-
-- [🆕 What's New](#-whats-new)
-- [📚 Table of Contents](#-table-of-contents)
-- [🛠️ Getting Started](#-getting-started)
- - [Docker Container Guide](#docker-container-guide)
- - [Installation Guide for Windows (.exe)](#installation-guide-for-windows-exe)
- - [Use python](#use-python)
- - [Prerequisites](#prerequisites)
- - [Install using PyPI package:](#install-using-pypi-package)
- - [Install from source:](#install-from-source)
- - [Install using Docker:](#install-using-docker)
-- [💡 Usage](#-usage)
- - [Text Generation](#text-generation)
- - [Image Generation](#image-generation)
- - [Web UI](#web-ui)
- - [Interference API](docs/interference.md)
- - [Local inference](docs/local.md)
- - [Configuration](#configuration)
-- [🚀 Providers and Models](docs/providers-and-models.md)
-- [🔗 Powered by gpt4free](#-powered-by-gpt4free)
-- [🤝 Contribute](#-contribute)
- - [How do i create a new Provider?](#guide-how-do-i-create-a-new-provider)
- - [How can AI help me with writing code?](#guide-how-can-ai-help-me-with-writing-code)
-- [🙌 Contributors](#-contributors)
-- [©️ Copyright](#-copyright)
-- [⭐ Star History](#-star-history)
-- [📄 License](#-license)
57:+ - [🆕 What's New](#-whats-new)
58:+ - [📚 Table of Contents](#-table-of-contents)
59:+ - [🛠️ Getting Started](#-getting-started)
60:+ - [Docker Container Guide](#docker-container-guide)
61:+ - [Installation Guide for Windows (.exe)](#installation-guide-for-windows-exe)
62:+ - [Use python](#use-python)
63:+ - [Prerequisites](#prerequisites)
64:+ - [Install using PyPI package](#install-using-pypi-package)
65:+ - [Install from source](#install-from-source)
66:+ - [Install using Docker](#install-using-docker)
67:+ - [💡 Usage](#-usage)
68:+ - [Text Generation](#text-generation)
69:+ - [Image Generation](#image-generation)
70:+ - [Web UI](#web-ui)
71:+ - [Interference API](#interference-api)
72:+ - [Local Inference](docs/local.md)
73:+ - [Configuration](#configuration)
74:+ - [Full Documentation for Python API](#full-documentation-for-python-api)
75:+ - **New:**
76:+ - [Async Client API from G4F](docs/async_client.md)
77:+ - [Client API like the OpenAI Python library](docs/client.md)
78:+ - **Legacy**
79:+ - [Legacy API with python modules](docs/legacy/legacy.md)
80:+ - [Legacy AsyncClient API from G4F](docs/legacy/legacy_async_client.md)
81:+ - [🚀 Providers and Models](docs/providers-and-models.md)
82:+ - [🔗 Powered by gpt4free](#-powered-by-gpt4free)
83:+ - [🤝 Contribute](#-contribute)
84:+ - [How do i create a new Provider?](#guide-how-do-i-create-a-new-provider)
85:+ - [How can AI help me with writing code?](#guide-how-can-ai-help-me-with-writing-code)
86:+ - [🙌 Contributors](#-contributors)
87:+ - [©️ Copyright](#-copyright)
88:+ - [⭐ Star History](#-star-history)
89:+ - [📄 License](#-license)
90:
91: ## 🛠️ Getting Started
92:
130:
131: By following these steps, you should be able to successfully install and run the application on your Windows system. If you encounter any issues during the installation process, please refer to our Issue Tracker or try to get contact over Discord for assistance.
132:
-Run the **Webview UI** on other Platfroms:
133:+Run the **Webview UI** on other Platforms:
134:
135: - [/docs/guides/webview](docs/webview.md)
136:
174:
175: client = Client()
176: response = client.chat.completions.create(
- model="gpt-3.5-turbo",
177:+ model="gpt-4o-mini",
178: messages=[{"role": "user", "content": "Hello"}],
179: # Add any other necessary parameters
180: )
191:
192: client = Client()
193: response = client.images.generate(
- model="dall-e-3",
194:+ model="flux",
195: prompt="a white siamese cat",
196: # Add any other necessary parameters
197: )
202:
203: [](docs/client.md)
204:
-**Full Documentation for Python API**
- - **Async Client API from G4F:** [/docs/async_client](docs/async_client.md)
- - **Client API like the OpenAI Python library:** [/docs/client](docs/client.md)
- - **Legacy API with python modules:** [/docs/legacy](docs/legacy.md)
205:+#### **Full Documentation for Python API**
206:+ - **New:**
207:+ - **Async Client API from G4F:** [/docs/async_client](docs/async_client.md)
208:+ - **Client API like the OpenAI Python library:** [/docs/client](docs/client.md)
209:+
210:+ - **Legacy:**
211:+ - **Legacy API with python modules:** [/docs/legacy/legacy](docs/legacy/legacy.md)
212:+ - **Legacy AsyncClient API from G4F:** [/docs/async_client](docs/legacy/legacy_async_client.md)
213:
214: #### Web UI
215: **To start the web interface, type the following codes in python:**
300:
301: ##### Storing the .HAR File
302:
-- Place the exported .har file in the `./har_and_cookies` directory if you are using Docker. Alternatively, you can store it in any preferred location within your current working directory.
303:+- Place the exported .har file in the `./har_and_cookies` directory if you are using Docker. Alternatively, if you are using Python from a terminal, you can store it in a `./har_and_cookies` directory within your current working directory.
304:
-Note: Ensure that your .har file is stored securely, as it may contain sensitive information.
305:+> **Note:** Ensure that your .har file is stored securely, as it may contain sensitive information.
306:
307: #### Using Proxy
308:
309: If you want to hide or change your IP address for the providers, you can set a proxy globally via an environment variable:
310:
-- On macOS and Linux:
-
311:+**- On macOS and Linux:**
312: ```bash
313: export G4F_PROXY="http://host:port"
314: ```
315:
-- On Windows:
-
316:+**- On Windows:**
317: ```bash
318: set G4F_PROXY=http://host:port
319: ```
780: We welcome contributions from the community. Whether you're adding new providers or features, or simply fixing typos and making small improvements, your input is valued. Creating a pull request is all it takes – our co-pilot will handle the code review process. Once all changes have been addressed, we'll merge the pull request into the main branch and release the updates at a later time.
781:
782: ###### Guide: How do i create a new Provider?
- - Read: [/docs/guides/create_provider](docs/guides/create_provider.md)
783:+ - **Read:** [Create Provider Guide](docs/guides/create_provider.md)
784:
785: ###### Guide: How can AI help me with writing code?
- - Read: [/docs/guides/help_me](docs/guides/help_me.md)
786:+ - **Read:** [AI Assistance Guide](docs/guides/help_me.md)
787:
788: ## 🙌 Contributors
789: A list of all contributors is available [here](https://github.com/xtekky/gpt4free/graphs/contributors)
875: </tr>
876: </table>
877:
878:+---
879:+
880: <p align="right">(<a href="#top">🔼 Back to top</a>)</p>
881:+