Step-by-step answer
Stretch 90 min6 stepsA self-hosted gateway with per-firm keys
LiteLLM's proxy (v1.106.6) with Postgres in front of two mock OpenAI-compatible servers, one virtual key per synthetic firm, a model allowlist, small budgets and a fallback. On a real run it returned 403 for a model outside the allowlist, spend written to Postgres seconds after the calls, a budget that overshoots by one call and rejects with 422 (the docs' examples show 400), and a fallback that succeeds with the served model in the response headers.
Back to the exercise