KeyGood / Docs
Quick start
Protect OpenAI spend with virtual keys and hard budget limits.
Quick Configuration Example
- Base URL:
- https://your-domain.com/api/v1/openai
- API Key:
- kg_live_xxxx
- Model:
- gpt-4o-mini
Replace the API key with your virtual key from the dashboard. Only models on the KeyGood pricing table are supported.
Environment / client config
OPENAI_BASE_URL=https://your-domain.com/api/v1/openai OPENAI_API_KEY=kg_live_xxxx
- Sign up
Create an account and sign in to the dashboard.
- Bind your OpenAI API key
Settings → save your master key. It is encrypted (AES-256-GCM) and never shown again.
- Create a virtual key
Set daily/monthly budgets, optional model allowlist and expiration. Copy the key once — only a hash is stored.
- Point your client at KeyGood
Use the Base URL above and your
kg_live_...key. Same paths as OpenAI, e.g./chat/completions. Streaming is supported. - Hard Stop
When the budget is exhausted, the API returns
402withbudget_exceeded— the provider is not called.