PHPackages                             moyuuuuuuuu/qianfan - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. moyuuuuuuuu/qianfan

ActiveLibrary[HTTP &amp; Networking](/categories/http)

moyuuuuuuuu/qianfan
===================

千帆api客户端

v1.0.1(4mo ago)014↓93.3%Apache-2.0PHPPHP &gt;=8.0

Since Jan 16Pushed 4mo agoCompare

[ Source](https://github.com/moyuuuuuuuuuuu/qianfan)[ Packagist](https://packagist.org/packages/moyuuuuuuuu/qianfan)[ RSS](/packages/moyuuuuuuuu-qianfan/feed)WikiDiscussions master Synced today

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

千帆api接口请求工具
-----------

[](#千帆api接口请求工具)

### 获取模型列表

[](#获取模型列表)

```
//组装payload
$payload = (new \Moyuuuuuuuu\Nutrition\Payload\Universal())
    ->setDomain('https://qianfan.baidubce.com')
    ->setUri('v2/models')->setMethod(RequestMethod::GET);
```

### 视觉理解

[](#视觉理解)

```
$payload = (new Universal())
    ->setDomain('https://qianfan.baidubce.com')
    ->setUri('v2/chat/completions')
    ->setMethod(RequestMethod::POST)
//    ->addMessage(Role::SYSTEM, file_get_contents($basePath . '/src/Template/text'))
    ->add('messages', [
        [
            'role'    => Role::USER->value,
            'content' => [
                [
                    'type' => 'text',
                    'text' => file_get_contents($basePath . '/src/Template/image')
                ],
                [
                    'type'      => 'image_url',
                    'image_url' => ['url' => \Moyuuuuuuuu\Nutrition\Util::baseFile($basePath . '/images/1.jpeg')]
                ]
            ]
        ]
    ])
    ->add('model', 'ernie-4.5-turbo-vl-latest');

//发起请求
$request = new \Moyuuuuuuuu\Nutrition\Request(getenv('API_KEY'));
$res     = $request->send($payload);

var_dump($res);
```

### 文本生成

[](#文本生成)

```
#文本生成
$payload = (new Universal())
    ->setDomain('https://qianfan.baidubce.com')
    ->setUri('v2/chat/completions')
    ->setMethod(RequestMethod::POST)
    ->addMessage(Role::SYSTEM, file_get_contents($basePath . '/src/Template/text'))
    ->add('model', 'ERNIE-5.0-Thinking-Preview');

//发起请求
$request = new \Moyuuuuuuuu\Nutrition\Request(getenv('API_KEY'));
$res     = $request->send($payload);

var_dump($res);
```

### 短语音识别

[](#短语音识别)

```
$payload = (new Universal())
    ->setDomain('http://vop.baidu.com')
    ->setUri('/server_api')
    ->setMethod(RequestMethod::POST)
    ->setHeader('Content-Type', 'application/json')
    ->add('speech', Util::baseFile($basePath . '/speech/1.m4a',null,false))
    ->add('format', 'm4a')
    ->add('channel', 1)
    ->add('cuid', 'default_user')
    ->add('dev_pid', 1537)
    ->add('len', filesize($basePath . '/speech/1.m4a'))
    ->add('rate', 16000);
$request = new \Moyuuuuuuuu\Nutrition\Request(getenv('API_KEY'));
$res     = $request->send($payload);
```

其他各个接口依此类推

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance77

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Total

2

Last Release

125d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

v1.0.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a70221db6c5245dc1f661624434e5aac6ea5da7503fadca4abb539692db629c?d=identicon)[Janmas Cromwell](/maintainers/Janmas%20Cromwell)

---

Top Contributors

[![moyuuuuuuuuuuu](https://avatars.githubusercontent.com/u/58201307?v=4)](https://github.com/moyuuuuuuuuuuu "moyuuuuuuuuuuu (16 commits)")

### Embed Badge

![Health badge](/badges/moyuuuuuuuu-qianfan/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[guzzlehttp/test-server

Node.js server and PHP controller

14284.0k22](/packages/guzzlehttp-test-server)

PHPackages © 2026

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