powered by
Generates an access token for the Gemini model and constructs the corresponding endpoint URL.
token.vertex(jsonkey = NULL, model_id = NULL, expTime = 3600)
A list containing:
The generated access token.
The endpoint URL for the Gemini model.
A path to JSON file containing the service account key from Vertex AI.
The ID of the Gemini model. This will be prepended with "gemini-".
The expiration time of the access token in seconds (default is 3600 seconds, or 1 hour).
if (FALSE) { library(gemini.R) tokens <- token.vertex(jsonkey = "YOURAPIKEY.json", model_id = "1.5-flash") }
Run the code above in your browser using DataLab