為協助您開始使用 Vertex AI,本頁面將逐步說明如何建立 Google Cloud 專案及啟用 Vertex AI API。如果您沒有執行這些工作的權限,請要求管理員為您設定專案並啟用 Vertex AI。本頁也說明如何在本地開發環境中設定 Google Cloud CLI。
設定專案
請按照下列步驟設定專案:
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
大多數 Vertex AI 功能的存取權都是透過 Vertex AI 使用者(roles/aiplatform.user) IAM 角色授予,這應該足以滿足大多數 Vertex AI 使用者的需求。如要全面控管 Vertex AI 資源,可以要求 Vertex AI 管理員(roles/aiplatform.admin)角色。如要瞭解這些角色與其他 Vertex AI 角色的差異,請參閱「運用 IAM 執行 Vertex AI 存取控管」。
如果您也打算在 Google Cloud中使用 Vertex AI Workbench 執行個體,請要求管理員授予您專案的「Notebooks 管理員」(roles/notebooks.admin) IAM 角色,以及專案或 Compute Engine 預設服務帳戶的「服務帳戶使用者」(roles/iam.serviceAccountUser) IAM 角色。
此外,如要啟用必要的 API,您必須具備服務使用管理員(roles/serviceusage.serviceUsageAdmin) IAM 角色,或是請管理員按照前幾個步驟為您啟用 API。
請管理員為您啟用 Vertex AI API。
如果您具備服務使用管理員(roles/serviceusage.serviceUsageAdmin) IAM 角色,就能自行完成這項操作。
[[["容易理解","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 (世界標準時間)。"],[],[],null,["# Set up a project and a development environment\n\nTo get you started using Vertex AI, this page guides you through how to\ncreate a Google Cloud project and enable the Vertex AI APIs. If you\ndon't have the permissions to perform these tasks,\n[ask an administrator](#ask_admin) to setup\na project and enable Vertex AI for you. Also covered in this page is\nhow to set up the Google Cloud CLI in your local development environment.\n\nSet up a project\n----------------\n\nFollow these steps to set up a project:\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Vertex AI API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Vertex AI API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com)\n\n| **Note:** If you're an administrator setting up a project for a team, see [Set up a project for a team](/vertex-ai/docs/general/set-up-project).\n\nSet up authentication\n---------------------\n\n1. Select the tab for how you plan to use the samples on this page: \n\n### Console\n\n\nWhen you use the Google Cloud console to access Google Cloud services and\nAPIs, you don't need to set up authentication.\n\n### gcloud\n\nIn the Google Cloud console, activate Cloud Shell.\n\n[Activate Cloud Shell](https://console.cloud.google.com/?cloudshell=true)\n\n\nAt the bottom of the Google Cloud console, a\n[Cloud Shell](/shell/docs/how-cloud-shell-works)\nsession starts and displays a command-line prompt. Cloud Shell is a shell environment\nwith the Google Cloud CLI\nalready installed and with values already set for\nyour current project. It can take a few seconds for the session to initialize.\n\n### Python\n\n\nTo use the Python samples on this page in a local\ndevelopment environment, install and initialize the gcloud CLI, and\nthen set up Application Default Credentials with your user credentials.\n\n1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n2. If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n3.\n After initializing the gcloud CLI, update it and install the required components:\n\n ```bash\n gcloud components update\n gcloud components install beta\n ```\n4. If you're using a local shell, then create local authentication credentials for your user account: \n\n```bash\ngcloud auth application-default login\n```\n5. You don't need to do this if you're using Cloud Shell.\n6. If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have [signed in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\nFor more information, see\n[Set up ADC for a local development environment](/docs/authentication/set-up-adc-local-dev-environment)\nin the Google Cloud authentication documentation.\n\n### REST\n\n\nTo use the REST API samples on this page in a local development environment, you use the\ncredentials you provide to the gcloud CLI.\n\n1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n2. If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n3.\n After initializing the gcloud CLI, update it and install the required components:\n\n ```bash\n gcloud components update\n gcloud components install beta\n ```\n\n\nFor more information, see\n[Authenticate for using REST](/docs/authentication/rest)\nin the Google Cloud authentication documentation.\n\n\u003cbr /\u003e\n\nAsk an administrator to set up a Vertex AI project for you\n----------------------------------------------------------\n\nThis section describes how an administrator grants the roles needed to use\nVertex AI.\n\n1. Determine a meaningful project name and project ID to identify your project. If you are part of an organization or plan to create multiple projects, consider what naming conventions and [folder](/resource-manager/docs/cloud-platform-resource-hierarchy#folders) hierarchies are followed, or could be followed, to make project organization clear.\n2. Required roles:\n 1. Access to most Vertex AI capabilities is granted by the [Vertex AI\n User](/vertex-ai/docs/general/access-control#aiplatform.user) `(roles/aiplatform.user)` IAM role and should suffice for most Vertex AI users. For full control of Vertex AI resources, you can request the [Vertex AI\n Administrator](/vertex-ai/docs/general/access-control#aiplatform.admin) `(roles/aiplatform.admin)` role. To explore the differences between these and other Vertex AI roles, see [Vertex AI access control\n with IAM](/vertex-ai/docs/general/access-control).\n 2. If you also intend to use [Vertex AI Workbench\n instances](/vertex-ai/docs/workbench/introduction) in Google Cloud, ask your administrator to grant you the [Notebooks\n Administrator](/iam/docs/understanding-roles#notebooks.admin) `(roles/notebooks.admin)` IAM role for the project, as well as the [Service\n Account User](/iam/docs/understanding-roles#iam.serviceAccountUser) `(roles/iam.serviceAccountUser)` IAM role on either the project or the [Compute Engine\n default service account](/compute/docs/access/service-accounts#default_service_account).\n 3. Additionally, to enable the necessary APIs, you either need the [Service\n Usage Admin](/iam/docs/understanding-roles#serviceusage.serviceUsageAdmin) `(roles/serviceusage.serviceUsageAdmin)` IAM role or your administrator needs to enable the APIs for you by following the first few steps.\n3. Ask your administrator to enable Vertex AI APIs for you. If you're granted the [Service\n Usage Admin](/iam/docs/understanding-roles#serviceusage.serviceUsageAdmin) `(roles/serviceusage.serviceUsageAdmin)` IAM role, then you'll be able to do this on your own.\n\n| **Note:** Certain tasks in Vertex AI require that you use additional Google Cloud products besides Vertex AI. For example, in most cases, you must use Cloud Storage and Artifact Registry when you create a custom training pipeline. You might need to perform additional setup tasks to use other Google Cloud products.\n\nWhat's next\n-----------\n\n- Read an [overview of\n Vertex AI](/vertex-ai/docs/start/introduction-unified-platform).\n\n- Walk through one of the [tutorials for using\n Vertex AI](/vertex-ai/docs/tutorials).\n\n- Learn how to\n [use the Vertex AI SDK for Python](/vertex-ai/docs/python-sdk/use-vertex-ai-python-sdk),\n which provides another way to interact with Vertex AI."]]