이 페이지에서는 개발자가 Speech-to-Text 서비스를 사용하도록 프로젝트를 설정하는 방법을 설명합니다.
이 프로세스에는 프로젝트 만들기, Speech-to-Text API 사용 설정, 클라이언트 라이브러리 설치, 환경 변수 정의, 사용자 인증 정보 인증이 포함됩니다. Vertex AI를 처음 사용하는 경우 음성 인식 기능에 대해 자세히 알아보세요.
GDC 콘솔과 gdcloud CLI를 사용하여 다음과 같이 음성 인식 프로젝트를 설정합니다.
GDC 콘솔: Speech-to-Text API를 사용 설정하고 서비스 상태와 엔드포인트를 확인합니다.
gdcloud CLI: Speech-to-Text API와 상호작용하도록 서비스 계정을 구성하고, 클라이언트 라이브러리를 설치하고, API 요청을 인증합니다.
프로젝트 만들기
분산 클라우드 리소스 계층 구조 내에서 음성 인식 프로젝트를 만들면 공동작업자, 사용 설정된 API, 모니터링 도구, 결제 정보, 인증 사용자 인증 정보, 액세스 제어를 포함한 Speech-to-Text 리소스가 정리됩니다.
[[["이해하기 쉬움","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-09-04(UTC)"],[[["\u003cp\u003eThis page guides developers through setting up a project to use the Speech-to-Text service, which involves project creation, API enablement, client library installation, and credential authentication.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers must create a project using the GDC console or the gdcloud CLI, to organize Speech-to-Text resources and you need your project ID for API calls.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize speech recognition features, users need the AI Speech Developer role, granted by the Project IAM Admin.\u003c/p\u003e\n"],["\u003cp\u003eUsing Python client libraries is recommended for making API calls to Speech-to-Text and you need to ensure the correct version is installed.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment variables, such as service account keys, can be defined in Python scripts to facilitate API interactions and the usage of those variables.\u003c/p\u003e\n"]]],[],null,["# Set up a speech recognition project\n\nThis page helps developers set up a project to use the Speech-to-Text service.\nThis process includes creating a project, enabling the Speech-to-Text API,\ninstalling client libraries, defining environment variables, and authenticating\nyour credentials. If you are new to Vertex AI, [learn more about speech recognition features](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-stt).\n\nYou set up a speech recognition project using the GDC console and\ngdcloud CLI as follows:\n\n- **GDC console**: Enable the Speech-to-Text API and view the service status and endpoint.\n- **The gdcloud CLI**: Configure service accounts to interact with the Speech-to-Text API, install client libraries, and authenticate API requests.\n\nCreate a project\n----------------\n\nCreating a speech recognition project within your Distributed Cloud\n[resource hierarchy](/distributed-cloud/hosted/docs/latest/gdch/resources/resource-hierarchy)\norganizes your Speech-to-Text resources, which include collaborators,\nenabled APIs, monitoring tools, billing information, authentication credentials,\nand access controls.\n\nTo create your project, see [Set up a project for Vertex AI](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-set-up-project).\nYou need your project ID when making API calls.\n| **Tip:** Improve security, resource management, and cost tracking by isolating your experimental, testing, and production workloads in separate Distributed Cloud projects.\n\nRequest developer permissions\n-----------------------------\n\nYou must have the AI Speech Developer role in your project to\naccess speech recognition features and generate an API token for request\nauthentication and authorization.\n\nAsk your Project IAM Admin to grant the AI Speech Developer\n(`ai-speech-developer`) role to your user or service account\nwithin your project namespace. For information about this role, see\n[Prepare IAM permissions](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-ao-permissions).\n\nEnable the Speech-to-Text API\n-----------------------------\n\nYou must [enable the Speech-to-Text pre-trained API](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-enable-pre-trained-apis)\nfor your project. If enabled, you can [view the service status and endpoint for the Speech-to-Text pre-trained API](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-api-status).\n\nInstall client libraries\n------------------------\n\nClient libraries are available for the Python programming language. We recommend\nusing these client libraries to make calls to the Speech-to-Text API\nbecause they make it easier to access APIs.\n\n[Install the Speech-to-Text client library](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-install-libraries)\nand follow these steps to ensure you have the correct version:\n\n1. Check if the Speech-to-Text client library is installed and obtain\n the version number:\n\n pip freeze | grep speech\n\n If the client library is already installed, you obtain an output similar\n to the following example: \n\n google-cloud-speech==2.15.0\n\n The version number you obtain must match the client library at the\n following endpoint: \n\n https://\u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e/.well-known/static/client-libraries\n\n Replace \u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e with the\n URL of your organization in GDC.\n2. If the version numbers don't match, uninstall the client library:\n\n pip uninstall google-cloud-speech\n\n3. If you uninstalled the Speech-to-Text client library, you must\n [reinstall it](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-install-libraries)\n by specifying the filename corresponding to your operating system.\n\nSet your environment variables\n------------------------------\n\nAfter installing the Speech-to-Text client library, you can interact\nwith the API from a Python script.\n\nIf you [set up a service account](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-set-up-project#set-up-service)\nin your project to make authorized API calls programmatically, you can define\nenvironment variables in the Python script to access values such as the service\naccount keys when running.\n\nFollow these steps to set required environment variables on a Python script:\n\n1. [Create a JupyterLab notebook](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-workbench#create-notebook)\n to interact with the Speech-to-Text pre-trained API.\n\n2. Create a Python script on the JupyterLab notebook.\n\n3. Add the following code to the Python script:\n\n import os\n\n os.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = \"\u003cvar translate=\"no\"\u003eAPPLICATION_DEFAULT_CREDENTIALS_FILENAME\u003c/var\u003e\"\n\n Replace \u003cvar translate=\"no\"\u003eAPPLICATION_DEFAULT_CREDENTIALS_FILENAME\u003c/var\u003e with\n the name of the JSON file that contains [the service account keys you created](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-set-up-project#set-up-service)\n in the project, such as `my-service-key.json`.\n4. Save the Python script with a name, such as `speech.py`.\n\n5. Run the Python script to set the environment variables:\n\n python \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eSCRIPT_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eSCRIPT_NAME\u003c/var\u003e with the name you gave to your\n Python script, such as `speech.py`.\n\n| **Note:** Keep the script open when using the environment variables from Python or getting an authentication token.\n\nSet up authentication\n---------------------\n\nBefore you can start using the Speech-to-Text API, you must authenticate\nyour client credentials and request account access to your project resources.\nFor more information, see [Authenticate API requests](/distributed-cloud/hosted/docs/latest/gdch/application/ao-user/vertex-ai-api-auth)."]]