Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. The max length of this field is 1024.
mime_type
string
Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".
source_language_code
string
Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
target_language_code
string
Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-10 UTC."],[[["\u003cp\u003eThis service translates text input into a specified target language, using a POST request to the provided endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eparent\u003c/code\u003e parameter is required in the path, representing the caller's project in the format \u003ccode\u003e/projects/{project-id}\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires \u003ccode\u003econtents\u003c/code\u003e (the text to translate) and \u003ccode\u003etarget_language_code\u003c/code\u003e (the desired translation language) fields, while \u003ccode\u003esource_language_code\u003c/code\u003e and \u003ccode\u003emime_type\u003c/code\u003e are optional.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eglossary_config\u003c/code\u003e field is optional and enables the use of a glossary for translation, supporting the \u003ccode\u003ecloudtranslate.glossaries.predict\u003c/code\u003e feature.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests return a \u003ccode\u003eTranslateTextResponse\u003c/code\u003e, and the total \u003ccode\u003econtents\u003c/code\u003e input should ideally be under 30k codepoints with a max length of 1024.\u003c/p\u003e\n"]]],[],null,["# Method: projects.translateText\n\nTranslates input text and returns translated text.\n\n### HTTP request\n\n`POST https://{TRANSLATION_GDC_ENDPOINT}/v3/{parent}:translateText`\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [TranslateTextResponse](/distributed-cloud/hosted/docs/latest/gdch/apis/vertex-ai/translation/rest/v3/TranslateTextResponse)."]]