Skip to main content
The gateway reads provider API keys from its own environment. Each provider uses its standard variable name. The gateway never stores those keys in its config file or database.

Variable Names

Any other provider in the bundled catalog uses its standard variable, such as DEEPSEEK_API_KEY.
Connected subscriptions can serve a provider’s models without a key. GitHub Copilot and Vercel Token Pass have no API key variable: connect them as subscriptions. See Subscriptions. With the Fully local gateway from dari gateway setup, save keys with dari accounts (Add an API key) or from a script: dari accounts key lists which providers have one, dari accounts key <provider> <api-key> saves one, and dari accounts key <provider> off removes it. A key the provider rejects is not saved.

Startup Check

Before it serves traffic, the gateway sends each configured key to its provider to confirm it works:
  • Rejected. The gateway refuses to start and names each provider whose key was rejected, such as anthropic (401). Fix or unset the key, then start again.
  • Could not be checked. A provider outage or network failure leaves the key unconfirmed. The gateway logs that provider and uses the key anyway, so requests may fail until the provider recovers.
  • Missing. The gateway warns at startup about each provider with no key. Its models are not served until a key or a subscription for that provider is set. A request that no credential on the router can serve returns 424 provider_credentials_missing.
Only providers that a router lists are checked.

Custom Endpoints

Keys for a custom endpoint come from the variable named in its apiKeyEnv setting. An endpoint with no apiKeyEnv is called without a key, and the gateway does not check it at startup. Set its baseUrl and api in dari-gateway.yaml. See Custom Provider Endpoints.
An endpoint with an apiKeyEnv is checked at startup the same way as a built-in provider.