GettingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/google/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/google into your project takes a single Composer command. The package requires PHP 8.3 or later and the aisdk/core SDK at ^0.2, both of which Composer resolves automatically. Once the package is installed, you only need to expose your Gemini API key as an environment variable and the provider is ready to use without any further bootstrapping code.
Requirements: PHP
^8.3 and aisdk/core ^0.2. Both are declared as hard requirements in composer.json and will be installed automatically.Require the package
Run the following command in your project root to add Composer will pull in
aisdk/google to your composer.json and download it:aisdk/core and any transitive dependencies at the same time.Set your Gemini API key
The provider resolves your API key from the environment at runtime. Export it before running your application, or add it to your
.env file if you use a library such as vlucas/phpdotenv.The primary variable is GOOGLE_GENERATIVE_AI_API_KEY. If that variable is absent the provider automatically falls back to GEMINI_API_KEY:For full details on programmatic configuration — including custom base URLs, additional HTTP headers, and custom PSR-18 HTTP clients — see the Authentication & Configuration guide.