The PHP AI SDK Groq Provider (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/groq/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/groq) is the official integration between the PHP AI SDK and Groq’s inference API. It lets you call any Groq-hosted model — Llama 4, Kimi, OpenAI GPT OSS, and more — using the same fluent PHP interface as every other provider in the ecosystem.
Quickstart
Install the package and run your first text generation in under five minutes.
Configuration
Set your API key, base URL, and custom headers via env vars or code.
Guides
Deep-dive into streaming, tool calling, structured output, and image input.
API Reference
Full reference for the Groq facade, provider, options, and text model classes.
What you can build
The Groq provider surfaces every capability that Groq’s API supports and automatically adapts the ones that differ per model:Text Generation
Generate completions from any Groq-hosted model with a single fluent call.
Streaming
Receive tokens as they are produced for real-time UIs and CLI tools.
Structured Output
Return typed PHP arrays matching a JSON schema — with automatic fallback for models that lack native support.
Tool Calling
Let models invoke PHP callables and receive their results in a single round-trip.
Image Input
Pass images alongside text prompts to multimodal Llama 4 models.
Custom Models
Register new or preview models at runtime without waiting for a package update.
Quick example
quickstart.php