OIDC
The Vercel OIDC token is a way to authenticate your requests to the AI Gateway without needing to manage an API key. Vercel automatically generates the OIDC token that it associates with your Vercel project.
Before you can use the OIDC token during local development, ensure that you link your application to a Vercel project:
terminalvercel linkPull the environment variables from Vercel to get the OIDC token:
terminalvercel env pullWith OIDC authentication, you can directly use the gateway provider without needing to obtain an API key or set it in an environment variable:
app/api/chat/route.tsimport { generateText } from 'ai'; export async function GET() { const result = await generateText({ model: 'spacexai/grok-4.5', prompt: 'Why is the sky blue?', }); return Response.json(result); }
Was this helpful?