You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactored proxy to use yargs for argument parsing, enabling new options for host header customization and TLS security control. Updated documentation and Docker references to reflect broader API proxy capabilities. Renamed CLI binary to 'api-proxy' and bumped version to 2.1.0.
This repository provides a Dockerized proxy for accessing the OpenAI API, allowing for simplified and streamlined interaction with the model.
6
+
> The old version (version <= 2.0.0) could be found at: [](https://hub.docker.com/r/aiql/openai-proxy-docker)
7
7
8
-
With the [Docker image](https://hub.docker.com/r/aiql/openai-proxy-docker), you can easily deploy a proxy instance to serve as a gateway between your application and the OpenAI API, reducing the complexity of API interactions and enabling more efficient development.
8
+
This repository offers both Dockerized and local proxy solutions for accessing any API, with specialized support for popular interfaces like the OpenAI API. It enables simplified and streamlined interactions with various LLMs.
9
9
10
-
## Use case
10
+
With the [Docker image](https://hub.docker.com/r/aiql/api-proxy), you can easily deploy a proxy instance to serve as a gateway between your application and the OpenAI API, reducing the complexity of API interactions and enabling more efficient development.
11
11
12
-
1. For users who are restricted from direct access to the OpenAI API, particularly those in countries where OpenAI will be blocking API access starting July 2024
13
-
2. For users who need to access private APIs that lack Cross-Origin Resource Sharing (CORS) headers, this solution provides a proxy to bypass CORS restrictions and enable seamless API interactions.
12
+
## Use cases
13
+
14
+
### 1. Geo-restricted API Access | 地域限制API访问
15
+
For users who are restricted from direct access to the OpenAI API, particularly those in countries where OpenAI will be blocking API access starting July 2024.
16
+
17
+
### 2. CORS Bypass | 跨域限制突破
18
+
For users who need to access private APIs that lack Cross-Origin Resource Sharing (CORS) headers, this solution provides a proxy to bypass CORS restrictions and enable seamless API interactions.
Bypass client-side security checks, such as enterprise internal self-signed TLS certificates that cannot directly pass TLS certificate validation in many commonly used libraries.
22
+
23
+
### 4. Custom Host Header Routing | 自定义Host请求头
24
+
Specify different Host headers than the URL itself. For some custom hosts, frontend projects cannot directly modify the Host header, requiring a proxy to separately define the URL and Host header parameters.
14
25
15
26
## Demo
16
27
@@ -27,7 +38,7 @@ With the [Docker image](https://hub.docker.com/r/aiql/openai-proxy-docker), you
27
38
Execute this command to start the proxy with default settings:
28
39
29
40
```shell
30
-
sudo docker run -d -p 9017:9017 aiql/openai-proxy-docker:latest
41
+
sudo docker run -d -p 9017:9017 aiql/api-proxy:latest
31
42
```
32
43
33
44
Then, you can access it by ```YOURIP:9017```
@@ -38,11 +49,12 @@ Then, you can access it by ```YOURIP:9017```
38
49
39
50
You can change default port and default target by setting `-e` in docker, which means that you can use it for any backend followed by OpenAPI format:
40
51
41
-
| Parameter | Default Value |
42
-
| --------- | ------------- |
43
-
| PORT | 9017 |
44
-
| TARGET |https://api.openai.com|
45
-
52
+
| Parameter | Env Var | Default Value | Description |
thrownewError('Do not set --security to true. If provided, --security must be false (use --security=false) because security features are enabled by default.');
0 commit comments