new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

AI SDK · Providers · all subjects

ai gateway/authentication

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

AI Gateway authentication: OIDC or API key

The Vercel AI Gateway supports two authentication methods: OIDC (for Vercel deployments) and AI Gateway API keys.

AI Gateway API key environment variable

Set API key via the AI_GATEWAY_API_KEY environment variable. The API key is sent using the Authorization header and can be an AI Gateway API key, Vercel personal access token, or Vercel app access token.

AI Gateway supports multiple authentication methods

AI Gateway supports three authentication methods: API Key Authentication (via AI_GATEWAY_API_KEY env var or passed directly), Vercel Access Token Authentication (for dynamic runtime authentication with optional teamIdOrSlug for multi-team tokens), and OIDC Authentication (for Vercel deployments, automatically handled in production/preview deployments).

AI Gateway OIDC token management in local development

In local development with OIDC: First install and authenticate with Vercel CLI, then run 'vercel env pull' to download OIDC token. For automatic token management, use 'vercel dev' which handles token refreshing. For manual token management, note that OIDC tokens expire after 12 hours and you'll need to run 'vercel env pull' again to refresh before expiration.

AI Gateway authentication precedence

If an API key or Vercel access token is present (either passed directly or via environment variable), it will always be used instead of OIDC, even if the API key or token is invalid.

Give your agent this brain