Add a provider
A provider is any endpoint implementing the OpenAI API surface.1
Enter the base URL
Use the URL that has
/chat/completions and /models beneath it, usually
ending in /v1.2
Add the API key
The key is encrypted with
SETTINGS_ENCRYPTION_KEY before storage. It is
write-only: the API returns a hasApiKey flag and never the value itself.3
Add custom headers if needed
Some gateways require extra headers, such as OpenRouter’s
HTTP-Referer and
X-Title.4
Test the connection
Test connection requests
<base URL>/models through the outbound guard.
This validates the URL, the key, and network reachability in one step.Add models
A provider holds any number of models. Each needs:string
required
The exact identifier the provider expects, such as
gpt-4o-mini or
anthropic/claude-sonnet-4.string
required
The label shown in the model picker.
integer
required
Total token limit for the model. Used to decide when to trim context.
integer
required
Upper bound on a single response. Setting this above the provider’s real limit
causes request errors.
Default model rules
Exactly one model per user is the default, enforced by themodels_one_default_per_user partial unique index.
- Make default releases the current holder before setting the new one, because the index rejects the opposite order.
- Deleting or disabling the default model, or the provider that owns it, automatically promotes the oldest remaining enabled model.
- A user therefore always has a usable default as long as one enabled model exists.
The outbound request guard
Every outbound call is checked before it is made. By default the guard rejects:- Non-HTTPS URLs
- URLs containing embedded credentials
- Private, loopback, and link-local addresses
- Cloud metadata endpoints
- Redirects to any of the above
- Public providers
- In-cluster or LAN endpoints
- Plain HTTP endpoints
No configuration needed. Public HTTPS endpoints pass the guard.
Troubleshooting
Test connection fails with a blocked destination
Test connection fails with a blocked destination
The guard rejected the URL. Confirm it is HTTPS and publicly resolvable, or
enable
ALLOW_PRIVATE_EGRESS for an internal endpoint.401 or 403 from the provider
401 or 403 from the provider
The stored key is wrong or lacks access to the requested model. Keys are
write-only, so re-enter it rather than trying to read it back.
404 on a model that exists
404 on a model that exists
The base URL is probably missing or duplicating its version segment. The
application appends
/chat/completions, so the base URL should end at /v1.Requests fail once conversations get long
Requests fail once conversations get long
The configured context window exceeds the model’s real limit. Lower it to the
provider’s documented value.
Everything broke after a key rotation
Everything broke after a key rotation
If
SETTINGS_ENCRYPTION_KEY changed, stored credentials cannot be
decrypted. Restore the original key or have users re-enter their
credentials.Backup implications
Provider credentials are encrypted in the database with the installation key. The database andSETTINGS_ENCRYPTION_KEY form a single recovery unit; a
database restore without the matching key yields unreadable credentials.
Backup and restore
What to back up and how to validate a restore.