New chat started from template AI Chat Assistant - Ready to use (Claude, GPT, Gemini)
The code returns the following error:
Error [GatewayInternalServerError]: AI Gateway requires a valid credit card on file to service requests. Please visit https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dadd-credit-card to add a card and unlock your free credits.
at ignore-listed frames {
statusCode: 403,
type: 'internal_server_error',
[cause]: Error [AI_APICallError]: [object Object]
at ignore-listed frames {
cause: undefined,
url: 'https://ai-gateway.vercel.sh/v3/ai/language-model',
requestBodyValues: {
maxOutputTokens: undefined,
temperature: undefined,
topP: undefined,
topK: undefined,
presencePenalty: undefined,
frequencyPenalty: undefined,
stopSequences: undefined,
seed: undefined,
tools: undefined,
toolChoice: undefined,
responseFormat: undefined,
prompt: [Array],
providerOptions: undefined,
headers: undefined,
includeRawChunks: false
},
statusCode: 403,
responseHeaders: {
'cache-control': 'public, max-age=0, must-revalidate',
'content-encoding': 'br',
'content-type': 'application/json',
date: 'Sat, 21 Feb 2026 02:07:25 GMT',
server: 'Vercel',
'strict-transport-security': 'max-age=63072000; includeSubDomains; preload',
'transfer-encoding': 'chunked',
vary: 'rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch',
'x-matched-path': '/v3/ai/language-model',
'x-vercel-cache': 'MISS',
'x-vercel-id': 'cle1::cle1::gqkzl-1771639644083-d60d7b424e5f'
},
responseBody: '{"error":{"message":"AI Gateway requires a valid credit card on file to service requests. Please visit https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dadd-credit-card to add a card and unlock your free credits.","type":"customer_verification_required"}}',
isRetryable: false,
data: { error: [Object] }
}
}
Revise the code to address the error.
I was previewing: /chat
This error is not a code bug — it's an account-level issue. The Vercel AI Gateway requires a valid credit card on file before it will process requests (even free-tier credits need card verification).
You have two options:
Option 1: Add a credit card to Vercel (recommended) Visit your Vercel dashboard and add a credit card to unlock free AI Gateway credits: Add Credit Card
Option 2: Use a direct API key instead of the AI Gateway If you'd prefer to use your own API key from OpenAI, Anthropic, or Google directly, I can update the code to bypass the AI Gateway and use a provider SDK directly. Just let me know which provider you'd like to use and provide the API key.
Would you like me to set up a direct provider integration instead?
You can send messages while the preview loads