The LLM Proxy accepts several authentication methods so you can match the right credential type to each caller. Direct provider keys are the simplest starting point; virtual API keys keep real credentials off clients; OAuth client credentials are ideal for backend services and bots; user OAuth tokens let custom apps act on behalf of an individual Archestra user; and JWKS integration lets enterprise IdP-issued JWTs authenticate without any Archestra-managed credential.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/archestra-ai/archestra/llms.txt
Use this file to discover all available pages before exploring further.
| Method | Best for | Model Router | Notes |
|---|---|---|---|
| Direct provider key | Simple provider-specific proxy calls | No | Sends the raw provider key with each request. |
| Virtual API key | Provider-specific LLM clients, generic Model Router clients, and individual developers | Yes | Works as a provider key replacement on provider-specific proxy routes, or as the apiKey for Model Router clients. |
| LLM OAuth client access token | Backend services, production apps, and external bots | Yes | Uses OAuth client credentials to issue short-lived bearer tokens. |
| User OAuth access token | Custom apps acting for an individual user | Yes | Uses the authorization code flow with consent and the llm:proxy scope. |
| JWKS | Enterprise IdP JWT callers | Provider routes | Resolves a user from an external IdP JWT. |
Direct Provider API Key
The simplest method is to pass your raw provider API key in the standard authorization header. The proxy forwards it directly to the upstream provider without storing or transforming it.Virtual API Keys
Virtual API keys are platform-managed bearer tokens that map to one or more provider API keys stored securely in Archestra. Clients only ever see the virtual token, and the real provider credentials never leave the platform.Key Isolation
Provider keys stay in Archestra. Clients only see the virtual token, so rotating or revoking a provider key doesn’t require touching client configuration.
Revocable & Expirable
Delete a virtual key without rotating the underlying provider key. Optionally set an expiration date for time-limited access.
Per-Key Base URL
Map each provider key with a custom base URL, supporting proxies, self-hosted endpoints, or regional overrides.
Multi-Provider Mapping
One virtual key can map keys for multiple providers, making it suitable as a single credential for Model Router clients.
Creating Virtual Keys
Map Provider API Keys
Add at least one provider API key mapping. You can map one key per provider; add multiple providers to use this key with the Model Router.
The maximum number of virtual keys per LLM API key is controlled by the
ARCHESTRA_LLM_PROXY_MAX_VIRTUAL_KEYS environment variable (default: 10).Using Virtual Keys
Use the virtual key token anywhere you would use a direct provider key:provider:model prefix in the request.
Model Router Virtual Keys
Model Router routes (/v1/model-router/*) require a virtual key with at least one provider key mapping — direct provider API keys are rejected on these routes. The /models endpoint returns models only for mapped providers, and /responses or /chat/completions can only route to those providers.
LLM OAuth Clients
LLM OAuth clients are registered confidential clients that authenticate to the LLM Proxy using OAuth client credentials. This is the recommended pattern for backend services, automation jobs, production applications, and external bots that can perform a token exchange before calling the proxy. The client receives aclient_id and a one-time client_secret, exchanges them for a fixed 1-hour access token, and uses that token as the proxy bearer token.
Virtual keys are still the recommended path for generic LLM clients that cannot perform an OAuth token exchange. Use LLM OAuth clients when you control the service code and can request a token before each proxy call.
Setting Up an OAuth Client
Create the Client
Go to LLM Proxies > Credentials > OAuth Clients and click Create. Give the client a descriptive name.
Configure Access
Select the LLM proxies the client is allowed to access, then map the provider API keys it can use.
Getting an Access Token
Exchange your client credentials for a short-lived access token before calling the proxy:Calling the Proxy with an OAuth Token
Complete Client Credentials Flow
The full token exchange and proxy call sequence looks like this:User OAuth Apps
Custom applications can authenticate using the OAuth authorization code flow with PKCE when they act on behalf of an individual Archestra user. The user is redirected to Archestra to approve a consent screen, and the application receives an access token with thellm:proxy scope. Provider keys are resolved from the signed-in user’s accessible Model Provider keys — personal keys, org-wide keys, and team keys for teams the user belongs to.
User OAuth tokens do not use the LLM Proxies > Credentials > OAuth Clients page. That page creates confidential clients for client credentials flow. User OAuth apps are public authorization-code clients registered dynamically.
Authorization Code Flow with PKCE
Register a Public Client
Call
POST /api/auth/oauth2/register to dynamically register a public OAuth client with your redirect URI.Redirect the User
Send the user to
/api/auth/oauth2/authorize with scope=llm:proxy, a PKCE challenge, and your redirect URI:Exchange the Code
After the user approves the consent screen, exchange the authorization code for tokens at
/api/auth/oauth2/token:JWKS (External Identity Provider)
Link an Identity Provider to the LLM Proxy so clients can authenticate with JWTs issued by your existing enterprise IdP. Archestra validates the JWT signature via the IdP’s JWKS endpoint and resolves the LLM provider API key from the matched Archestra user’s configured keys.How JWKS Auth Works
Provider Key Resolved
The provider API key is resolved from that user’s (or org’s) configured LLM API keys.
JWKS Setup
- Go to Settings > Identity Providers and create an OIDC provider with your IdP’s issuer URL, client ID, and client secret.
- Open the LLM Proxy profile and select the identity provider in the Identity Provider dropdown.
API Key Scoping
Each LLM API key has a scope that controls who can use it when Archestra resolves a provider key (for example, in JWKS auth, user OAuth, or Archestra Chat):| Scope | Description |
|---|---|
| Personal | Only visible to and usable by the user who created it. |
| Team | Available to all members of the selected team. |
| Organization | Available to all members of the organization. Admin-only. |
- Personal key
- Team key
- Organization-wide key
- Environment variable default
Custom Base URLs
Each LLM API key can have an optional Base URL that overrides the environment-variable default. Configure this when creating or editing an API key in Provider Settings.Self-Hosted Models
Point Ollama or vLLM to a non-default host or port without changing global environment variables.
OpenAI-Compatible Proxies
Route specific keys through a third-party OpenAI-compatible gateway or internal proxy.
Regional Endpoints
Use region-specific provider endpoints for data residency or latency requirements.