title: Accessing Google Cloud Function via API Key
body: <p>I created a Google Cloud Function from my ML Models. It works fine with the google &quot;Testing&quot; on the GCP site of the function:</p>
  <p>Screenshot of the testing</p>
  <p><a href="https://i.stack.imgur.com/iAT5K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAT5K.png" alt="img_testing" /></a></p>
  <p>I have the function hosted 2 times, one time with authentication (Google IAM) and a second time non-authenticated</p>
  <p>authentication modi</p>
  <p><a href="https://i.stack.imgur.com/ndOTY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ndOTY.png" alt="img_auth" /></a></p>
  <p>if I now want to invoke the function e.g. in postman the version without authentication works fine.
  But with authentication things it gets out of hand to figure out how to accomplish that.</p>
  <p>How can I achieve access to the cloud function with an restricted API key?`</p>