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.

Base URL: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.

HTTP Header
x-api-key: YOUR_API_KEY
Content-Type: application/json
请妥善保管你的 API Key,不要在客户端代码中明文暴露。Keep your API Key confidential — never expose it in client-side code.

语言代码 · Language Codes

所有接口使用以下语言代码 · All APIs use the following language codes:

mn / mo
传统蒙古文 · Traditional Mongolian
zh
中文 · Chinese
en
英文 · English

错误码 · Error Codes

Code含义 · Meaning
200成功 · Success
401API 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.

POST /asr-upload
上传音频文件进行识别 · Upload audio file for recognition

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

JSON
{
  "code": 200,
  "result": "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠦᠦ᠂ ᠳᠡᠯᠡᠬᠡᠢ",
  "language": "mn"
}

示例 · Example

cURL
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.

POST /tts
文字转语音 · Text to Speech

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
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.

POST /translate
文本翻译 · Text Translation

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说明
zhmn中文 → 蒙古文
mnzh蒙古文 → 中文
zhen中文 → 英文
enzh英文 → 中文
mnen蒙古文 → 英文
enmn英文 → 蒙古文

Response

JSON
{
  "code": 200,
  "result": "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠦᠦ᠂ ᠳᠡᠯᠡᠬᠡᠢ",
  "from": "zh",
  "to": "mn"
}

示例 · Example

cURL
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
微信 WeChatnuudel
电话 Phone+86 139 4797 0107
邮件 Emailservice@mangas.cn
© 2025 Inner Mongolia Mangas Technology Co., Ltd. · 内蒙古码格斯科技有限公司 · 蒙ICP备2025031332号-3