SainuAI API 文档
API Reference Documentation · 蒙古语 · 中文 · English
概览 · Overview
SainuAI API 提供蒙古语、中文、英文三语 AI 语言能力,包括语音识别(ASR)、语音合成(TTS)和机器翻译(MT)。所有接口基于 HTTPS,使用 POST 方法。
SainuAI API provides trilingual AI capabilities in Mongolian, Chinese, and English — including ASR, TTS, and MT. All endpoints use HTTPS POST.
https://api.sainuai.com
鉴权 · Authentication
所有请求需在 HTTP Header 中携带 x-api-key 字段。请联系我们申请 API Key。
All requests require the x-api-key header. Contact us to obtain your API Key.
x-api-key: YOUR_API_KEY Content-Type: application/json
语言代码 · Language Codes
所有接口使用以下语言代码 · All APIs use the following language codes:
错误码 · Error Codes
| Code | 含义 · Meaning |
|---|---|
| 200 | 成功 · Success |
| 401 | API Key 无效或缺失 · Invalid or missing API Key |
| 429 | 请求频率超限 · Rate limit exceeded |
| 500 | 服务器内部错误 · Internal server error |
语音识别 · ASR
将音频文件转写为文字。支持蒙古语、中文、英文。上传 PCM 格式音频,返回识别结果。
Convert audio to text in Mongolian, Chinese, or English. Upload PCM audio, receive transcription.
Request Headers
| Header | 说明 · Description |
|---|---|
| x-api-key必填 | API 密钥 · Your API Key |
| x-language可选 | 语言代码,默认 mn · Language code, default mn |
| Content-Type必填 | application/octet-stream |
Request Body
原始 PCM 音频二进制数据 · Raw PCM audio binary data
推荐参数 · Recommended: 采样率 16000Hz,16bit,单声道 Mono
Response
{
"code": 200,
"result": "ᠰᠠᠢᠨ ᠪᠠᠢᠨᠠ ᠦᠦ᠂ ᠳᠡᠯᠡᠬᠡᠢ",
"language": "mn"
}
示例 · Example
curl -X POST https://api.sainuai.com/asr-upload \ -H "x-api-key: YOUR_API_KEY" \ -H "x-language: mn" \ -H "Content-Type: application/octet-stream" \ --data-binary @audio.pcm
语音合成 · TTS
将文字转换为自然人声音频。支持蒙古语、中文、英文,返回 PCM 音频数据。
Convert text to natural-sounding speech. Mongolian, Chinese & English supported. Returns PCM audio.
Request Headers
| Header | 说明 · Description |
|---|---|
| x-api-key必填 | API 密钥 · Your API Key |
| Content-Type必填 | application/json |
Request Body
| 参数 · Param | 类型 · Type | 说明 · Description |
|---|---|---|
| text必填 | string | 要合成的文字 · Text to synthesize |
| language可选 | string | 语言代码,默认 mn · Language code |
示例 · Example
curl -X POST https://api.sainuai.com/tts \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text": "ᠰᠠᠢᠨ ᠪᠠᠢᠨᠠ ᠦᠦ", "language": "mn"}' \ --output output.pcm
机器翻译 · MT
蒙古语、中文、英文三语双向互译。支持传统蒙古文与西里尔蒙古文。
Bidirectional translation across Mongolian, Chinese & English. Traditional and Cyrillic Mongolian supported.
Request Headers
| Header | 说明 · Description |
|---|---|
| x-api-key必填 | API 密钥 · Your API Key |
| Content-Type必填 | application/json |
Request Body
| 参数 · Param | 类型 · Type | 说明 · Description |
|---|---|---|
| text必填 | string | 待翻译文本 · Text to translate |
| from必填 | string | 源语言代码 · Source language |
| to必填 | string | 目标语言代码 · Target language |
支持的翻译方向 · Supported Translation Pairs
| from → to | 说明 |
|---|---|
zh → mn | 中文 → 蒙古文 |
mn → zh | 蒙古文 → 中文 |
zh → en | 中文 → 英文 |
en → zh | 英文 → 中文 |
mn → en | 蒙古文 → 英文 |
en → mn | 英文 → 蒙古文 |
Response
{
"code": 200,
"result": "ᠰᠠᠢᠨ ᠪᠠᠢᠨᠠ ᠦᠦ᠂ ᠳᠡᠯᠡᠬᠡᠢ",
"from": "zh",
"to": "mn"
}
示例 · Example
curl -X POST https://api.sainuai.com/translate \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "你好,世界", "from": "zh", "to": "mn" }'
联系我们 · Contact
申请 API Key 或遇到问题,请通过以下方式联系我们。我们将在 24 小时内回复。
To get your API Key or report issues, contact us via any channel below. We respond within 24 hours.
| 渠道 · Channel | 信息 · Info |
|---|---|
| 微信 WeChat | nuudel |
| 电话 Phone | +86 139 4797 0107 |
| 邮件 Email | service@mangas.cn |