跳转到主要内容
POST
/
openapi
/
v1
/
task
/
translate
/
create
创建文本翻译(同步)
curl --request POST \
  --url https://api.vmeg.ai/openapi/v1/task/translate/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency-Key: <x-idempotency-key>' \
  --data '
{
  "language": {
    "source": "zh-CN",
    "target": "en-US"
  },
  "segments": [
    {
      "text": "<string>",
      "gender": "male",
      "speaker": "Speaker A",
      "locale": "zh-CN",
      "context": [
        "<string>"
      ],
      "start": 123,
      "end": 123
    }
  ],
  "options": {
    "sourceContext": {
      "mode": "independent",
      "contextWindow": 5
    },
    "sceneCustomized": {
      "scene": "video",
      "allowStutter": true
    },
    "glossary": {},
    "prompt": "<string>",
    "skipMissingTranslationCheck": false
  }
}
'
{
  "code": 200,
  "message": "",
  "data": {
    "taskId": "<string>",
    "items": [
      {
        "text": "<string>",
        "errorMessage": "<string>"
      }
    ],
    "createdAt": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.vmeg.ai/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

Authorization 请求头中传入 API Key(Bearer <api_key>)。见 鉴权

请求头

X-Idempotency-Key
string
必填

创建任务或修改持久化数据的 POST 必填(最长 64 字符)。见 幂等

Maximum string length: 64

请求体

application/json
language
object
必填

翻译源语言与目标语言

segments
object[]
必填

待翻译文本片段(最多 50 条)

Maximum array length: 50
options
object

可选翻译设置(上下文、场景、术语表、prompt)

响应

200 - application/json

成功

code
integer
必填

业务码;200 表示成功

示例:

200

message
string

code 非成功时的说明信息

示例:

""

data
object

同步 HTTP 响应中返回的译文片段。