PHPackages                             deepseek-php/deepseek-php-client - 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. deepseek-php/deepseek-php-client

ActiveLibrary[API Development](/categories/api)

deepseek-php/deepseek-php-client
================================

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

2.0.6(10mo ago)47073.9k—3.7%55[1 PRs](https://github.com/deepseek-php/deepseek-php-client/pulls)5MITPHPPHP ^8.1.0

Since Jan 2Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/deepseek-php/deepseek-php-client)[ Packagist](https://packagist.org/packages/deepseek-php/deepseek-php-client)[ Docs](https://github.com/deepseek-php/deepseek-php-client)[ RSS](/packages/deepseek-php-deepseek-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (19)Versions (31)Used By (5)

DeepSeek PHP Client
===================

[](#deepseek-php-client)

🚀 Community-Driven PHP Client for DeepSeek AI API Integration

 [ ![Latest Version](https://camo.githubusercontent.com/0dfa915be2a881af7a78f96adf14899422b9665b3956d15f98254d334963e81f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646565707365656b2d7068702f646565707365656b2d7068702d636c69656e74) ](https://packagist.org/packages/deepseek-php/deepseek-php-client) [ ![Total Downloads](https://camo.githubusercontent.com/152df40174b44064b0d076032bf7f15b0183e45118db74cd2d7a6626c58fee49/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646565707365656b2d7068702f646565707365656b2d7068702d636c69656e74) ](https://packagist.org/packages/deepseek-php/deepseek-php-client) [ ![PHP Version](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565) ](https://php.net) [ ![License](https://camo.githubusercontent.com/88e1dabf4d223df0950e0985948e231325fefca9fa7fe9e446cf8b1c5e9d9e47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e) ](LICENSE.md) [ ![GitHub Stars](https://camo.githubusercontent.com/d12736f09baddf4f1cc0a2c7c0eb0f561267bb8eb1b0fd0079ace559cd625add/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646565707365656b2d7068702f646565707365656b2d7068702d636c69656e743f7374796c653d736f6369616c) ](https://github.com/deepseek-php/deepseek-php-client/stargazers)

[AR](README-AR.md) | [CN](README-CN.md)

Table of Contents
-----------------

[](#table-of-contents)

- [✨ Features](#-features)
- [📦 Installation](#-installation)
- [🚀 Quick Start](#-quick-start)
    - [Basic Usage](#basic-usage)
    - [Advanced Configuration](#advanced-configuration)
    - [important warning with json mode](#-deepseek-json-mode-requirement)
    - [Use with Symfony HttpClient](#use-with-symfony-httpclient)
    - [Get Models List](#get-models-list)
    - [Function Calling](#function-calling)
    - [Framework Integration](#-framework-integration)
- [🆕 Migration Guide](#-migration-guide)
- [📝 Changelog](#-changelog)
- [🧪 Testing](#-testing)
- [🔒 Security](#-security)
- [🤝 Contributors](#-contributors)
- [📄 License](#-license)

---

✨ Features
----------

[](#-features)

- **Seamless API Integration**: PHP-first interface for DeepSeek's AI capabilities.
- **Fluent Builder Pattern**: Chainable methods for intuitive request building.
- **Enterprise Ready**: PSR-18 compliant HTTP client integration.
- **Model Flexibility**: Support for multiple DeepSeek models (Coder, Chat, etc.).
- **Streaming Ready**: Built-in support for real-time response handling.
- **Many Http Clients**: easy to use `Guzzle http client` (default) , or `symfony http client`.
- **Framework Friendly**: Laravel &amp; Symfony packages available.

---

📦 Installation
--------------

[](#-installation)

Require the package via Composer:

```
composer require deepseek-php/deepseek-php-client
```

**Requirements**:

- PHP 8.1+

---

🚀 Quick Start
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

Get started with just two lines of code:

```
use DeepSeek\DeepSeekClient;

$response = DeepSeekClient::build('your-api-key')
    ->query('Explain quantum computing in simple terms')
    ->run();

echo $response;
```

📌 Defaults used:

- Model: `deepseek-chat`
- Temperature: 0.8

### Advanced Configuration

[](#advanced-configuration)

```
use DeepSeek\DeepSeekClient;
use DeepSeek\Enums\Models;

$client = DeepSeekClient::build(apiKey:'your-api-key', baseUrl:'https://api.deepseek.com/v3', timeout:30, clientType:'guzzle');

$response = $client
    ->withModel(Models::CODER->value)
    ->withStream()
    ->setTemperature(1.2)
    ->setMaxTokens(8192)
    ->setResponseFormat('text') // or "json_object"  with careful .
    ->query('Explain quantum computing in simple terms')
    ->run();

echo 'API Response:'.$response;
```

⚠️ DeepSeek JSON Mode Requirement
---------------------------------

[](#️-deepseek-json-mode-requirement)

When using:

```
->setResponseFormat('json_object')
```

Your prompt **must contain the word `"json"`** in some form. Otherwise, the API will reject the request with the following error:

> `"Prompt must contain the word 'json' in some form to use 'response_format' of type 'json_object'"`

---

### 🚫 Incorrect Usage

[](#-incorrect-usage)

```
->setResponseFormat('json_object')
->query('Explain quantum computing in simple terms')
```

### ✅ Correct Usage

[](#-correct-usage)

```
->setResponseFormat('json_object')
->query('Respond in valid JSON format. Explain quantum computing in simple terms.')
```

> ✅ **Tip**: For best results, also provide a JSON example or explicitly say: *"Respond only in valid JSON."*

---

### Use with Symfony HttpClient

[](#use-with-symfony-httpclient)

the package already built with `symfony Http client`, if you need to use package with `symfony` Http Client , it is easy to achieve that, just pass `clientType:'symfony'` with `build` function.

ex with symfony:

```
//  with defaults baseUrl and timeout
$client = DeepSeekClient::build('your-api-key', clientType:'symfony')
// with customization
$client = DeepSeekClient::build(apiKey:'your-api-key', baseUrl:'https://api.deepseek.com/v3', timeout:30, clientType:'symfony');

$client->query('Explain quantum computing in simple terms')
       ->run();
```

### Get Models List

[](#get-models-list)

```
use DeepSeek\DeepSeekClient;

$response = DeepSeekClient::build('your-api-key')
    ->getModelsList()
    ->run();

echo $response; // {"object":"list","data":[{"id":"deepseek-chat","object":"model","owned_by":"deepseek"},{"id":"deepseek-reasoner","object":"model","owned_by":"deepseek"}]}
```

### Function Calling

[](#function-calling)

Function Calling allows the model to call external tools to enhance its capabilities.[\[1\]](https://api-docs.deepseek.com/guides/function_calling)

You Can check the documentation for function calling in [FUNCTION-CALLING.md](docs/FUNCTION-CALLING.md)

### 🛠 Framework Integration

[](#-framework-integration)

### [Laravel Deepseek Package](https://github.com/deepseek-php/deepseek-laravel)

[](#laravel-deepseek-package)

---

🚧 Migration Guide
-----------------

[](#-migration-guide)

Upgrading from v1.x? Check our comprehensive [Migration Guide](MIGRATION.md) for breaking changes and upgrade instructions.

---

📝 Changelog
-----------

[](#-changelog)

Detailed release notes available in [CHANGELOG.md](CHANGELOG.md)

---

🧪 Testing
---------

[](#-testing)

```
./vendor/bin/pest
```

Test coverage coming in v2.1.

---

🐘✨ **DeepSeek PHP Community** ✨🐘
================================

[](#-deepseek-php-community-)

Click the button bellow or [join here](https://t.me/deepseek_php_community) to be part of our growing community!

[![Join Telegram](https://camo.githubusercontent.com/8ee56c562bc6b3d5388bf271630b4e222e6d23d3fce48f4dfb22b19f9ce12229/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a6f696e2d54656c656772616d2d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d74656c656772616d)](https://t.me/deepseek_php_community)

### **Channel Structure** 🏗️

[](#channel-structure-️)

- 🗨️ **General** - Daily chatter
- 💡 **Ideas &amp; Suggestions** - Shape the community's future
- 📢 **Announcements &amp; News** - Official updates &amp; news
- 🚀 **Releases &amp; Updates** - Version tracking &amp; migration support
- 🐞 **Issues &amp; Bug Reports** - Collective problem-solving
- 🤝 **Pull Requests** - Code collaboration &amp; reviews

---

🔒 Security
----------

[](#-security)

**Report Vulnerabilities**: to

---

🤝 Contributors
--------------

[](#--contributors)

A huge thank you to these amazing people who have contributed to this project! 🎉💖

   [ ![Omar AlAlwi](https://avatars.githubusercontent.com/u/25439498?v=4)
 **Omar AlAlwi** ](https://github.com/omaralalwi)
 🏆 Creator   [ ![Ayman Alhattami](https://avatars.githubusercontent.com/u/34315778?v=4)
 **Ayman Alhattami** ](https://github.com/aymanalhattami)
 ⭐ Contributor   [ ![Mohammad Asaad](https://avatars.githubusercontent.com/u/155223476?v=4)
 **Mohammad Asaad** ](https://github.com/moassaad)
 ⭐ Contributor   [ ![Opada Alzaiede](https://avatars.githubusercontent.com/u/48367429?v=4)
 **Opada Alzaiede** ](https://github.com/OpadaAlzaiede)
 ⭐ Contributor   [ ![Hisham Bin Ateya](https://avatars.githubusercontent.com/u/3237266?v=4)
 **Hisham Bin Ateya** ](https://github.com/hishamco)
 ⭐ Contributor   [ ![Vinchan](https://avatars.githubusercontent.com/u/38177046?v=4)
 **Vinchan** ](https://github.com/VinchanGit)
 ⭐ Contributor  **Want to contribute?** Check out the [contributing guidelines](./CONTRIBUTING.md) and submit a pull request! 🚀

---

📄 License
---------

[](#-license)

This package is open-source software licensed under the [MIT License](LICENSE.md).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance54

Moderate activity, may be stable

Popularity55

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~36 days

Total

10

Last Release

306d ago

Major Versions

1.0.2 → 2.0.02025-01-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/46733da79a34ff686b036a09af1dcc6d21054aee25a5e029500dc87d3c69ba89?d=identicon)[WatheqAlshowaiter](/maintainers/WatheqAlshowaiter)

![](https://www.gravatar.com/avatar/92882431481b621f6509ff259dd600e327c27fc77adcba4fcc7177659059c9a8?d=identicon)[omaralalwi](/maintainers/omaralalwi)

![](https://www.gravatar.com/avatar/c1f16d496594fbcc1f1bb95c457f00b7790fb333a2f618662f3731d11649cd5a?d=identicon)[deepseek-php](/maintainers/deepseek-php)

---

Top Contributors

[![omaralalwi](https://avatars.githubusercontent.com/u/25439498?v=4)](https://github.com/omaralalwi "omaralalwi (91 commits)")[![moassaad](https://avatars.githubusercontent.com/u/155223476?v=4)](https://github.com/moassaad "moassaad (17 commits)")[![hishamco](https://avatars.githubusercontent.com/u/3237266?v=4)](https://github.com/hishamco "hishamco (8 commits)")[![aymanalhattami](https://avatars.githubusercontent.com/u/34315778?v=4)](https://github.com/aymanalhattami "aymanalhattami (4 commits)")[![kghamilton89](https://avatars.githubusercontent.com/u/29099829?v=4)](https://github.com/kghamilton89 "kghamilton89 (1 commits)")[![OpadaAlzaiede](https://avatars.githubusercontent.com/u/48367429?v=4)](https://github.com/OpadaAlzaiede "OpadaAlzaiede (1 commits)")[![VinchanGit](https://avatars.githubusercontent.com/u/38177046?v=4)](https://github.com/VinchanGit "VinchanGit (1 commits)")

---

Tags

aiai-for-phpapi-clientdeepseekdeepseek-apideepseek-chatdeepseek-coderdeepseek-integrationdeepseek-learningdeepseek-php-clientdeepseek-php-librarydeepseek-r1deepseek-sdkdeepseek-symfonydeepseek-v3nlpphp-deepseekphp-openai-alternativetext-generationphpapiclientsymfonysdkaiopenaiphp-sdknlpApi Wrappermachine learningllmnatural language processingai apiapi integrationAI SDKdeepseekdeveloper-toolstext-generationphp-api-clientrest-clientgenerative-aideepseek-apideepseek-aiai-client-libraryphp-ai-integrationopenai-alternativesymfony-deepseekdeepseek-symfonysymfony-http-clientsymfony-client

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/deepseek-php-deepseek-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/deepseek-php-deepseek-php-client/health.svg)](https://phpackages.com/packages/deepseek-php-deepseek-php-client)
```

###  Alternatives

[qwen-php/qwen-php-client

robust and community-driven PHP SDK library for seamless integration with the qwen AI API, offering efficient access to advanced AI and data processing capabilities

213.2k1](/packages/qwen-php-qwen-php-client)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[gemini-api-php/client

API client for Google's Gemini API

216221.4k5](/packages/gemini-api-php-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
