Skip to content

Google Cloud Advanced Setup: Multiple Accounts and Model Management

What You'll Learn

Configure multiple Google Cloud accounts, view quota usage across all accounts with a single command, understand the mapping of 4 models (G3 Pro, G3 Image, G3 Flash, Claude), and resolve quota limitations with single-account models.

Core Concepts

Multi-Account Support

opencode-mystatus supports querying multiple Google Cloud Antigravity accounts simultaneously. Each account independently displays its quota for 4 models, making it easy to manage quota allocation across multiple projects.

Accounts are stored in ~/.config/opencode/antigravity-accounts.json and managed by the opencode-antigravity-auth plugin. You need to install this plugin before adding Google Cloud accounts.

Model Mapping

Google Cloud Antigravity provides multiple models, and the plugin displays the 4 most commonly used:

Display NameModel Key (Primary)Model Key (Alternative)
G3 Progemini-3-pro-highgemini-3-pro-low
G3 Imagegemini-3-pro-image-
G3 Flashgemini-3-flash-
Claudeclaude-opus-4-5-thinkingclaude-opus-4-5

Why Are There Alternative Keys?

Some models have two versions (high/low). The plugin prioritizes displaying data from the primary key; if the primary key has no quota information, it automatically uses data from the alternative key.

Project ID Usage

Querying quota requires a Project ID. The plugin prioritizes using projectId, falling back to managedProjectId if it doesn't exist. Both IDs can be configured when adding an account.

🎒 Prerequisites

Prerequisites

Make sure you have:

Follow Along

Step 1: Add Your First Google Cloud Account

Why The first account is the foundation; you can only test multi-account queries after successfully adding it.

Use the opencode-antigravity-auth plugin to add an account. Assuming you've already installed the plugin:

bash
# Let AI help you install (recommended)
# In Claude/OpenCode, enter:
Install the opencode-antigravity-auth plugin from: https://github.com/NoeFabris/opencode-antigravity-auth

After installation, follow the plugin's documentation to complete Google OAuth authentication.

You should see:

  • Account information saved to ~/.config/opencode/antigravity-accounts.json
  • File content similar to:
    json
    {
      "version": 1,
      "accounts": [
        {
          "email": "user1@gmail.com",
          "refreshToken": "1//...",
          "projectId": "my-project-123",
          "managedProjectId": "managed-project-456",
          "addedAt": 1737600000000,
          "lastUsed": 1737600000000
        }
      ]
    }

Step 2: Query Google Cloud Quota

Why Verify that the first account is configured correctly and view the quota status for 4 models.

bash
/mystatus

You should see:

## Google Cloud Account Quota

### user1@gmail.com

G3 Pro     4h 59m     ████████████████████ 100%
G3 Image   4h 59m     ████████████████████ 100%
G3 Flash   4h 59m     ████████████████████ 100%
Claude     2d 9h      ░░░░░░░░░░░░░░░░░░░░ 0%

Step 3: Add a Second Google Cloud Account

Why When you have multiple Google Cloud accounts, you can manage quota allocation for multiple projects simultaneously.

Repeat the process from Step 1, signing in with a different Google account.

After adding, the antigravity-accounts.json file will look like:

json
{
  "version": 1,
  "accounts": [
    {
      "email": "user1@gmail.com",
      "refreshToken": "1//...",
      "projectId": "my-project-123",
      "addedAt": 1737600000000,
      "lastUsed": 1737600000000
    },
    {
      "email": "user2@gmail.com",
      "refreshToken": "2//...",
      "projectId": "another-project-456",
      "addedAt": 1737700000000,
      "lastUsed": 1737700000000
    }
  ]
}

Step 4: View Multi-Account Quota

Why Confirm that both accounts' quotas are displayed correctly, helping you plan usage across accounts.

bash
/mystatus

You should see:

## Google Cloud Account Quota

### user1@gmail.com

G3 Pro     4h 59m     ████████████████████ 100%
G3 Image   4h 59m     ████████████████████ 100%
G3 Flash   4h 59m     ████████████████████ 100%
Claude     2d 9h      ░░░░░░░░░░░░░░░░░░░░ 0%

### user2@gmail.com

G3 Pro     2h 30m     ████████████░░░░░░░░ 65%
G3 Image   2h 30m     ██████████░░░░░░░░░ 50%
G3 Flash   2h 30m     ██████████████░░░░░░ 80%
Claude     1d 5h      ████████░░░░░░░░░░░ 35%

Troubleshooting

Account Not Displayed

Problem: Added account, but mystatus doesn't show it.

Cause: Account is missing the email field. The plugin filters out accounts without an email field (see source code google.ts:318).

Solution: Ensure each account in antigravity-accounts.json has an email field.

Missing Project ID

Problem: Error "No project ID found" displayed.

Cause: Account configuration has neither projectId nor managedProjectId.

Solution: When re-adding the account, ensure you've filled in a Project ID.

Empty Model Data

Problem: A model shows 0% or no data.

Causes:

  1. The account hasn't used that model
  2. The model's quota information wasn't returned (some models may require special permissions)

Solutions:

  • This is normal behavior; as long as the account has quota data
  • If all models are at 0%, check if the account permissions are correct

Summary

  • Installing the opencode-antigravity-auth plugin is a prerequisite for querying Google Cloud quotas
  • Supports simultaneous querying of multiple accounts, with each account independently displaying quotas for 4 models
  • Model mapping: G3 Pro (supports high/low), G3 Image, G3 Flash, Claude (supports thinking/normal)
  • Plugin prioritizes projectId, using managedProjectId if it doesn't exist
  • Accounts must include an email field to be queried

Coming Up Next

In the next lesson, we'll learn GitHub Copilot Authentication Setup.

You'll learn:

  • Two Copilot authentication methods: OAuth Token and Fine-grained PAT
  • How to resolve Copilot permission issues
  • Quota differences across subscription types

Appendix: Source Code Reference

Click to expand source code locations

Last updated: 2026-01-23

FeatureFile PathLine
Model configuration mappingplugin/lib/google.ts69-78
---------
Account filtering (must have email)plugin/lib/google.ts318
Project ID priorityplugin/lib/google.ts231
Model quota extractionplugin/lib/google.ts132-157
AntigravityAccount type definitionplugin/lib/types.ts78-86

Key Constants:

  • MODELS_TO_DISPLAY: Configuration for 4 models (key, altKey, display)
  • GOOGLE_QUOTA_API_URL: Google Cloud quota API endpoint
  • USER_AGENT: Request User-Agent (antigravity/1.11.9)

Key Functions:

  • queryGoogleUsage(): Query quota for all Google Cloud accounts
  • fetchAccountQuota(): Query quota for a single account (includes token refresh)
  • extractModelQuotas(): Extract quota information for 4 models from API response
  • formatAccountQuota(): Format quota output for a single account