Using Your Own Google Cloud Project (Vertex)

In the clinic, the workshop pays for your agent’s model calls. After the clinic, NOAA staff can use the USAI models through Google Cloud Vertex AI, billed to a Google Cloud project. This page shows how to set up Claude Code, OpenCode, Antigravity, or GitHub Copilot CLI on your own Linux, Mac, or Windows computer to use your project.

What you need

  • A Google Cloud project with Vertex AI and the models you want turned on. At NOAA this comes through the USAI program. You need the project ID, which looks like my-project-123456 (not the display name).
  • Permission to install software on your computer. On a NOAA-managed computer, you may need IT to install these tools for you.

Which models you get depends on what your project has turned on, not on the tool. If a model is not turned on, the tool will report that the model was “not found”.

The NOAA USAI catalog includes Google’s Gemini models (for example gemini-3.8-flash and gemini-3.1-pro-preview), Anthropic’s Claude models (for example claude-opus-5-5, claude-sonnet-5-5 and claude-haiku-5-5), xAI’s Grok models, and OpenAI’s gpt-oss-120b-maas. Each Claude model needs its own approval in your project before you can use it. If you plan to use Claude, ask for approval of the specific models you want, for example claude-sonnet-5-5 and claude-opus-5-5.

Install your harness

The harness is the program you talk to; the model behind it runs on Google Cloud. Install the one you want to use. On Linux and Mac, run the command in a terminal. On Windows, run it in PowerShell.

Linux and Mac:

curl -fsSL https://claude.ai/install.sh | bash

Windows (PowerShell):

irm https://claude.ai/install.ps1 | iex

Claude Code on Windows also needs Git for Windows. Other ways to install are in the Claude Code documentation.

Linux and Mac:

curl -fsSL https://opencode.ai/install | bash

Windows: run the same command in Git Bash, or see the other ways to install in the OpenCode documentation.

Linux and Mac:

curl -fsSL https://antigravity.google/cli/install.sh | bash

Windows (PowerShell):

irm https://antigravity.google/cli/install.ps1 | iex

The command it installs is called agy.

Linux and Mac:

curl -fsSL https://gh.io/copilot-install | bash

Windows (PowerShell):

winget install GitHub.Copilot

Other ways to install are in the Copilot CLI documentation. With Vertex you do not need a GitHub Copilot subscription.

Close the terminal and open a new one, so it finds the newly installed command.

Tell your harness to use Vertex

1. Sign in to Google Cloud. Claude Code uses your Google login through the Google Cloud CLI (gcloud). Install the Google Cloud CLI, then run this once:

gcloud auth application-default login

A browser opens. Sign in with your NOAA Google account.

2. Set three environment variables. Replace YOUR_PROJECT_ID with your project ID.

Linux and Mac:

export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=global
export ANTHROPIC_VERTEX_PROJECT_ID=YOUR_PROJECT_ID

These last only for this terminal. To have them in every new terminal, add the three lines to the end of your shell’s startup file: ~/.zshrc on a Mac, ~/.bashrc on most Linux systems.

Windows (PowerShell):

setx CLAUDE_CODE_USE_VERTEX 1
setx CLOUD_ML_REGION global
setx ANTHROPIC_VERTEX_PROJECT_ID YOUR_PROJECT_ID

setx saves them for every new PowerShell window, but not the one you typed them in. Open a new window before the next step.

3. Start Claude Code:

claude

It should not ask you to log in to an Anthropic account. If it does, the environment variables are not set in this terminal.

Choosing a model. Type /model inside Claude Code, or start it with claude --model claude-opus-5-5. Use the model names your project has turned on.

Region. global lets Google route each request to wherever there is capacity. If your project requires requests to stay in the United States, use us instead of global.

1. Sign in to Google Cloud. OpenCode uses your Google login through the Google Cloud CLI (gcloud). Install the Google Cloud CLI, then run this once:

gcloud auth application-default login

A browser opens. Sign in with your NOAA Google account.

2. Set two environment variables. Replace YOUR_PROJECT_ID with your project ID.

Linux and Mac:

export GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
export VERTEX_LOCATION=global

These last only for this terminal. To have them in every new terminal, add the two lines to the end of your shell’s startup file: ~/.zshrc on a Mac, ~/.bashrc on most Linux systems.

Windows (PowerShell):

setx GOOGLE_CLOUD_PROJECT YOUR_PROJECT_ID
setx VERTEX_LOCATION global

setx saves them for every new PowerShell window, but not the one you typed them in. Open a new window before going on.

3. List the Claude models your project has. OpenCode’s built-in model list adds a suffix (@default) to newer Claude model names, and Vertex rejects it with a “not found” error. Create a file called opencode.json in OpenCode’s settings folder (~/.config/opencode/ on Linux and Mac, %USERPROFILE%\.config\opencode\ on Windows) with the models your project has turned on, for example:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "google-vertex-anthropic": {
      "models": {
        "claude-opus-5-5": { "name": "Claude Opus 5.5" }
      }
    }
  }
}

4. Start OpenCode with one of those models:

opencode -m google-vertex-anthropic/claude-opus-5-5

Antigravity does not use environment variables or gcloud for this. You give it your project when you sign in. Start it:

agy
  1. When asked to “Select login method”, choose “Continue with Google Cloud”.
  2. A browser opens (or the terminal shows a link to open). Sign in with your NOAA Google account and allow access. If the terminal asks for a code, copy it from the browser and paste it in.
  3. It may say you have no license. That is expected: your project pays as you go.
  4. When asked for your Google Cloud project, enter your project ID.
  5. When asked to accept a license, accept “Agent Platform”.

To switch to a different project later, type /logout inside Antigravity, start it again, and sign in with the other project ID.

Copilot CLI can use the Gemini and gpt-oss models in your project, but not Claude. It talks to Vertex through Vertex’s OpenAI-style connection, and Vertex does not offer Claude that way. For Claude, use Claude Code or OpenCode.

1. Sign in to Google Cloud. Copilot CLI uses your Google login through the Google Cloud CLI (gcloud). Install the Google Cloud CLI, then run this once:

gcloud auth application-default login

A browser opens. Sign in with your NOAA Google account.

2. Set four environment variables. Replace YOUR_PROJECT_ID with your project ID. The third one tells Copilot CLI to ask gcloud for a fresh sign-in token for each request; Google’s tokens expire after an hour, so a token pasted in once would stop working.

Linux and Mac:

export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_BASE_URL="https://aiplatform.googleapis.com/v1/projects/YOUR_PROJECT_ID/locations/global/endpoints/openapi"
export COPILOT_PROVIDER_API_KEY_COMMAND="gcloud auth application-default print-access-token"
export COPILOT_MODEL=google/gemini-3.1-pro-preview

These last only for this terminal. To have them in every new terminal, add the four lines to the end of your shell’s startup file: ~/.zshrc on a Mac, ~/.bashrc on most Linux systems.

Windows (PowerShell):

setx COPILOT_PROVIDER_TYPE openai
setx COPILOT_PROVIDER_BASE_URL "https://aiplatform.googleapis.com/v1/projects/YOUR_PROJECT_ID/locations/global/endpoints/openapi"
setx COPILOT_PROVIDER_API_KEY_COMMAND "gcloud auth application-default print-access-token"
setx COPILOT_MODEL google/gemini-3.1-pro-preview

setx saves them for every new PowerShell window, but not the one you typed them in. Open a new window before going on.

3. Start Copilot CLI:

copilot

It should not ask you to log in to GitHub. If it does, the environment variables are not set in this terminal.

Choosing a model. Change COPILOT_MODEL and start Copilot CLI again. Model names start with who makes them: google/gemini-3.8-flash (faster and cheaper), google/gemini-3.1-pro-preview, or openai/gpt-oss-120b-maas.

Check that it works

Ask the agent something short, like “reply with just the word hi”. If it answers, your project is working.

What you see What it usually means
“not found” or “does not have access” for a model That model is not turned on in your project, or the region does not have it. For Claude, each model needs its own approval. Try another model, or ask your project’s administrator.
Copilot CLI says a Claude model is “not servable” Copilot CLI cannot use Claude on Vertex. Use a Gemini model, or use Claude Code or OpenCode for Claude.
“could not load the default credentials” or another credentials message Run gcloud auth application-default login again (Claude Code, OpenCode and Copilot CLI).
Claude Code asks you to log in to Anthropic, or Copilot CLI to GitHub The environment variables are not set in this terminal. On Windows, open a new PowerShell window after setx.
Permission denied on the project Your Google account is not a member of the project, or not allowed to use Vertex AI in it. Ask your project’s administrator.
The command is not found right after installing Open a new terminal so it picks up the new install.