Google introduces token-based cost management for BigQuery generative AI functions
Key point
Administrators can now set daily quotas on AI input and output tokens at both the project and per-user levels to prevent budget overruns.
Details
Google has announced the general availability of token-based cost management for BigQuery generative AI functions. This feature allows administrators to set daily quotas on AI token consumption, providing self-serve guardrails to keep teams within budget while using LLM-backed SQL functions like AI.GENERATE, AI.CLASSIFY, and AI.SCORE.
Quota Structure and Scope
Four daily quotas are managed through the Google Cloud Identity and Access Management (IAM) quota system, applying at the project and per-user levels. These quotas are global, summing usage across all regions to prevent unnoticed cost accumulation. Notably, output quotas include "thinking" tokens, aligning with Gemini platform billing.
| Quota name | Metric | Scope | Default value | | :--- | :--- | :--- | :--- | | AI input tokens per day | Input tokens used by the LLM | Per day, per project | 200 billion | | AI input tokens per day per user | Input tokens used by the LLM | Per day, per project, per user | 150 billion | | AI output tokens per day | Output and thinking tokens used by the LLM | Per day, per project | 20 billion | | AI output tokens per day per user | Output and thinking tokens used by the LLM | Per day, per project, per user | 15 billion |
Coverage and Enforcement
The quotas apply to LLM-backed generation functions including AI.GENERATE, AI.GENERATE_TABLE, AI.GENERATE_TEXT (and ML.GENERATE_TEXT), AI.CLASSIFY, AI.IF, AI.SCORE, and AI.AGG. Embedding functions like AI.GENERATE_EMBEDDING and AI.EMBED are excluded as they run on cheaper models.
Enforcement stops work rather than allowing queries to exceed limits. If a quota is exhausted, new LLM calls are halted. Functions supporting max_error_ratio may return partial results, while general-purpose functions succeed with skipped rows marked by a quota-exceeded error in the status field.
Management and Sizing Tools
Administrators can adjust quotas via the Google Cloud console under IAM & Admin → Quotas & System Limits or programmatically using the Cloud Quotas API, gcloud CLI, and Terraform. To help size these limits, the AI.COUNT_TOKENS function estimates input token counts without incurring generation costs. For example, a project aiming for $100/day in spend using Gemini 3.1 Flash-Lite (with batch discount) might set limits around 754 million input tokens and 7.54 million output tokens, assuming a 100:1 input-to-output ratio.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.