Patent Basic Data

Translate text (SSE)

Translate content from source to target language and stream segments over SSE. Choose the strategy with mode: fast (default) segmented, stream sliding-window, raw direct model pass-through.

post/hiro_translation/translate

Request

Request body

contentstring required

Source text to translate. Must not be blank. Default max 65536 characters.

sourceLanguageCodeobject required

Source language code.

targetLanguageCodeobject required

Target language code; must differ from source.

modestring

Translation mode: fast (default) segmented, stream sliding-window, raw direct pass-through. Example: fast.

Example request

{
  "content": "本发明涉及一种用于图像识别的装置,包括处理器和存储器。\n所述处理器被配置为对输入图像进行分类。",
  "mode": "fast"
}

Response

Successful translate text (sse) response.

_metaobject

Billing metadata on the SSE JSON body (not an HTTP header).

statestring required

Execution status

progressstring

Translation progress as current/total segments (e.g. 3/10). raw is typically 1/1.

textOriginalstring required

Source segment text

textTranslatedstring required

Translated segment text

translatedCharacterCountinteger required

Character count of this translated segment

Example response

{
  "_meta": {
    "openapi_billing": {
      "version": 1,
      "multiplier": "2"
    }
  },
  "state": "success",
  "progress": "1/2",
  "textOriginal": "本发明涉及一种用于图像识别的装置,包括处理器和存储器。",
  "textTranslated": "The present invention relates to an apparatus for image recognition, comprising a processor and a memory.",
  "translatedCharacterCount": 105
}

Changes

No recorded changes to this operation across all 1 revision of this API.