OAI Reverse Proxy Server

Simple reverse proxy server for the OpenAI API.

What is this?

If you have an API key you want to share with a friend, you can use this to keep your key safe while still allowing them to generate text with the API.

Why?

OpenAI keys have full account permissions. They can revoke themselves, generate new keys, modify spend quotas, etc. You absolutely should not share them.

If you still want to share access to your key, you can put it behind this proxy to ensure it can't be used to do anything but generate text. You can also set a separate key on the proxy to gatekeep access.

How to use

1. Get an API key

2. Clone this Huggingface repository to your account

Duplicate Space

3. Set your OpenAI API key as a secret

Secrets

New Secret

Do not paste the key into server.js! That file is public and anyone can see it. Leave it alone; it will load the key from the secret you just created.

4. Deploy the server

Note: The keys section in the serverinfo screen may not correctly identify keys as trial/paid/GPT-4 unless you use the more advanced configuration described in .env.example.


Service Info

{
  "message": "OpenAI Reverse Proxy",
  "uptime": 211082.571080388,
  "timestamp": 1741059616331,
  "baseUrl": "https://migsadventure-openai-proxy.hf.space",
  "kobold": "https://migsadventure-openai-proxy.hf.space/proxy/kobold (not yet implemented)",
  "openai": "https://migsadventure-openai-proxy.hf.space/proxy/openai",
  "keys": {
    "all": 1,
    "active": 1,
    "trial": 0,
    "gpt4": 1,
    "proompts": 0
  }
}