Skip to content

Google AI

The google provider allows you to use Google AI models. It gives you access

  1. Open Google AI Studio and create a new API key.

  2. Update the .env file with the API key.

    .env
    GEMINI_API_KEY=...
  3. Find the model identifier in the Gemini documentation and use it in your script or cli with the google provider.

    ...
    const model = genAI.getGenerativeModel({
    model: "gemini-1.5-pro-latest",
    });
    ...

    then use the model identifier in your script.

    script({ model: "google:gemini-1.5-pro-latest" })

Aliases

The following model aliases are attempted by default in GenAIScript.

AliasModel identifier
largegemini-1.5-flash-latest
smallgemini-1.5-flash-latest
visiongemini-1.5-flash-latest
longgemini-1.5-flash-latest
reasoninggemini-2.0-flash-thinking-exp-1219
reasoning_smallgemini-2.0-flash-thinking-exp-1219
embeddingstext-embedding-004

Limitations

  • Uses OpenAI compatibility layer
  • listModels
  • logprobs (and top logprobs) ignored
  • Ignore prediction of output tokens
  • Seed ignored
  • Tools implemented as fallback tools automatically.
  • topLogprobs