How can I use Fine Tuned Model that I have made in Google AI Studio

I have created a fine tuned model in Google AI Studio. Then, I clicked “Get Code” for Swift (as I am creating an IOS application), and then tried to implement it into my Xcode. I did EVERYTHINg such as setting up the credentials, implementing my bundle ID to the credentials, saving the API KEY in my Xcode project file, and copy pasting the code that I have earned in the Google AI Studio. Yet, it is telling me that I do not have permission to access. Can anyone help with making an application using this?

1 Like

Me too, I’m currently facing this problem! I hope there is a way to resolve this issue. I think it could be due to the OAuth Permissions but I have tried it.

Hi @Atom @Takumi_Otsuka

Welcome to the dev forum.

You cannot use the API key to access fine-tuned models, instead they can only be accessed using oAuth for some reason.

Thus you need to use oAuth as the authentication method.

Here’s a sample from cookbook to get you started:
cookbook/quickstarts/Tuning.ipynb at main · google-gemini/cookbook · GitHub

2 Likes

Thank you for your advice! Will take a look at the cookbook. Appreciate!