I generated an API key in my Google cloud project for Gemini API and I’m perfectly able to use it with my Vercel AI SDK for Gemini pro and flash, but I’m not able to use for my tuned model in Google Studio.
So I tuned a model in my Google AI studio and gave access to the new tuned model API access
API keys for the following projects can use this tuned model. Cloud project. Gemini API
But when trying to call it, the exact way I’m using the key for Gemini pro and flash, I get the following error: Error [AI_APICallError]: Function calling is not enabled for tunedModels/roryb-jgtp
at (.next/server/app/(chat)/api/chat/route.js:28:4…
…
cause: undefined,
url: ‘https://generativelanguage.googleapis.com/v1beta/tunedModels/roryb-jgtp:streamGenerateContent?alt=sse’,
requestBodyValues: [Object],
statusCode: 400,
responseHeaders: [Object],
responseBody: ‘{\n’ +
’ “error”: {\n’ +
’ “code”: 400,\n’ +
’ “message”: “Function calling is not enabled for tunedModels/roryb-jgtp”,\n’ +
’ “status”: “INVALID_ARGUMENT”\n’ +
’ }\n’ +
‘}\n’,
isRetryable: false,
data: [Object]
}