Download the PHP package ursamajeur/laravel-ai-gemini-driver without Composer
On this page you can find all versions of the php package ursamajeur/laravel-ai-gemini-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ursamajeur/laravel-ai-gemini-driver
More information about ursamajeur/laravel-ai-gemini-driver
Files in ursamajeur/laravel-ai-gemini-driver
Package laravel-ai-gemini-driver
Short Description Laravel AI provider that proxies Gemini CLI and Antigravity endpoints
License MIT
Homepage https://github.com/iqbalhprahara/laravel-ai-gemini-driver
Informations about the package laravel-ai-gemini-driver
Laravel AI Gemini Driver
A Laravel AI provider that proxies Gemini CLI and Antigravity endpoints to access Google's CloudCode-PA v1internal API. Use Gemini, Claude, and GPT models through a single unified interface with automatic rate-limit cascading, multi-endpoint fallback, and SSE streaming.
[!WARNING] Use at Your Own Risk
This package accesses Google's internal CloudCode-PA API through undocumented endpoints using OAuth credentials intended for Gemini CLI. This is not an officially supported method of accessing these models. Using this package may violate Google's Terms of Service and could result in your Google account being suspended or banned. The authors accept no responsibility for any consequences arising from its use.
Requirements
- PHP 8.3+
- Laravel 12 or 13
- Laravel AI ^0.1 | ^0.2 (pre-release — expect breaking changes)
- OAuth credentials JSON produced by Gemini CLI
Installation
The service provider is auto-discovered — no manual registration needed.
Publish the configuration file:
Configuration
Authentication
This package requires an OAuth credentials JSON file produced by Gemini CLI. Run Gemini CLI at least once and authenticate — this generates the OAuth JSON that this package uses. The package handles token refresh automatically after that.
Set the path to your OAuth credentials in .env:
If not set, it defaults to storage/cloudcode-pa/oauth_creds.json. The package handles token refresh automatically.
Project ID
The CloudCode-PA project ID is obtained during Gemini CLI onboarding. If not configured, the package will auto-discover it via the loadCodeAssist RPC.
Models
Configure default models via environment variables:
Supported Models
Partner Models
| Model | Alias |
|---|---|
| Claude Opus 4 | claude-opus-4 |
| Claude Sonnet 4.5 | claude-sonnet-4-5 |
| Claude Sonnet 4 | claude-sonnet-4 |
| Claude Haiku 4.5 | claude-haiku-4-5 |
| GPT-4.1 | gpt-4-1 |
| GPT OSS 120B | gpt-oss-120b-medium |
Gemini Models
| Model | Alias |
|---|---|
| Gemini 3 Pro (preview) | gemini-3-pro-preview |
| Gemini 3 Flash (preview) | gemini-3-flash-preview |
| Gemini 2.5 Pro | gemini-2.5-pro |
| Gemini 2.5 Flash | gemini-2.5-flash |
| Gemini 2.5 Flash Lite | gemini-2.5-flash-lite |
| Gemini 2.0 Flash | gemini-2.0-flash |
You can add custom model aliases in config/cloudcode-pa.php under the models key.
Usage
The provider name is cloudcode-pa. Use it with Laravel AI's standard API:
For the full API (text generation, streaming, multi-turn conversations, reranking), refer to the Laravel AI documentation.
Key Features
Model Cascade (Rate-Limit Fallback)
When a model returns 429 (Rate Limited), the gateway automatically cascades through a configurable fallback chain. Each step tries all configured endpoints before advancing to the next model.
Default cascade: claude-opus-4 → gemini-3-pro-preview → gemini-3-flash-preview → gemini-2.5-pro → gemini-2.5-flash
Cascade only activates when using the default model — explicit model requests use endpoint fallback only.
Customize cascade steps in config/cloudcode-pa.php:
Multi-Endpoint Fallback
Multiple endpoints with independent quota pools are configured by default. On endpoint failure or rate limiting, the next endpoint is tried automatically. Endpoints are customizable in config/cloudcode-pa.php.
Automatic Model Routing
Partner models (Claude, GPT) and Gemini models use different API protocols. The package detects the model type and routes automatically — no configuration needed.
Timeouts
Debug Logging
Enable request/response logging (credentials are always redacted):
Testing
License
MIT
All versions of laravel-ai-gemini-driver with dependencies
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
laravel/ai Version ^0.1 | ^0.2
saloonphp/laravel-plugin Version ^3.0
saloonphp/saloon Version ^3.0