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

ActiveLibrary[API Development](/categories/api)

easyx/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.

01PHP

Since Sep 2Pushed 8mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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 7.4+

---

🚀 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

17

—

LowBetter than 6% of packages

Maintenance42

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/80e86aebdddbdbda4c9967b8c157eea71f13cc1437d551d42d8338e68a352df3?d=identicon)[DontFollow](/maintainers/DontFollow)

---

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)")[![DontFollow](https://avatars.githubusercontent.com/u/27821679?v=4)](https://github.com/DontFollow "DontFollow (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)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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