Add Google AI Studio usage via Cloud Monitoring

Open
#3,072 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
google-cloud, swift

Research direction

Start by reading the existing Vertex AI ADC and Cloud Monitoring implementation, then review the proposed provider boundary and fixture-only testing approach. Done means a separate Google AI Studio provider uses explicit project selection and native generativelanguage.googleapis.com metrics without live credentials, cookies, private endpoints, or credential-value logging.

Written by the indexing model from the issue text.

Description

clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr issue-rating: 🌊 off-meta tidepool P3

Summary

Could CodexBar add a separate Google AI Studio provider for project-level Gemini API usage through the official
Cloud Monitoring API and gcloud Application Default Credentials?

This is distinct from:

  • Gemini, which uses Gemini CLI OAuth and private quota APIs;
  • Vertex AI, which monitors aiplatform.googleapis.com;
  • #2377, which adds model pricing lookup rather than project quota telemetry.

Evidence

I ran a read-only seven-day spike against an active project. It made no Gemini generation calls, imported no cookies,
and changed no APIs, IAM, or project settings.

  • 14 populated native generativelanguage.googleapis.com/* series;
  • 6 unambiguous quota usage/limit pairs;
  • request, input/output token, and model-level data available;
  • about 48 minutes of observed reporting lag.

Native Gemini metrics were sufficient; generic Service Runtime quota metrics were not.

Proposed v1

  • Built-in provider using ADC, reusing/refactoring Vertex AI's Cloud Monitoring transport.
  • Explicit project selection; no automatic Google Cloud changes.
  • Primary window: highest unambiguous quota usage.
  • Details: project/model request and token totals plus update time.
  • No browser cookies, private AI Studio endpoints, per-key breakdown, billing/cost, or cross-provider fallback.
  • Never render or log project/credential label values.

A local provider plugin cannot support this safely today because plugins cannot access gcloud/ADC.

Would a separate built-in Google AI Studio provider fit CodexBar's provider boundary?

If accepted, I can prepare a focused implementation that reuses the existing Vertex AI ADC and Cloud Monitoring code
where practical, with fixture-only tests and no live credentials.

Dominant language
Swift
Stars
21.6k
Forks
2k
Avg merge
1d 9h
Merged PRs (30d)
385

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from steipete/CodexBar

All issues in steipete/CodexBar

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.