Authentication
Consus Gateway authenticates via thex-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.
Run with Docker Compose
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.Step 1 — Get the Docker Compose file
Download LiteLLM’s officialdocker-compose.yml into an empty directory:
Step 2 — Add 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:
CONSUS_API_KEY.
Step 3 — Create your config.yaml
Create aconfig.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.
Full config.yaml with all available models
Full config.yaml with all available models
Step 4 — Enable the config mount
By default, LiteLLM’sdocker-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):
prometheus.yml, so create a minimal one (it must exist before you start, or the stack won’t come up):
Step 5 — Start the proxy
Withdocker-compose.yml, .env, config.yaml, and prometheus.yml all in the same directory, start everything:
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.
Optional — Open the UI and create a virtual key
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.
Configure via the UI
- Go to Models + Endpoints and click Add Model
- Set Provider to
OpenAI-Compatible Endpoints (Together AI, etc.) - Set LiteLLM Model Name to
openai/<model>:<compliance-level>(e.g.openai/gpt-4.1:il5+itar) - Set API Base to
https://api.consus.io/v1 - Set OpenAI API Key to any value (required by LiteLLM, ignored by Consus)
- Under Advanced Settings, set LiteLLM Params to:
- Click Add Model