BigQuery’s AI token quotas can stop overspend—but not always the query result
Google’s new GA guardrails separate project and per-user budgets, yet quota exhaustion may produce successful jobs with skipped rows rather than an all-or-nothing failure.
Google Cloud has made token-based cost controls for BigQuery’s generative-AI SQL functions generally available. The useful part is not merely that administrators can set a ceiling. It is that the controls exist at two different scopes: an entire project and each user inside that project, with separate daily limits for input and output tokens. Output limits also count the model’s thinking tokens. Google Cloud
That gives platform teams a practical way to contain both aggregate spend and one runaway experiment. The quotas cover generation functions including AI.GENERATE, AI.GENERATE_TABLE, AI.GENERATE_TEXT, AI.CLASSIFY, AI.IF, AI.SCORE, and AI.AGG. Embedding functions are outside this control surface because Google says they use different, substantially cheaper models. Usage is aggregated globally rather than reset independently by region. Google Cloud
The important boundary is enforcement
These quotas are not an atomic transaction boundary for an AI-powered query. If a required quota is already exhausted, BigQuery rejects the query before it starts with QuotaExceeded. If the limit is reached during execution, however, BigQuery stops issuing new model calls rather than necessarily failing the entire job. Google Cloud
For functions with max_error_ratio, such as AI.IF, the query can return partial results when the share of unprocessed rows stays within the configured allowance. For general-purpose functions such as AI.GENERATE, the job can still report success while skipped rows contain no generated value and expose a quota error in their status field. Google Cloud
That behavior is sensible for large batch workloads: preserving completed calls avoids throwing away paid work. But it changes the application contract. A green query status does not prove that every row received an inference. Pipelines that publish classifications, summaries, or scores therefore need to inspect per-row status fields and decide whether to retry, quarantine, or reject an incomplete result set.
Defaults are ceilings, not budgets
Google’s published defaults are very high: 200 billion input tokens and 20 billion output tokens per project per day, with per-user defaults of 150 billion input and 15 billion output tokens inside each project. Administrators can lower quotas immediately through the Cloud console; increases may require review. Google Cloud
Google recommends sizing workloads with AI.COUNT_TOKENS, but calls that estimate a lower bound because it excludes output and thinking tokens, function-added instructions, and non-text inputs. The company’s worked example shows how a team targeting roughly $100 per day with Gemini 3.1 Flash-Lite and a measured 100:1 input-to-output ratio could set about 754 million input tokens and 7.54 million output tokens per day, using the pricing stated in the post. Google Cloud
The operational lesson is straightforward: set per-user quotas before broad rollout, measure a sample, and treat partial-row detection as part of correctness—not just billing hygiene.
sources
- Using BigQuery’s generative AI cost management featurescloud.google.com
comments · 0