---
name: google-ultra
description: "Spend Google AI Ultra benefits: Gemini text tasks (second opinions, web search, reading files, images, video) on the signed-in CLI quota, GPU jobs (fine-tunes, video-to-3D motion, open models) on Colab compute units, and API credits only for Veo, Lyria, and speech."
user-invocable: false
compatibility: "Text work needs the gemini CLI on PATH, signed in with the Ultra account. Media generation needs Python 3.10+ (stdlib) and GEMINI_API_KEY."
routing:
category: meta
triggers:
- google ultra
- ai ultra
- ultra quota
- use my google credits
- gemini api
- ask gemini
- gemini second opinion
- through antigravity
- gemini cli
- veo
- lyria
- gemini tts
- gemini speech
- gemini video understanding
- gemini batch
- colab
- colab gpu
- run on a gpu
- fine-tune a lora
- compute units
not_for: "Still images (use image-gen, which has a Gemini backend); editing existing video or audio (use video-editing); a Codex or GPT second-opinion review (use pr-workflow); work the current model can do alone"
pairs_with:
- image-gen
- video-editing
- game-trailer
- game-dev
- research
complexity: Medium
---
# google-ultra
<!-- ‹guest · 2026-12-05› -->
Use the Google AI Ultra plan's machine-usable benefits from any runtime this
toolkit installs to. Two lanes, in this order:
1. **Gemini CLI quota** through `scripts/second_opinion.py` (`gemini -p`), signed
in with the Ultra account. Owner: "it shouldn't be api usage though, it
should be my logged in usage." Every Gemini text task runs here: second
opinions, reviews, web search, and reading files, images, and short video.
The script strips API keys, so the sign-in always pays. Antigravity (`agy`)
quota belongs to the owner's own sessions; use it only when the user asks.
2. **Gemini API credits** through `scripts/gemini.py` and `GEMINI_API_KEY`, only
for what the CLI cannot do: Veo video, Lyria music, and speech. `ask` and
`batch` refuse to send (exit 5) without `--use-api-credits`; pass it only
when the owner asks.
3. **Colab compute units** through `scripts/colab_job.py` and the `colab` CLI
on the gcloud sign-in: batch GPU jobs (fine-tunes, video-to-3D motion, open
image, audio, and 3D models, transcription). See `references/colab-lane.md`.
## Three budgets: know which one pays
| Budget | Reached through | Costs real money? |
|---|---|---|
| Gemini CLI quota (Google sign-in) | `second_opinion.py`, `gemini -p` | No: the plan covers it; at the limit the CLI errors |
| Antigravity quota | `agy -p`, only when the user asks | No; the owner uses it fully, so don't spend it unasked |
| Colab compute units (2,000 a month, 90-day rollover, plan manager only) | `colab_job.py` | No; at zero, jobs stop starting |
| Monthly Cloud / Gemini API credits ($100 on Ultra 20x, valid 12 months) | `gemini.py` with a key from the credited project | No, until they run out |
| Paid billing on the same project | `gemini.py` after credits run out | **Yes, silently** |
Credits apply only after the owner redeems them in Google AI Studio (turn on
"Auto apply future offers"), and only to keys in that billing project. No API
reports the remaining balance: the owner checks AI Studio or Cloud billing.
**Stop rule:** before a run of paid generation (more than 3 Veo shots, more than
10 music tracks, or any batch over 500 requests), tell the user the count and
ask them to confirm the credit balance.
## When to route here
Use Gemini when the task needs it, not as a default:
| Need | Lane |
|---|---|
<!-- ‹guest · 2026-12-05› -->
| Independent review, plan, or second opinion | `second_opinion.py "..." --cwd REPO`: `references/cli-lanes.md` |
| Watch: gameplay capture, trailer, mocap clip (shrink large video first) | `second_opinion.py "..." --file clip.mp4` |
| Fresh web facts with sources | `second_opinion.py "Search the web: ... cite the URLs"` |
| Read pages named in the prompt | `second_opinion.py "Read <url> and ..."` |
| Long inputs (PDFs, logs, doc sets) | `second_opinion.py "..." --file a.pdf --file b.pdf` |
| Structured output | `second_opinion.py "... Reply only with JSON matching: <schema>" --json` |
| Video: trailer shots, reference motion, mannequin masters | `gemini.py video "..." --out shot.mp4 --yes` |
| Music: themes, loops, stingers | `gemini.py music "..." --out theme.wav --yes` (`--clip` for 30 s loops) |
| Spoken lines: NPC barks, narration, temp VO | `gemini.py speech "..." --voice Kore --style "..." --out line.wav` |
| GPU job: LoRA fine-tune, video-to-3D motion, open image/audio/3D model, transcription | `colab_job.py job.py --gpu L4 --yes`: `references/colab-lane.md` |
| Many independent prompts | Loop `second_opinion.py`; `gemini.py batch --use-api-credits` only when the owner asks |
## Workflow
1. **Keep secrets out.** These lanes are the user's own AI services, so
sending prompts, code, and files to them is ordinary use, not third-party
egress; don't stop to ask approval for it. Never send secrets,
credentials, `.env` files, or other people's personal data. The scripts
refuse secret-looking names and credential directories; content is your
call.
2. **Run Neon on the sign-in.** `second_opinion.py` defaults to
`gemini-4-neon`; change the model only when the owner names another.
3. **Check model ids.** When a default 404s, run `gemini.py models --filter
<family>` and pass `--model`, or set the `GEMINI_*_MODEL` env vars.
4. **Preview paid calls.** `video`, `music`, and `batch submit` print the
request and exit 3 until you add `--yes`. Make one Veo shot, review it, then
scale.
5. **Run, then verify the artifact.** Probe what came back (`ffprobe` for
media, read the text). Report the path, the model, and the budget that paid.
6. **Keep outputs out of repos** unless the user wants them committed; large
media goes to the project's cold or artifact storage. `--out` never
overwrites without `--force`.
## Hard rules
- Read the key only from the environment. Never print it, log it, or put it on
a command line or in a URL.
- Never claim a benefit was used when the call failed; report the error text.
- Label generated media as AI-made in any report or asset manifest.
- Benefits with no API (Flow, Project Genie, Photos Remix, NotebookLM, Gmail AI
<!-- ‹guest · 2026-12-05› -->
Inbox, Chrome auto browse) are owner-run tools: hand the user a ready prompt
or file. Never script a browser through them.
## Errors
| Error | Action |
|---|---|
| Exit 2, no key | Ask the user for a `GEMINI_API_KEY` from the credited AI Studio project |
| Exit 3 | Paid call without `--yes`: confirm with the user, then re-run |
| HTTP 403 or 429 on Veo or Lyria | No billing or credits on the key's project; point the user to AI Studio |
| HTTP 404 model | `models --filter`, retry with a listed id |
| "no answer: SAFETY" or no video samples | Rewrite the prompt without real people, brands, or violence |
| Veo still rendering at timeout | `gemini.py video --resume <operation> --out shot.mp4` |
| `second_opinion.py` exit 4 (sign-in needed) | Tell the user to run `env -u GEMINI_API_KEY NO_BROWSER=true gemini` once and choose Login with Google; never fall back to the API key |
| `second_opinion.py` "Base64 decoding failed" | The file is too large for the CLI upload; shrink it (`ffmpeg -t 10 -vf scale=320:-2 -an`) and retry |
| `colab_job.py` exit 3 | Plan only: show the plan, then re-run with `--yes` |
| `colab_job.py` exit 6, or `colab usage` shows active assignments | A session is still running: `colab --auth=adc sessions`, then `colab --auth=adc stop -s NAME` |
| `colab` 401 or 403 | Re-run the gcloud sign-in in `references/colab-lane.md` |
| `gemini.py` exit 5 | Text work belongs on `second_opinion.py`; use `--use-api-credits` only when the owner asks |
| `gemini` not installed (exit 2) | `npm install -g @google/gemini-cli`, or skip the lane and say so |
## References
| Signal | Load |
|---|---|
| Running a second opinion or parallel lane through Antigravity or the Gemini CLI | `references/cli-lanes.md` |
| Choosing which Ultra benefit fits a task, or the user asks what the plan includes | `references/benefits-map.md` |
| Running a GPU job on Colab | `references/colab-lane.md` |
| Writing Veo, Lyria, or speech prompts | `references/media-prompts.md` |
## Tests
`scripts/tests/test_google_ultra_gemini.py` in the toolkit repo: offline tests
for request shapes, dry runs, the paid-call gate, secret refusal, redirect key
stripping, overwrite guard, and audio decoding. They send nothing.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.