PHPackages                             litesrv/baidu-aip - 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. litesrv/baidu-aip

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

litesrv/baidu-aip
=================

百度 AI 开放平台 php-sdk

v1.1(7y ago)05MITPHPPHP &gt;=7.1

Since Jun 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/litesrv/baidu-aip)[ Packagist](https://packagist.org/packages/litesrv/baidu-aip)[ RSS](/packages/litesrv-baidu-aip/feed)WikiDiscussions master Synced 2w ago

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

百度 AI 开放平台 php-sdk
==================

[](#百度-ai-开放平台-php-sdk)

> 支持 composer、laravel/lumen

要求
--

[](#要求)

requirements

- composer
- php &gt;= 7.1
- ext-json &gt;= 1.0

安装
--

[](#安装)

install

```
$ composer require litesrv/baidu-aip
```

使用
--

[](#使用)

usage

```
require 'vendor/autoload.php';

$config = [
      'use'          => 'default',
      'debug'        => true,
      'applications' => [
          'default' => [
              'app_id'     => 'your app id',
              'api_key'    => 'your api key',
              'secret_key' => 'your secret key',
          ],
          'your app' => [
              'app_id'     => 'your app id',
              'api_key'    => 'your api key',
              'secret_key' => 'your secret key',
          ],
      ]
  ];

$aip = new \LiteSrv\BaiduAIP\BaiduAIP($config);

var_dump(json_encode($aip->image_censor->antiSpam('测试')));
var_dump(json_encode($aip->use('your app')->image_censor->antiSpam('测试')));
```

> sdk支持多应用，使用 use 切换当前应用配置。

API
---

[](#api)

- `$aip->image_censor` 图像审核服务，对应百度AI开放平台中视觉技术的 [图像审核](http://ai.baidu.com/docs#/ImageCensoring-PHP-SDK/top) API
- `$aip->image_classify` 图像识别服务，对应百度AI开放平台中视觉技术的 [图像识别](http://ai.baidu.com/docs#/ImageClassify-PHP-SDK/top) API
- `$aip->image_search` 图像搜索服务，对应百度AI开放平台中视觉技术的 [图像搜索](http://ai.baidu.com/docs#/ImageSearch-PHP-SDK/top) API
- `$aip->body_analysis` 人体分析服务，对应百度AI开放平台中视觉技术的 [人体分析](http://ai.baidu.com/docs#/BodyAnalysis-PHP-SDK/top) API
- `$aip->face` 人脸识别服务，对应百度AI开放平台中视觉技术的 [人脸识别](http://ai.baidu.com/docs#/Face-Detect-V3/top) API
- `$aip->ocr` 文字识别服务，对应百度AI开放平台中视觉技术的 [文字识别](http://ai.baidu.com/docs#/OCR-PHP-SDK/top) API
- `$aip->nlp` 自然语言处理服务，对应百度AI开放平台中的 [自然语言](http://ai.baidu.com/docs#/NLP-PHP-SDK/top) API
- `$aip->speech` 百度语音服务，对应百度AI开放平台中的 [百度语音](http://ai.baidu.com/docs#/ASR-Online-PHP-SDK/top) API
- `$aip->kg` 讲真这个我也不知道干什么的，但是官方SDK有

[litesrv/baidu-aip](https://github.com/litesrv/baidu-aip)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

2

Last Release

2565d ago

### Community

Maintainers

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

---

Tags

ai

### Embed Badge

![Health badge](/badges/litesrv-baidu-aip/health.svg)

```
[![Health](https://phpackages.com/badges/litesrv-baidu-aip/health.svg)](https://phpackages.com/packages/litesrv-baidu-aip)
```

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.5M28](/packages/rubix-ml)[codewithkyrian/transformers

State-of-the-art Machine Learning for PHP. Run Transformers in PHP

757254.8k7](/packages/codewithkyrian-transformers)[maestroerror/laragent

Power of AI Agents in your Laravel project

639142.5k](/packages/maestroerror-laragent)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

318117.1k1](/packages/cognesy-instructor-php)[symfony/ai-platform

PHP library for interacting with AI platform provider.

521.2M216](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

31746.8k83](/packages/symfony-ai-agent)

PHPackages © 2026

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