OpenRouter is an OpenAI-compatible API-key provider that routes a single key to
hundreds of models from many vendors. Gini talks to
https://openrouter.ai/api/v1 and authenticates with a Bearer key.
- Sign in at openrouter.ai.
- Create a key on the keys page and copy it.
- Add credit (OpenRouter is pay-as-you-go and bills per model). Some models have free tiers — see the models catalog.
See the OpenRouter quickstart for the full API reference.
Gini reads the key from the OPENROUTER_API_KEY environment variable. Set it in
your shell or in ~/.gini/secrets.env for persistence:
# ~/.gini/secrets.env (created mode 0600)
OPENROUTER_API_KEY=sk-or-...The web Add Provider form writes this for you.
gini provider set openrouter openrouter/autoThe default model openrouter/auto lets OpenRouter pick a model per request. To
pin one, pass its slug from the models catalog.
The base URL defaults to https://openrouter.ai/api/v1; override it only for a
proxy with --base-url.
Open Settings → Add provider → OpenRouter, paste the key, and pick or type a model slug.
OpenRouter is an API-key provider, so a credential failure surfaces OpenRouter's own message and links to Settings → Providers to paste a new key. Rotate keys on the keys page. See ADR provider-reauth-guidance.md.