Skip to content

Allow your frontend to send requests to OpenAI without exposing your API key and enforcing rate limits per user.

License

Notifications You must be signed in to change notification settings

DreamHubCo/openai-proxy

Repository files navigation

openai-proxy

Deploy a proxy in front of OpenAI API to allow your frontend to make requests without exposing your API key while enforcing rate limiting. Designed for speed and ease of deployment.

Features

  • JWT authentication
  • Chat streaming
  • Per user rate limiting

Run the example

  1. Start the proxy
    export OPENAI_API_KEY=sk-XXX
    cargo run
  2. Start the example
    cd examples/openai-proxy-js-example
    npm i
    npm run dev
    open localhost:3000

About

Allow your frontend to send requests to OpenAI without exposing your API key and enforcing rate limits per user.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages