Skip to content

Repository files navigation

AI Budget Gate

An AI API proxy with budget control. Currently supports:

Installation

Clone the repository and install dependencies:

pip install -r requirements.txt

Configuration

Set the OPENAI_ADMIN_KEY environment variable with your OpenAI Admin key (read-only).

Edit settings.yaml to configure other settings.

Running

python main.py

Usage

Configure your API base URL to http://localhost:8080/pro or http://localhost:8080/mini instead of https://api.openai.com/v1.

When token usage exceeds the threshold, the proxy will block further requests.

Limitations

Note: There is latency in the OpenAI usage API, so usage tracking may not always be accurate.

About

AI API proxy with budget control

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages