[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-04-09。"],[],[],null,["# Migrate to Advanced from Basic\n==============================\n\nExisting Cloud Translation - Basic (v2) users who want to use the latest\nCloud Translation features, such as glossaries and AutoML models,\nmust migrate their applications to use Cloud Translation - Advanced (v3). For a\ncomparison, see [Compare Basic and Advanced](/translate/docs/editions).\n\nMigrating to the Advanced edition includes using Identity and Access Management\n(IAM) and the Advanced edition client libraries. The following\nsections outline migration tasks and the key differences between the two\neditions.\n\nMigrating to Advanced\n---------------------\n\nThe following steps outline the actions required to update your existing\napplications from using Cloud Translation - Basic to Cloud Translation - Advanced.\n\n1. Take inventory of your Google Cloud projects, applications, and users that access the Cloud Translation - Basic API. You will need to provide service accounts and update them to use the Cloud Translation - Advanced client libraries.\n2. Set up [service accounts](#sa) and authentication for your application.\n3. Use IAM [roles](#iam) to set permissions on service accounts.\n4. Enable Cloud Translation - Advanced for your project. If you use AutoML models with the Cloud Translation - Advanced, you must enable AutoML as well. For more information, see the [Setup](/translate/docs/setup) guide\n5. Use the Cloud Translation - Advanced [client libraries and methods](#libs). For Cloud Translation - Advanced requests, you must include your project number (or project ID), and project location, such as `global` or `us-central1`.\n6. Check that the size of your translation requests to Cloud Translation - Advanced do not exceed the [limit](#limit).\n7. Plan your translation request quota monitoring. Both versions of the API share the same daily and monthly [quotas](/translate/quotas).\n8. Review any potential changes in [billing](/translate/pricing).\n\nKey differences between Advanced and Basic\n------------------------------------------\n\nTo help you understand your migration tasks, the following sections describe key\ndifferences between the Advanced and Basic editions.\n\n### Service accounts\n\nFor Cloud Translation - Basic, you can send authenticated requests by using API\nkeys or service accounts.\n\nCloud Translation - Advanced has features that require customer-managed resources;\nthese resources require IAM role and permissions management.\nBecause of this, you cannot use API keys to authenticate to the service.\nInstead, you must use service accounts when authenticating to\nCloud Translation - Advanced.\n\nFor more information, see the [setup](/translate/docs/setup) guide.\n\n### IAM roles\n\nWhen you use service accounts for Cloud Translation - Basic, the service accounts\nare used for authentication only. You can make any calls to\nCloud Translation - Basic no matter what permissions are associated with the\nservice account. However, for Cloud Translation - Advanced, the permissions do\napply.\n\nTo grant service accounts permissions to call Cloud Translation - Advanced, you\nassign IAM roles to them. Cloud Translation - Advanced has several\nIAM roles that you can assign to your service account to access\nspecific resources in your project. For example, if you want to use your\nservice account to translate text, you assign the `roles/cloudtranslate.user`\nrole to it. For more information, see IAM roles in\n[Cloud Translation - Advanced details](/translate/docs/intro-to-v3#iam).\n\nIf you plan to use AutoML models or any features that rely on\nCloud Storage, you must also include the appropriate roles for those\nservices. To view a list of all IAM roles, see the\n[IAM roles](/iam/docs/understanding-roles#predefined_roles)\ndocumentation.\n\n### Translation models\n\nWhen you request a translation by using Cloud Translation - Basic, Google uses a\npre-trained Neural Machine Translation (NMT) model. For\nCloud Translation - Advanced, you can use the pre-trained NMT\nmodel, the Translation LLM, or a custom AutoML Translation\nmodel.\n\nService accounts that you use for translation requests must have the permissions\nto access the NMT and AutoML models,\nwhich can be located in different projects. For example, you might have a\ncentral project that contains your translation models to simplify maintenance\nand billing. Service accounts in that project or other projects can use those\nmodels but require permissions to do so.\n\nFor more information about translation models, refer to\n[Translating text (Advanced)](/translate/docs/advanced/translating-text-v3).\n\n### Client libraries\n\nThe client libraries and methods for Cloud Translation - Advanced differ from\nCloud Translation - Basic. For example, calls to Cloud Translation - Advanced require resource\nnames. For more information, see the Cloud Translation - Advanced client libraries\n[overview](/translate/docs/reference/libraries/v3/overview-v3) or try the\ntranslate text (advanced edition)\n[quickstart](/translate/docs/advanced/translate-text-advance).\n\n#### Resources, projects, and locations\n\nRequests to Cloud Translation - Advanced require the name of the\n[resource](/apis/design/resources) that you want to use. A resource is typically\na qualified name that includes the project name and its\n[location](/compute/docs/regions-zones/global-regional-zonal-resources), which\nspecifies where the request is run. For example, the name of an\nAutoML model is a resource name.\n\nIf your Google Cloud project has the name `my-project`\nand the location for the resource is `us-central1`, then the full name\nof your resources might look like the following: \n\n```\nprojects/MY_PROJECT/locations/us-central1/...\n```\n\nThe URL that you send a\n[`getSupportedLanguages`](/translate/docs/reference/rest/v3beta1/projects.locations/getSupportedLanguages)\nrequest might look like the following: \n\n```\nhttps://translation.googleapis.com/v3/projects/my-project/locations/us-central1/supportedLanguages\n```\n| **Note:** All of your resources in a single request to Cloud Translation - Advanced must have the same location. Currently, only `global` and `us-central1` locations are supported. For all custom resources---AutoML models, glossaries, long-running-operations---you must use `us-central1`. You can also use `us-central1` when you use general translation models and language detection. You can only use the `global` location when you use general translation models and language detection. \n|\n| Cloud Translation - Advanced also provides multi-regional endpoints, such as `translate-eu.googleapis.com` to keep data handling within the EU. This is a unique endpoint for EU and not a location setting on the global API. For more information, see [Global and multi-regional\n| endpoints](/translate/docs/advanced/endpoints).\n\n### Content limit per request\n\n\nThe Cloud Translation API is optimized for translating of smaller requests. The\nrecommended maximum length for each request is 5K characters\n([code points](https://wikipedia.org/wiki/UTF-8)).\nHowever, the more characters that you include, the higher the response latency.\nFor Cloud Translation - Advanced, the maximum number of code points for a single request is\n30K. Cloud Translation - Basic has a maximum request size of 100K bytes.\n\n\nThe Cloud Translation API rejects requests larger than the maximum and gives a\n`400 INVALID_ARGUMENT` error regardless of the available quota.\n\n\u003cbr /\u003e\n\nFor more information about quotas and limits, see [Quotas](/translate/quotas).\n\nWhat's next\n-----------\n\nUse Cloud Translation - Advanced to [translate\ntext](/translate/docs/advanced/translating-text-v3), [create\nglossaries](/translate/docs/advanced/glossary), or [make batch\nrequests](/translate/docs/advanced/batch-translation)."]]