A provider credential is never sent to your applications, and a gateway credential is never sent to a provider. The gateway drops the caller’s
Authorization header and sets the provider’s own in its place, so a ManyLayers token cannot reach OpenAI even by accident.
Gateway credentials
Every request tohttps://app.manylayers.io/v1 carries one of these as Authorization: Bearer <token>. Three kinds exist:
Use a virtual account token for anything running in production, and a personal access token for scripts, notebooks and local development.
- A token’s plaintext is shown once, when it is issued. Only a SHA-256 hash is stored, and nothing returns the token again. Rotate or revoke it from the same page; revoking takes effect immediately.
- Every personal access token expires, and your organization’s credential policy sets the longest lifetime. A virtual account token’s expiry is optional unless the policy limits it, and it can rotate on a schedule with a grace period for the old token.
- A virtual account is created with explicit
allowed_modelsandallowed_providers. Both are required: omitting either returns400 missing_allowlist, and an explicit empty list gives access to none. The lists are enforced on inference requests; they are not applied to async jobs or realtime sessions, which check only the team’s model access and policies. - Tokens are issued from a signed-in console session, never from another token.
What a client receives
Only a token and the base URL:Where a provider credential lives
Both options are set when you add or edit an account in Gateway → Providers (the credential field of the account’s setup, or Credentials & prices on an existing account).- Reference (recommended)
- API key
The secret stays outside ManyLayers and the database holds only its name:
${ENV_VAR} reads the gateway process’s environment, so it suits deployments where you run the gateway. ${vault:path#key} reads HashiCorp Vault (KV v2) using VAULT_ADDR and VAULT_TOKEN. A reference must be exactly one reference, and the variable or secret must resolve when you save it. For AWS accounts the key pair can be two references joined by a colon, such as ${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}. A database dump then contains no credential, and rotation happens where the secret already lives.This field refuses a secret: sk-proj-… and ${sk-proj-…} are both rejected at entry, because a secret stored as if it were a reference would be sent upstream verbatim and fail as an unexplained 401 much later.Resolution at request time
Test Connection
POST https://app.manylayers.io/admin/gateway/providers/{id}/test (with Authorization: Bearer <personal access token>) makes one authenticated call to the provider and names the stage that failed:
The resolved secret never appears in the result. To check individual models, see Model selection.
Workspace isolation
A workspace is the isolation boundary. Providers, credentials and models belong to one. A personal access token and a virtual account token are bound to the workspace they were issued for; an API key is either bound to one workspace or team-scoped. A workspace-bound token resolves only that workspace’s providers and models. Another workspace’s models are not listed byGET /v1/models and are not callable with it, and its provider configuration is not readable. A provider in another workspace answers 404, not 403, so a guessed id confirms nothing. See Model resolution.