Connect LiteLLM Proxy to Consus Gateway for a unified AI gateway in government environments.
LiteLLM is an open-source proxy that gives your team a single endpoint for multiple LLM providers. You can point it at Consus Gateway so all requests route through government-authorized infrastructure.For LiteLLM setup and deployment instructions, see the LiteLLM docs.
Consus Gateway authenticates via the x-api-key header. LiteLLM’s built-in API key field is required but ignored by Consus Gateway. Your Consus API key must be passed via extra_headers.
This walkthrough gets LiteLLM Proxy running locally — with a Postgres database for virtual keys and spend tracking — routing every request through Consus Gateway. The only provider credential you need is your Consus API key.
Create a .env file next to docker-compose.yml. The first command uses > to create the file; the rest use >> to append:
# Admin key for the proxy + UI login — change this to your own valueecho 'LITELLM_MASTER_KEY="sk-1234"' > .env# Encrypts keys stored in the DB — cannot be changed after you add a modelecho 'LITELLM_SALT_KEY="sk-1234"' >> .env# Your Consus Gateway key — the only provider credential you needecho 'CONSUS_API_KEY="your-consus-api-key"' >> .env
Unlike a standard LiteLLM setup, you do not need Azure, OpenAI, or any other provider keys — Consus Gateway brokers every model behind your single CONSUS_API_KEY.
Create a config.yaml next to docker-compose.yml and paste the full model list below. Every entry already points api_base at https://api.consus.io/v1 and passes your key via extra_headers: x-api-key: os.environ/CONSUS_API_KEY, so there’s nothing else to edit.
By default, LiteLLM’s docker-compose.yml ships with the config file commented out. This sed uncomments the volumes and command lines under the litellm service in place, so your config.yaml is loaded (it leaves a docker-compose.yml.bak backup you can delete):
The Authorization: Bearer sk-1234 here is your LiteLLM master key (from .env), not your Consus key — LiteLLM injects CONSUS_API_KEY upstream via the extra_headers in your config.
Visit http://localhost:4000/ui and log in with your master key (sk-1234). Under Virtual Keys → + Create New Key, you can mint scoped keys with per-key RPM limits and model access — all spend is tracked in the Postgres container that Compose already started.
Do not use the Custom OpenAI provider. It prepends openai/ to the model name sent to Consus Gateway, causing a 400 error. Use OpenAI-Compatible Endpoints instead.