PHPackages                             lucianotonet/groq-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lucianotonet/groq-php

ActivePackage[API Development](/categories/api)

lucianotonet/groq-php
=====================

A powerful PHP library for seamless integration with the GroqCloud API

v1.3.0(11mo ago)83124.5k↑24.2%17[3 issues](https://github.com/lucianotonet/groq-php/issues)5MITPHPPHP ^8.1.0CI passing

Since Mar 22Pushed 9mo ago4 watchersCompare

[ Source](https://github.com/lucianotonet/groq-php)[ Packagist](https://packagist.org/packages/lucianotonet/groq-php)[ RSS](/packages/lucianotonet-groq-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (5)

Groq PHP
========

[](#groq-php)

[![Groq PHP](https://raw.githubusercontent.com/lucianotonet/groq-php/main/art.png)](https://raw.githubusercontent.com/lucianotonet/groq-php/main/art.png)

[![Version](https://camo.githubusercontent.com/fe9c391ca04e5c74e167edcd474e015b990a3eb0b5de7a44d9b55102a4ec4f7a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c756369616e6f746f6e65742f67726f712d706870)](https://packagist.org/packages/lucianotonet/groq-php) [![Total Downloads](https://camo.githubusercontent.com/a58bda5ab43e33599d137d08a5ba80de0377b8157031910c48a090f733142ddf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756369616e6f746f6e65742f67726f712d706870)](https://packagist.org/packages/lucianotonet/groq-php) [![Tests](https://github.com/lucianotonet/groq-php/actions/workflows/tests.yml/badge.svg)](https://github.com/lucianotonet/groq-php/actions/workflows/tests.yml) [![License](https://camo.githubusercontent.com/cad531e0cb4562b1a05aedb837a577c673f35608b23297a10ed4793a32a47875/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c756369616e6f746f6e65742f67726f712d706870)](https://packagist.org/packages/lucianotonet/groq-php)

**High-performance PHP client for GroqCloud API**

A comprehensive PHP SDK that simplifies interaction with **the world's fastest LLM inference platform**, allowing PHP developers to easily integrate high-performance models (DeepSeek r1, Llama 3.3, Mixtral, Gemma, and more) into any PHP application.

Using on Laravel? Check this out: [GroqLaravel](https://github.com/lucianotonet/groq-laravel?tab=readme-ov-file#readme)

Features
--------

[](#features)

- [Chat Completions](#2-chat-completions)
- [Tool Calling](#3-tool-calling)
- [Audio Transcription and Translation](#4-audio-transcription-translation-and-text-to-speech)
- [Text-to-Speech](#4-audio-transcription-translation-and-text-to-speech)
- [Vision](#5-vision)
- [Reasoning](#6-reasoning)
- [Files and Batch Processing](#7-files-and-batch-processing)

Installation
------------

[](#installation)

```
composer require lucianotonet/groq-php
```

Configuration
-------------

[](#configuration)

1. **Get your API Key:**

    - Go to [GroqCloud Console](https://console.groq.com/keys)
    - Create a new API key
2. **Configure your API Key:**

    - Using environment variables:

    ```
    export GROQ_API_KEY=your_key_here
    ```

    - Or using a `.env` file:

    ```
    GROQ_API_KEY=your_key_here
    GROQ_API_BASE=https://api.groq.com/openai/v1  # (Optional, if different from default)
    ```

Usage
-----

[](#usage)

### 1. Listing Models

[](#1-listing-models)

List available models.

```
$models = $groq->models()->list();
print_r($models['data']);
```

### 2. Chat (Completions)

[](#2-chat-completions)

Generate interactive chat responses.

```
