AI多语言翻译 - 英译中Français API接口文档,基于大语言模型的智能多语言翻译API,支持中英日韩法等多语种互译。针对电商场景优化,准确翻译商品标题、描述、评论等。Solution d'intégration pipeline CI/CD。支持参数说明、调用示例、在线测试。免费试用。

请求格式

POST /api/v1/translate

请求头信息:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json

请求参数

参数名 类型 必填 说明
textstring是待翻译文本
source_langstring是源语言代码
target_langstring是目标语言代码(en-zh)
domainstring否领域(ecommerce/tech/general)

调用示例 - cURL

curl -X POST "https://cross.cybermagi.space/api/v1/translate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello, welcome to our store!", "target_lang": "en"}'

Python 调用示例

# Exemple Python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://cross.cybermagi.space"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

data = {
    "target": "en-zh"
}

response = requests.post(
    f"{BASE_URL}/api/v1/translate",
    json=data,
    headers=headers
)

result = response.json()
print(result)

返回示例

{
  "success": true,
  "data": {
    "translated_text": "Translated text content here...",
    "source_lang": "auto",
    "target_lang": "en",
    "confidence": 0.97,
    "processing_time_ms": 340
  },
  "request_id": "req_translate_en-zh_fr_5"
}
🚀 在线测试

点击返回主页,获取API密钥并在线测试