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.
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.
**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.
- The Service Info section below should show the URL for your server. You can share this with anyone to safely give them access to your OpenAI API key.
- Your friend doesn't need any OpenAI API key of their own, they just need your link.
- However, if you want to protect access to the server, you can add another secret called `PROXY_KEY`. This key will need to be passed in the Authentication header of every request to the server, just like an OpenAI API key.
**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`.