GeminiProvider

Recommended for blocks and layouts – Gemini handles deeply nested JSON schemas more reliably than other providers.

Use Google Gemini through Google's OpenAI-compatible endpoint. Configuration mirrors OpenAIProvider – only the default base URL and model differ.

final class GeminiProvider extends OpenAIProvider
{
    public const DEFAULT_BASE_URL = 'https://generativelanguage.googleapis.com/v1beta/openai';
    public const DEFAULT_MODEL = 'gemini-3.1-pro-preview';
}
See Google's documentation on the OpenAI compatibility layer for the full feature support matrix.

Configuration

config.php
return [
    'johannschopplich.copilot' => [
        'provider' => 'google',
        'providers' => [
            'google' => [
                'apiKey' => env('GOOGLE_API_KEY'),
                'model' => 'gemini-3.1-pro-preview',
                'completionModel' => 'gemini-3-flash-preview',
            ],
        ],
    ],
];
Gemini handles deeply nested JSON schemas more reliably than other providers – the recommended choice for blocks and layout generation. The free tier on AI Studio is generous enough for development and small projects.
Despite extending OpenAIProvider, the apiKey config path is providers.google.apiKey (driven by ProviderName::Google's string value 'google').