Hi aitormendez,
I was not able to recreate your issue with an API key request from Google when I shared a project from iMovie to YouTube. The first thing I would suggest is to go directly to www.youtube.com and sign in to make sure your account is accessible. Then using the Share menu from your project, choose YouTube, and sign in to your account.
If for some reason you are unable to use the YouTube function in the share menu, then you can choose the File option and save the movie to your computer. Then access the www.youtuble.com website in Safari, and upload the file directly to the website.
These options are explained in the iMovie Help guide. From the menu bar choose Help > iMovie Help
See the sections "Share Online" and "Export a QuickTime File"
Have a great day!