> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stmlink.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# 同声传译

> 会中同声传译的开关与成员语言：每句定稿后翻译成在会成员的语言并合成语音，随频道消息 asr_trans 下发；依附在「语音转写」上

## 开启同声传译

`POST /server/v1/interp/start`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/rtc/server-api/overview.md)）

开启频道的同声传译：每句话定稿后翻译成在会成员的各种语言、合成语音，通过频道消息 asr\_trans 下发（带 audio\_url）。

* 依附在语音识别上：频道还没开语音识别时会自动开启，返回的 session\_id 与「启动语音识别」一致
* 成员用「设置同传语言」设自己的语言，没设的按中文；每句只翻译成「在会成员的语言 − 说话人的语言」
* 开启后发频道消息 interp\_enabled（enabled=true，duck\_volume 为播译音时说话人原声的音量），频道属性 props 里的
  interp\_enabled / interp\_duck\_volume 同步更新，后入会的成员从频道属性取当前状态
* 重复调用幂等，可用于会中更换 AI 方案；停止语音识别时同传随之关闭
* 某种语言大模型超时或出错没翻出来时，照常下发该语言的 asr\_trans，trans\_text 为占位文案、带 trans\_error（timeout / error），
  没有 audio\_url（不播报）

需要应用的 AI 方案配了大模型，否则报「大模型未配置或未启用」；方案没配语音合成时只下发译文、没有 audio\_url。

**请求参数**

**channel** `string` *required*

频道名
示例：`fire`

**profile** `string`

AI 方案名（运营后台「AI 服务与方案」里配置），不传按应用 AI 设置的方案，再没有用默认方案（最大长度 64）
示例：`default`

请求示例：

```json theme={null}
{
  "channel": "fire",
  "profile": "default"
}
```

**响应参数**

**session\_id** `string`

识别场次ID（同传依附在转写场次上）

**duck\_volume** `number`

播译音时说话人原声压到的音量（0\~1，0=静音），来自 AI 方案
示例：`0.2`

响应示例：

```json theme={null}
{
  "code": 0,
  "data": {
    "duck_volume": 0.2,
    "session_id": ""
  }
}
```

***

## 关闭同声传译

`POST /server/v1/interp/stop`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/rtc/server-api/overview.md)）

关闭频道的同声传译，语音识别照常进行（译文回到按应用设置的单语言实时翻译）。没开启时也返回成功。

关闭后发频道消息 interp\_enabled（enabled=false）。

**请求参数**

**channel** `string` *required*

频道名
示例：`fire`

请求示例：

```json theme={null}
{
  "channel": "fire"
}
```

**响应参数**

`data` 为 null

响应示例：

```json theme={null}
{
  "code": 0,
  "data": null
}
```

***

## 设置成员的同传语言

`POST /server/v1/interp/set-lang`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/rtc/server-api/overview.md)）

设置成员的同传语言（「我的语言」）：决定他说话时用哪种语言识别，以及别人的话要翻译成哪种语言给他听。

* 频道开启后即可设置，同传没开也会记住，开启时生效；频道销毁后清除
* 设置后发频道消息 interp\_lang（uid、lang），各端据此判断播不播某条译音
* 正在识别时立即切换该成员的识别语言，切换前说的最后一句照常输出
* 中英夹杂说话的成员建议设中文

**请求参数**

**channel** `string` *required*

频道名
示例：`fire`

**uid** `string` *required*

成员的用户ID（仅支持大小写字母、数字、下划线 \_ 与连字符 -）
示例：`1001`

**lang** `string`

语言码（zh / en 等，zh-CN 这类带地区的按 zh 处理），空=恢复默认语言（最大长度 16）
示例：`en`

请求示例：

```json theme={null}
{
  "channel": "fire",
  "lang": "en",
  "uid": "1001"
}
```

**响应参数**

`data` 为 null

响应示例：

```json theme={null}
{
  "code": 0,
  "data": null
}
```

***

## 查询频道同传状态与成员语言

`POST /server/v1/interp/langs`

鉴权：需要（见[概览](https://docs.stmlink.com/zh/rtc/server-api/overview.md)）

查询频道的同传状态与成员语言表，入会时取一次全量，之后按频道消息 interp\_enabled / interp\_lang 增量更新。

langs 只含设过语言的成员，没设的按 default\_lang。

**请求参数**

**channel** `string` *required*

频道名
示例：`fire`

请求示例：

```json theme={null}
{
  "channel": "fire"
}
```

**响应参数**

**enabled** `boolean`

同声传译是否开启

**duck\_volume** `number`

播译音时说话人原声压到的音量（0\~1），未开启时为 0

**default\_lang** `string`

没设语言的成员按此语言算
示例：`zh`

**langs** `object`

设过语言的成员：uid → 语言
示例：`{"1001":"en"}`

响应示例：

```json theme={null}
{
  "code": 0,
  "data": {
    "default_lang": "zh",
    "duck_volume": 0,
    "enabled": false,
    "langs": {
      "1001": "en"
    }
  }
}
```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.