PHPackages                             topthink/think-ai - 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. topthink/think-ai

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

topthink/think-ai
=================

v1.0.1(9mo ago)73391Apache-2.0PHPPHP &gt;=8.0

Since Aug 30Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/top-think/think-ai)[ Packagist](https://packagist.org/packages/topthink/think-ai)[ RSS](/packages/topthink-think-ai/feed)WikiDiscussions master Synced 1mo ago

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

💎ThinkAI —— 聚合AI接口服务
--------------------

[](#thinkai--聚合ai接口服务)

[ThinkAI](https://doc.topthink.com/think-ai/default.html)致力于为企业和开发者提供便捷高效的大模型对话、图像、语音、视频、向量等AI接口聚合服务。通过ThinkAI，用户可以一站式轻松地调用各类LLM模型和AI能力，将其整合到自己的产品和服务中，实现更加智能化的功能，助力企业数智化转型。

支持模型
----

[](#支持模型)

目前顶想ThinkAI已经支持了包括GPT、DeepSeek、智谱、火山智能、星火、通义千问、腾讯混元、字节豆包、MiniMax、月之暗面在内的多个模型，未来还将不断添加更多类型的模型支持。开发者可以加入官方的[推广奖励计划](https://doc.topthink.com/public/cooperation.html)（最高返利15%）。

ThinkAI更注重提供底层的AI接口服务，这意味着用户可以更加灵活地自主研发AI应用服务。如果没有研发能力或者希望快速搭建应用，可以使用官方的ThinkBot启智AI Agent服务，为企业提供了更加便捷的开箱即用的解决方案（[体验启智](https://bot.topthink.com) ）。个人用户可以直接使用我们的AI助理服务ThinkChat（支持聊天、画画、视频、搜索、阅读和智能体市场，[立刻体验](https://chat.topthink.com)）。

安装
--

[](#安装)

```
composer require topthink/think-ai

```

生成[Token令牌](https://console.topthink.com/user/token)，并注意需要勾选启智AI。

用法
--

[](#用法)

### 聊天

[](#聊天)

```
use think\ai\Client;

$client = new Client('YOUR_TOKEN');

//非流式输出
$result = $client->chat()->completions([
    'model' => 'gpt-3.5-turbo',
    'messages' => [
        ['role' => 'user', 'content' => 'Hello!'],
    ],
    'stream'=>false,
]);
dump($result);

//流式输出
$result = $client->chat()->completions([
    'model' => 'gpt-3.5-turbo',
    'messages' => [
        ['role' => 'user', 'content' => 'Hello!'],
    ],
    'stream'=>true,
]);
foreach($result as $chunk){
    dump($chunk);
}
```

### 图像

[](#图像)

```
use think\ai\Client;

$client = new Client('YOUR_TOKEN');

//画图
$client->images()->generations($params);
//涂抹编辑
$client->images()->inpainting($params);
//图像扩展
$client->images()->outpainting($params);
```

...其他用法类似

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance70

Regular maintenance activity

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Every ~172 days

Total

3

Last Release

281d ago

Major Versions

v1.0.0 → 2.0.x-dev2025-08-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/7422243107bba2d58c5682b69d1c405e66fa027df2f6202afc1bb0c55559a7b1?d=identicon)[yunwuxin](/maintainers/yunwuxin)

---

Top Contributors

[![yunwuxin](https://avatars.githubusercontent.com/u/2168125?v=4)](https://github.com/yunwuxin "yunwuxin (43 commits)")[![liu21st](https://avatars.githubusercontent.com/u/1111670?v=4)](https://github.com/liu21st "liu21st (1 commits)")

### Embed Badge

![Health badge](/badges/topthink-think-ai/health.svg)

```
[![Health](https://phpackages.com/badges/topthink-think-ai/health.svg)](https://phpackages.com/packages/topthink-think-ai)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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