Skip to main content
An auth credential is how a client proves it may act as a consumer. Credentials are created at the gateway level and attached to one or more consumers, so you can rotate or share them independently of the consumer itself.
The same auth (API key or IdP credential) can be attached to several consumers. The request still targets a consumer by /{consumer_slug}/… — the credential proves access; the slug selects which consumer. Prefer one auth per consumer when you can; sharing is supported but weaker for audit and rotation.
This is distinct from a registry’s target auth, which is how TrustGate authenticates to the upstream provider.

Auth types

A role_based LLM consumer carries exactly one identity credential — oauth2 or oidc.

API keys

API keys are prefixed ag_. The raw secret is returned once, at creation — store it then. TrustGate only persists a SHA-256 hash; at request time it hashes the inbound key and compares, so the secret is never recoverable from the gateway.

OAuth2 / OIDC / mTLS

JWT- and certificate-based credentials carry a config block: For oidc credentials on a role_based consumer, the validated token’s claims are matched against role OIDC mappings to select the consumer’s routing — this is how identity-based routing works. For end-to-end, provider-specific setup (custom authorization servers, scopes, group/role claims, and the exact credential payloads), see the Authorization manuals for Okta and Entra ID.

Managing auth

CRUD lives under /v1/gateways/{gateway_id}/auths; attach/detach via the consumer’s …/auths/{auth_id} sub-resource. See the Auth API.