A collection of agent skills that give AI coding assistants up-to-date context for building apps with the Gemini API and SDKs.
google-gemini-php/client
A community-maintained PHP client for the Gemini API, covering text, media, streaming, tools, and file and cache management.
- Stars
- 412
- Forks
- 83
- Open issues
- 2
- Last commit
- 26 days ago
What is it?
Gemini PHP is a community-maintained PHP API client for Google's Gemini API. It lets PHP applications send text, image, video, audio and document input to Gemini models, and supports streaming, multi-turn chats, structured JSON output and function calling.
The client also wraps built-in tools such as Google Search, Google Maps, URL context, File Search and code execution, along with image and speech generation and thinking-model configuration. Files, context caching, file search stores, embeddings and model listing are exposed through dedicated methods.
It requires PHP 8.2 or newer, installs via Composer, and ships with a fake client for writing tests without calling the live API.
Key features
- 01Supports text, image, video, audio and document input.
- 02Provides streaming responses and multi-turn chat sessions.
- 03Returns structured JSON output using schemas or JSON Schema arrays.
- 04Includes function calling and built-in tools like Google Search and code execution.
- 05Offers file uploads, context caching and File Search stores.
- 06Ships with a fake client for testing.
Use cases
- Adding Gemini-powered chat or content generation to a Laravel or other PHP backend.
- Extracting structured data from documents or images into typed JSON.
- Building retrieval-augmented answers over uploaded documents with File Search.
- Writing unit tests for PHP code that calls Gemini without hitting the live API.
Quick start
- 1
Install the PHP 8.2+ package with Composer
composer require google-gemini-php/client - 2
Install a PSR-18 HTTP client if your project lacks one
composer require guzzlehttp/guzzle - 3
Create a Gemini API key in Google AI Studio
- 4
Create the client with your API key and call generateContent on gemini-2.5-flash
Things to know
- Requires PHP 8.2 or newer.
- Requires a Gemini API key from Google AI Studio.
- Version 2.0 works only with the Gemini v1beta API.
Topics
FAQ
- What is client?
- A community-maintained PHP client for the Gemini API, covering text, media, streaming, tools, and file and cache management. Gemini PHP is a community-maintained PHP API client for Google's Gemini API. It lets PHP applications send text, image, video, audio and document input to Gemini models, and supports streaming, multi-turn chats, structured JSON output and function calling.
- Is client free to use? What license does it have?
- client is open source under the MIT license. Check the license terms before using it in commercial products.
- Is client still maintained?
- Actively maintained. The last commit to client was on Oct 12, 2026.
- What can I use client for?
- Adding Gemini-powered chat or content generation to a Laravel or other PHP backend. Extracting structured data from documents or images into typed JSON. Building retrieval-augmented answers over uploaded documents with File Search. Writing unit tests for PHP code that calls Gemini without hitting the live API.
- How do I install client?
- Install the PHP 8.2+ package with Composer: composer require google-gemini-php/client Install a PSR-18 HTTP client if your project lacks one: composer require guzzlehttp/guzzle Create a Gemini API key in Google AI Studio Create the client with your API key and call generateContent on gemini-2.5-flash
- Where can I get client?
- The source code and installation instructions are on GitHub: https://github.com/google-gemini-php/client
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Python client library that wraps multiple AI provider APIs behind one simple interface for text, structured data, and conversations.
A Python library giving one interface for chat, streaming, tool calls, and structured output across AI providers.
An LLM plugin that gives the LLM command-line tool and Python library access to Google's Gemini models.
An open-source AI agent from Google that brings Gemini into your terminal to query, edit, and automate code.
A Python library that uses LLMs to pull structured data from unstructured text, with each extraction linked back to its source span.