> For the complete documentation index, see [llms.txt](https://doc.crisen.org/ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.crisen.org/ai/tencent.md).

# 腾讯AI

### 获取ai实例

```
use Crisen\AI\Ai;

.....

$config = [
     'app_id' => 'your appid',
      'app_key' => 'your secret id',
];

$ai = AI::tencent($config);
```

> 特别说明 在后面的文章出现的$ai变量 如果没有特别说明 均为当前实例

## 选择网关

```
//人脸识别
$gateway = $ai->face();
// 人脸库管理
$gateway = $ai->faceset();
```

## 调用路由

```
$res = $gateway->detect([
    'image' => 'some base 64 code'
]);

$res = $gateway->base64('some base 64 code')->detect();
```
