Gemini
Pricing
60 QPM (queries per minute)
Details: https://ai.google.dev/pricing
Set up API Key
-
Set project id
-
Enable service
generativelanguage.googleapis.com
-
Set alias (ref)
-
Create API key with API target restriction.
-
Check API Key
gcloud services api-keys list --project $PROJECT --format json | jq ".[] | select(.displayName == \"$DISPLAY_NAME\")" { "createTime": "2024-02-23T12:58:04.334290Z", "displayName": "Gemini API Key", "etag": "W/\"dMMHgHoJFaTkh6z89v139Q==\"", "name": "projects/xxxxx/locations/global/keys/xxxxxxx", "restrictions": { "apiTargets": [ { "service": "generativelanguage.googleapis.com" } ] }, "uid": "xxxxxxxxxxxxxxx", "updateTime": "2024-02-23T12:58:04.358444Z" }
-
Get Key string
gcloud services api-keys get-key-string projects/xxxxxxx/locations/global/keys/xxxxxxxxxxxxxxxx --project $PROJECT keyString: XXXXXXXXXXXXXXXXXXXXX
Set this value in
.env