题意:
我该如何检查 Google Gemini API 密钥是否有效?
问题背景:
I want to make a image recognition system that uses Google Gemini. The system recognize an image by using 2 methods, that are rule based logic and logic with Gemini.
我想要开发一套基于 Google Gemini 的图像识别系统,该系统会通过两种方式对图像进行识别,分别是基于规则的逻辑识别方式和基于 Gemini 的逻辑识别方式。
Therefore I\’d check if Gemini API key is correct and if that is incorrect then use only rule based logic.
因此我需要先验证 Gemini API 密钥是否有效,若密钥无效,系统就仅启用基于规则的识别逻辑。
I\’m searching for the way of validate Gemini API key, one simple way is just send request with given API key. But this way takes so much time. And even though API failed, it is difficult to distinguish the error is caused by incorr


