为帮助您开始使用 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.
[[["易于理解","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-09-10。"],[],[],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."]]