Brainiall人工智能API
    
用于语音、文本、图像和LLM推理的生产AI API。可用作AI代理的REST端点和MCP服务器。
基本URL: https://apim-ai-apis.azure-api.net LLM的完整API参考: llms-full.txt | llms.txt
产品
| 产品 | 端点 | 延迟 | 备注 |
|---|---|---|---|
| 发音评估 | /v1/pronunciation/assess/base64 | \<500ms | 17MB ONNX,每个音素得分(39 ARPAbet) |
| 文本转语音 | /v1/tts/synthesize | \<1s | 12个声音(美国+英国),24kHz WAV |
| 语音到文本 | /v1/stt/transcribe/base64 | \<500ms | 紧凑型17MB型号,英文,单词时间戳 |
| Whisper Pro | /v1/whisper/transcribe/base64 | \<3s | 99种语言,说话者日记 |
| NLP套件 | /v1/nlp/{toxicity,sentiment,entities,pii,language} | \<50ms | 仅CPU,ONNX,5个端点 |
| 图像处理 | /v1/image/{remove-background,upscale,restore-face}/base64 | \<3s | GPU(A10),BiRefNet+ESRGAN+GFPGAN |
| LLM网关 | /v1/chat/completions | 多种型号,兼容OpenAI,流媒体 |
认证
在每个请求中包含以下标头之一:
Ocp-Apim-Subscription-Key: YOUR_KEY
Authorization: Bearer YOUR_KEY
api-key: YOUR_KEY在获取API密钥 门户 (GitHub登录、购买积分、创建密钥)。
快速开始
Python——LLM网关(OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://apim-ai-apis.azure-api.net/v1",
api_key="YOUR_KEY"
)
response = client.chat.completions.create(
model="claude-sonnet",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Python——发音评估
import requests, base64
audio_b64 = base64.b64encode(open("audio.wav", "rb").read()).decode()
r = requests.post(
"https://apim-ai-apis.azure-api.net/v1/pronunciation/assess/base64",
headers={"Ocp-Apim-Subscription-Key": "YOUR_KEY"},
json={"audio": audio_b64, "text": "Hello world", "format": "wav"}
)
print(r.json()["overallScore"]) # 0-100Python——NLP管道
import requests
headers = {"Ocp-Apim-Subscription-Key": "YOUR_KEY"}
base = "https://apim-ai-apis.azure-api.net/v1/nlp"
# Sentiment
r = requests.post(f"{base}/sentiment", headers=headers, json={"text": "I love this!"})
print(r.json()) # {"label": "positive", "score": 0.9987}
# PII detection with redaction
r = requests.post(f"{base}/pii", headers=headers, json={"text": "Email john@acme.com", "redact": True})
print(r.json()["redacted_text"]) # "Email [EMAIL]"Node.js——LLM网关
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://apim-ai-apis.azure-api.net/v1",
apiKey: "YOUR_KEY"
});
const res = await client.chat.completions.create({
model: "claude-sonnet",
messages: [{ role: "user", content: "Hello!" }]
});
console.log(res.choices[0].message.content);curl--图像背景去除
curl -X POST https://apim-ai-apis.azure-api.net/v1/image/remove-background/base64 \
-H "Ocp-Apim-Subscription-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d "{\"image\": \"$(base64 -i photo.jpg)\"}"LLM网关——流行模型
| 型号 | 别名 | 价格($/M入/出) |
|---|---|---|
| 克劳德作品4.6 | claude-opus | $5 / $25 |
| 克劳德·十四行诗4.6 | claude-sonnet | $3 / $15 |
| 克劳德·海库4.5 | claude-haiku | $1 / $5 |
DeepSeek R1。 deepseek-r1 | $1.35 / $5.40 | |
| DeepSeek V3 | deepseek-v3 | $0.27 / $1.10 |
| Llama 3.3 70B | llama-3.3-70b | $0.72 / $0.72 |
| 亚马逊Nova Pro | nova-pro | $0.80 / $3.20 |
| 亚马逊Nova Micro | nova-micro | $0.035 / $0.14 |
| 西北风大3 | mistral-large-3 | $2 / $6 |
| Qwen3 32B | qwen3-32b | $0.35 / $0.35 |
完整列表: GET /v1/models (来自17家供应商的113多种型号)。
支持:流式SSE、工具调用、结构化输出(json_object/json_schema),延伸思维。
适用于:OpenAI SDK、LiteLLM、LangChain、Cline、Cursor、Aider、Continue、SillyAvern、Open WebUI。
MCP服务器(用于AI代理)
3台MCP服务器,共20个工具。可流式HTTP传输。
| 服务器 | URL | 工具 |
|---|---|---|
| 语音AI | https://apim-ai-apis.azure-api.net/mcp/pronunciation/mcp | 10个工具+8个资源+3个提示 |
| NLP工具 | https://apim-ai-apis.azure-api.net/mcp/nlp/mcp | 6个工具+3个资源+3个提示 |
| 图像工具 | https://apim-ai-apis.azure-api.net/mcp/image/mcp | 4个工具+3个资源+2个提示 |
MCP配置(克劳德桌面/光标/鼠标)
{
"mcpServers": {
"brainiall-speech": {
"url": "https://apim-ai-apis.azure-api.net/mcp/pronunciation/mcp",
"headers": { "Ocp-Apim-Subscription-Key": "YOUR_KEY" }
},
"brainiall-nlp": {
"url": "https://apim-ai-apis.azure-api.net/mcp/nlp/mcp",
"headers": { "Ocp-Apim-Subscription-Key": "YOUR_KEY" }
},
"brainiall-image": {
"url": "https://apim-ai-apis.azure-api.net/mcp/image/mcp",
"headers": { "Ocp-Apim-Subscription-Key": "YOUR_KEY" }
}
}
}也可在以下网址获得: 铁匠铺 (得分95/100)| MCPize | Apify (0.02美元/次通话)| MCP注册表
例子
| 文件 | 描述 |
|---|---|
python/basic_usage.py | 语音API——评估、转录、合成 |
python/pronunciation_tutor.py | 交互式发音辅导 |
javascript/basic_usage.js | Node.js语音API示例 |
curl/examples.sh | 每个端点的curl命令 |
mcp/claude-desktop-config.json | Claude Desktop的MCP配置 |
mcp/cursor-config.json | Cursor IDE的MCP配置 |
llms-full.txt | LLM消耗的完整API参考 |
定价
| 产品 | 价格 | 单位 |
|---|---|---|
| 发音 | $0.02 | 每次通话 |
| TTS | $0.01-0.03 | 每1K字符 |
| STT(紧凑型) | $0.01 | 每次请求 |
| Whisper Pro | 每分钟0.02美元 | |
| NLP(任意) | 每次通话0.001-0.002美元 | |
| 图片(任意) | 每张图片0.003-0.005美元 | |
| LLM网关 | 有竞争力的价格 | 按MTok计算 |
信用套餐:5美元、10美元、25美元、50美元、100美元。 门户 | Azure市场 (搜索“Brainiall”)。
许可证
麻省理工学院 --Brainiall
