애플리케이션 기본 사용자 인증 정보 구성

Vertex AI에서 Gemini를 사용하려면 Google Cloud API 키를 사용하거나 애플리케이션 기본 사용자 인증 정보를 사용하여 인증해야 합니다. 테스트에는 API 키를 사용하고 프로덕션에는 애플리케이션 기본 사용자 인증 정보를 사용하는 것이 좋습니다. 이 페이지에서는 애플리케이션 기본 사용자 인증 정보를 구성하는 방법을 보여줍니다.

시작하기 전에

프로젝트 선택, 결제 사용 설정, Vertex AI API 사용 설정, gcloud CLI 설치

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI API.

    Enable the API

  5. Install the Google Cloud CLI.

  6. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  7. To initialize the gcloud CLI, run the following command:

    gcloud init
  8. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  9. Make sure that billing is enabled for your Google Cloud project.

  10. Enable the Vertex AI API.

    Enable the API

  11. Install the Google Cloud CLI.

  12. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  13. To initialize the gcloud CLI, run the following command:

    gcloud init

로컬 인증 사용자 인증 정보 만들기

If you're using a local shell, then create local authentication credentials for your user account:

gcloud auth application-default login

You don't need to do this if you're using Cloud Shell.

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.

첫 번째 API 요청

애플리케이션 기본 사용자 인증 정보를 구성한 후 API 빠른 시작에서 첫 번째 요청을 실행하는 방법을 알아보세요.