Your task is to review pull requests. Instructions:
- Provide the response in following JSON format: {"reviews": [{"line": <line_number>, "body": "<review comment>"}]}
- Do not give positive comments or compliments.
- Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array.
- Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code.

Review the following code diff in the file "docs/interference-api.md" and take the pull request title and description into account when writing the response.
  
Pull request title: [pull] main from xtekky:main
Pull request description:
---
See Commits and Changes for more details.

-----
Created by [<img src="https://prod.download/pull-18h-svg" valign="bottom"/> **pull[bot]**](https://github.com/wei/pull)

_Can you help keep this open source service alive? **[💖 Please sponsor : )](https://prod.download/pull-pr-sponsor)**_
---

Each line is prefixed by its number. Code to review:
```
-
1: # G4F - Interference API Usage Guide
-
2:+  
3: 
4: ## Table of Contents
5:    - [Introduction](#introduction)
6:    - [Running the Interference API](#running-the-interference-api)
7:    - [From PyPI Package](#from-pypi-package)
8:    - [From Repository](#from-repository)
-   - [Usage with OpenAI Library](#usage-with-openai-library)
-   - [Usage with Requests Library](#usage-with-requests-library)
9:+   - [Using the Interference API](#using-the-interference-api)
10:+   - [Basic Usage](#basic-usage)
11:+   - [With OpenAI Library](#with-openai-library)
12:+   - [With Requests Library](#with-requests-library)
13:    - [Key Points](#key-points)
14:+   - [Conclusion](#conclusion)
15:+  
16: 
17: ## Introduction
-The Interference API allows you to serve other OpenAI integrations with G4F. It acts as a proxy, translating requests to the OpenAI API into requests to the G4F providers.
18:+The G4F Interference API is a powerful tool that allows you to serve other OpenAI integrations using G4F (Gpt4free). It acts as a proxy, translating requests intended for the OpenAI API into requests compatible with G4F providers. This guide will walk you through the process of setting up, running, and using the Interference API effectively.
19:+  
20: 
21: ## Running the Interference API
22:+**You can run the Interference API in two ways:** using the PyPI package or from the repository.
23:+  
24: 
25: ### From PyPI Package
-**You can run the Interference API directly from the G4F PyPI package:**
26:+**To run the Interference API directly from the G4F PyPI package, use the following Python code:**
27:+
28: ```python
29: from g4f.api import run_api
30: 
32: ```
33: 
34:   
-
35: ### From Repository
-Alternatively, you can run the Interference API from the cloned repository.  
36:+**If you prefer to run the Interference API from the cloned repository, you have two options:**
37: 
-**Run the server with:**
38:+1. **Using the command line:**
39: ```bash
40: g4f api
41: ```
-or
42:+
43:+2. **Using Python:**
44: ```bash
45: python -m g4f.api.run
46: ```
47: 
-  
48:+**Once running, the API will be accessible at:** `http://localhost:1337/v1`
49:+
50:+**(Advanced) Bind to custom port:**
51:+```bash
52:+python -m g4f.cli api --bind "0.0.0.0:2400" 
53:+```
54: 
-## Usage with OpenAI Library
55:+## Using the Interference API
56: 
-  
57:+### Basic Usage
58:+**You can interact with the Interference API using curl commands for both text and image generation:**
59: 
60:+**For text generation:**
61:+```bash
62:+curl -X POST "http://localhost:1337/v1/chat/completions" \
63:+     -H "Content-Type: application/json" \
64:+     -d '{
65:+           "messages": [
66:+             {
67:+               "role": "user",
68:+               "content": "Hello"
69:+             }
70:+           ],
71:+           "model": "gpt-4o-mini"
72:+         }'
73:+```
74:+
75:+**For image generation:**
76:+1. **url:**
77:+```bash
78:+curl -X POST "http://localhost:1337/v1/images/generate" \
79:+     -H "Content-Type: application/json" \
80:+     -d '{
81:+           "prompt": "a white siamese cat",
82:+           "model": "flux",
83:+           "response_format": "url"
84:+         }'
85:+```
86:+
87:+2. **b64_json**
88:+```bash
89:+curl -X POST "http://localhost:1337/v1/images/generate" \
90:+     -H "Content-Type: application/json" \
91:+     -d '{
92:+           "prompt": "a white siamese cat",
93:+           "model": "flux",
94:+           "response_format": "b64_json"
95:+         }'
96:+```
97:+
98:+
99:+### With OpenAI Library
100:+
101:+**You can use the Interference API with the OpenAI Python library by changing the `base_url`:**
102: ```python
103: from openai import OpenAI
104: 
105: client = OpenAI(
106:     api_key="",
-    # Change the API base URL to the local interference API
-    base_url="http://localhost:1337/v1"  
107:+    base_url="http://localhost:1337/v1"
108: )
109: 
110: response = client.chat.completions.create(
-    model="gpt-3.5-turbo",
-    messages=[{"role": "user", "content": "write a poem about a tree"}],
111:+    model="gpt-4o-mini",
112:+    messages=[{"role": "user", "content": "Write a poem about a tree"}],
113:     stream=True,
114: )
115: 
122:         content = token.choices[0].delta.content
123:         if content is not None:
124:             print(content, end="", flush=True)
-```
125: 
126:+```
127:   
128: 
-## Usage with Requests Library
-You can also send requests directly to the Interference API using the requests library. 
129:+### With Requests Library
130: 
-**Send a POST request to `/v1/chat/completions` with the request body containing the model and other parameters:**
131:+**You can also send requests directly to the Interference API using the `requests` library:**
132: ```python
133: import requests
134: 
135: url = "http://localhost:1337/v1/chat/completions"
136:+
137: body = {
-    "model": "gpt-3.5-turbo", 
138:+    "model": "gpt-4o-mini",
139:     "stream": False,
140:     "messages": [
141:         {"role": "assistant", "content": "What can you do?"}
146: 
147: for choice in json_response:
148:     print(choice.get('message', {}).get('content', ''))
-```
149: 
-  
150:+```
151: 
152: ## Key Points
-- The Interference API translates OpenAI API requests into G4F provider requests
-- You can run it from the PyPI package or the cloned repository
-- It supports usage with the OpenAI Python library by changing the `base_url`
-- Direct requests can be sent to the API endpoints using libraries like `requests`
153:+   - The Interference API translates OpenAI API requests into G4F provider requests.
154:+   - It can be run from either the PyPI package or the cloned repository.
155:+   - The API supports usage with the OpenAI Python library by changing the `base_url`.
156:+   - Direct requests can be sent to the API endpoints using libraries like `requests`.
157:+   - Both text and image generation are supported.
158: 
159:   
-**_The Interference API allows easy integration of G4F with existing OpenAI-based applications and tools._**
160:+## Conclusion
161:+The G4F Interference API provides a seamless way to integrate G4F with existing OpenAI-based applications and tools. By following this guide, you should now be able to set up, run, and use the Interference API effectively. Whether you're using it for text generation, image creation, or as a drop-in replacement for OpenAI in your projects, the Interference API offers flexibility and power for your AI-driven applications.
162:+ 
163: 
164: ---
165: 
```