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

ActiveLibrary[API Development](/categories/api)

yven/openai-php-client
======================

OpenAI client is a community-maintained PHP API client that allows you to interact with OpenAI like API, supports php7.4+.

1.0.1(1y ago)132MITPHPPHP ^7.4.0CI passing

Since May 13Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

openai-php-client
=================

[](#openai-php-client)

openai-php-client is a community-maintained PHP API client that allows you to interact with OpenAI like API, supports php7.4+.

[![Coverage Status](https://camo.githubusercontent.com/40e35c2e3cfdf5821db1a41fdc127e1974b5f5957e536da58ca810ca7f3427ea/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f5976656e2f6f70656e61692d7068702d636c69656e742f62616467652e7376673f6272616e63683d666561747572652f63696364)](https://coveralls.io/github/Yven/openai-php-client?branch=feature/cicd)[![GitHub Workflow Status (main)](https://camo.githubusercontent.com/f54600474a0624262b3288644ed6fc1beb1d9e133d3b613122d2eefe54be350d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7976656e2f6f70656e61692d7068702d636c69656e742f756e69742e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d726f756e642d737175617265)](https://camo.githubusercontent.com/f54600474a0624262b3288644ed6fc1beb1d9e133d3b613122d2eefe54be350d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7976656e2f6f70656e61692d7068702d636c69656e742f756e69742e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d726f756e642d737175617265)[![Latest Version](https://camo.githubusercontent.com/e8820b30f301df7bcdf0a0a42a870140791226a9f94bd3cedc03a98af590c5c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7976656e2f6f70656e61692d7068702d636c69656e74)](https://packagist.org/packages/openai-php/client)[![License](https://camo.githubusercontent.com/6388bc14ec0a657c85f8faaf33d9001568800f76dd2699025b6e08e4620d9796/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7976656e2f6f70656e61692d7068702d636c69656e74)](https://packagist.org/packages/openai-php/client)

---

### Install

[](#install)

```
composer require yven/openai-php-client
```

### Usage

[](#usage)

```
$apiKeys = "sk-xxx...";
$service = \OpenAI\Client::build(\OpenAI\constant\LLM::QWEN_ALI, $apiKeys);

// HTTP 请求
$data = $service->query("你好，请问你可以做什么？")->send();
echo $data->getContent();

// SSE 请求
$data = $service->query("你好，请问你可以做什么？")->stream();
$content = '';
/** @var \OpenAI\response\Response $item */
foreach ($data as $item) {
    $content .= $item->getContent();
}
echo $content;
```

### Develop

[](#develop)

支持模型：

厂商模型类型模型名称DeepSeek普通模型`deepseek-chat`DeepSeek推理模型`deepseek-reasoner`通义千问普通模型`qwen-plus`通义千问视觉模型`qwen-vl-plus`通义千问长文本模型`qwen-long`通义千问推理模型`qwq-plus`通义千问Qwen3`qwen3-32b`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance49

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

2

Last Release

369d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fdbc55a1dcd6c4ec2a9fcfe38a298c651a0bfb85ed265474e51cdf0c76e1c55?d=identicon)[Yven](/maintainers/Yven)

---

Top Contributors

[![Yven](https://avatars.githubusercontent.com/u/10890849?v=4)](https://github.com/Yven "Yven (37 commits)")

---

Tags

openai-apiphpphpapiclientsdklanguageprocessingnaturaldeepseekqwen

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

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

3.7k7.6M74](/packages/openai-php-laravel)[google-gemini-php/laravel

Google Gemini PHP for Laravel is a supercharged PHP API client that allows you to interact with the Google Gemini AI API

614397.1k4](/packages/google-gemini-php-laravel)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[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)[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)[google-gemini-php/symfony

Symfony Bundle for Gemini

149.4k1](/packages/google-gemini-php-symfony)

PHPackages © 2026

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