리전 엔드포인트 지정
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Text-to-Speech는 미국 및 EU 리전 API 엔드포인트를 제공합니다.
리전 엔드포인트를 사용할 경우 저장 데이터 및 사용 중인 데이터는 유럽 또는 미국의 대륙 경계 내에 유지됩니다. 엔드포인트 지정은 현지 규제 요건을 준수하기 위해 데이터 위치를 제어해야 하는 경우에 중요합니다. API의 동작에 대한 기능 변경사항은 없습니다.
리전 엔드포인트 사용
리전 엔드포인트를 사용하는 경우 parent
문자열에 일치하는 us
또는 eu
위치를 포함해야 합니다. 합성 요청 본문 구성에 대한 자세한 내용은 Synthesize
문서를 참조하세요.
프로토콜
리전 엔드포인트를 사용하여 TTS(텍스트 음성 변환) 합성을 수행하려면 아래 테이블의 해당 명령어를 실행하여 적절한 엔드포인트를 구성합니다.
멀티 리전 |
엔드포인트 재정의 |
EU |
$ export CLOUD_TTS_ENDPOINT=https://eu-texttospeech.googleapis.com |
US |
$ export CLOUD_TTS_ENDPOINT=https://us-texttospeech.googleapis.com |
다음 엔드포인트에서는 Neural2 음성만 사용할 수 있습니다.
단일 리전 |
엔드포인트 재정의 |
US Central1 |
$ export CLOUD_TTS_ENDPOINT=https://us-central1-texttospeech.googleapis.com |
다음 코드 샘플은 모든 데이터를 지정된 리전으로 제한하는 synthesis request
를 전송하는 방법을 보여줍니다. EU
또는 US
리전 엔드포인트를 CLOUD_TTS_ENDPOINT 변수 대신 사용할 수 있습니다. 여기서 PROJECT_ID를 프로젝트 ID로 바꿉니다.
$ curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project: PROJECT_ID" \
-H "Content-Type: application/json; charset=utf-8" \
--data "{
'input':{
'text':'Android is a mobile operating system developed by Google,
based on the Linux kernel and designed primarily for
touchscreen mobile devices such as smartphones and tablets.'
},
'voice':{
'languageCode':'en-gb',
'name':'en-GB-Neural2-A',
'ssmlGender':'FEMALE'
},
'audioConfig':{
'audioEncoding':'MP3'
}
}" $CLOUD_TTS_ENDPOINT/v1/text:synthesize > synthesize-text.txt
이 예시에서는 Google Cloud CLI를 사용하여 Google 계정의 액세스 토큰을 만듭니다. gcloud CLI 설치에 대한 안내는 Text-to-Speech에 인증을 참조하세요.
전역 API 엔드포인트 사용 제한
리전 엔드포인트 사용을 강제하려면 constraints/gcp.restrictEndpointUsage
조직 정책 제약조건을 사용하여 전역 API 엔드포인트에 대한 요청을 차단하세요. 자세한 내용은 엔드포인트 사용 제한을 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-25(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-25(UTC)"],[],[],null,["# Specify a regional endpoint\n\nText-to-Speech offers US and EU regional API endpoints.\nIf you use a regional endpoint, your data at-rest and in-use will stay\nwithin the continental boundaries of Europe or the USA. Specifying an endpoint\nis important if your data's location must be controlled in order to comply with\nlocal regulatory requirements. There is no functional change to the behavior of\nthe API.\n\nUse regional endpoints\n----------------------\n\nWhen you use a regional endpoint, make sure to include the matching `us` or `eu`\nlocation in the `parent` string. See the\n[`Synthesize`](/text-to-speech/docs/create-audio)\ndocumentation for more information about configuring the synthesize request\nbody. \n\n### Protocol\n\nTo perform text to speech synthesis using a regional endpoint, run the\napplicable command in the table below to configure the correct endpoint:\n\nOnly Neural2 voices are available from these endpoints:\n\nThe following code sample demonstrates how to send a\n[`synthesis request`](/text-to-speech/docs/reference/rest/v1beta1/text/synthesize)\nthat keeps all data confined to a specified region. You can substitute either\nthe `EU` or `US` regional endpoint for the \u003cvar translate=\"no\"\u003eCLOUD_TTS_ENDPOINT\u003c/var\u003e\nvariable. Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your project ID. \n\n```bash\n$ curl -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n --data \"{\n 'input':{\n 'text':'Android is a mobile operating system developed by Google,\n based on the Linux kernel and designed primarily for\n touchscreen mobile devices such as smartphones and tablets.'\n },\n 'voice':{\n 'languageCode':'en-gb',\n 'name':'en-GB-Neural2-A',\n 'ssmlGender':'FEMALE'\n },\n 'audioConfig':{\n 'audioEncoding':'MP3'\n }\n }\" $\u003cvar translate=\"no\"\u003eCLOUD_TTS_ENDPOINT\u003c/var\u003e/v1/text:synthesize \u003e synthesize-text.txt\n```\n\nThis example uses the [Google Cloud CLI](/sdk/docs/install) to create an access\ntoken for your Google Account. For instructions on installing the\ngcloud CLI, see\n[Authenticate to Text-to-Speech](/text-to-speech/docs/authentication).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nRestrict global API endpoint usage\n----------------------------------\n\nTo help enforce the use of regional endpoints, use the\n`constraints/gcp.restrictEndpointUsage` organization policy constraint to block\nrequests to the global API endpoint. For more information, see\n[Restricting endpoint usage](/assured-workloads/docs/restrict-endpoint-usage)."]]