PHPackages                             srcker/openai - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. srcker/openai

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

srcker/openai
=============

常用大模型请求结构

1.2.1(1y ago)010Apache-2.0PHP

Since Dec 18Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

srcker-open-ai
==============

[](#srcker-open-ai)

```
       $chatCompletionRequest = new ChatCompletionRequest();

        $chatCompletionRequest
            ->setModel("ep-20241220124901-pc5gs")
            ->addMessage(new ChatMessage(Role::USER, '介绍下自己'));

        $result = $this->factory
            ->withApiKey("****-6904-***-ba03-**")
            ->withBaseUrl("https://ark.cn-beijing.volces.com/api/v3/chat/completions")
            ->withHttpHeader("Content-Type", "application/json")
            ->withOptions([])
            ->withProxy($this->proxy) //格式: "http://user:password@host:port"
            ->withChatCompletionRequest($chatCompletionRequest)
            ->make();

        print_r($result);
```

```
        $chatCompletionRequest = new ChatCompletionRequest();

        $chatCompletionRequest
            ->setModel("ep-20241220124901-pc5gs")
            ->addMessage(new ChatMessage(Role::USER, '介绍下自己'));

        $this->factory
            ->withApiKey("****-333-****-ba03-***")
            ->withBaseUrl("https://ark.cn-beijing.volces.com/api/v3/chat/completions")
            ->withHttpHeader("Content-Type", "application/json")
            ->withOptions([])
            ->withProxy($this->proxy) //格式: "http://user:password@host:port"
            ->withChatCompletionRequest($chatCompletionRequest)
            ->withStreamHandler(function ($chunk) {
                echo $chunk;
            })
            ->makeStreamHandler();
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance40

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 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 ~19 days

Total

4

Last Release

504d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/651508?v=4)[Sinda](/maintainers/Sinda)[@Sinda](https://github.com/Sinda)

---

Top Contributors

[![srcker](https://avatars.githubusercontent.com/u/6512197?v=4)](https://github.com/srcker "srcker (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/srcker-openai/health.svg)

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

###  Alternatives

[deligoez/laravel-model-hashid

Generate, Save, and Route Stripe/Youtube-like Hash IDs for Laravel Eloquent Models

166114.2k](/packages/deligoez-laravel-model-hashid)[shopigo/magento2-extension-price-format

Magento 2 Price Format extension by Shopigo

111.3k](/packages/shopigo-magento2-extension-price-format)

PHPackages © 2026

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