{"slug": "predictable-ai-spend-in-bigquery-introducing-cost-management-for-generative-ai", "title": "Predictable AI spend in BigQuery: Introducing cost management for generative AI functions", "summary": "Google announced general availability of token-based cost management for BigQuery generative AI functions, adding four daily quotas managed through the Google Cloud Identity and Access Management (IAM) quota system at the project and per-user levels. The default limits are 200 billion AI input tokens per day per project, 150 billion input tokens per day per project per user, 20 billion output tokens per day per project, and 15 billion output tokens per day per project per user, with output quotas counting reasoning (\"thinking\") tokens. The quotas apply to AI.GENERATE, AI.GENERATE_TABLE, AI.GENERATE_TEXT (and alias ML.GENERATE_TEXT), AI.CLASSIFY, AI.IF, AI.SCORE, and AI.AGG, but not to embedding functions such as AI.GENERATE_EMBEDDING, ML.GENERATE_EMBEDDING, or AI.EMBED.", "body_md": "The [generative AI functions in BigQuery](https://docs.cloud.google.com/bigquery/docs/generative-ai-overview) (`AI.GENERATE`, `AI.IF`, `AI.CLASSIFY`, `AI.SCORE`, and more) bring large language models (LLMs) directly into your SQL, so a single query can classify millions of support tickets or score each product review for sentiment. However, because these functions are billed by the token, scaling them across massive datasets highlights the importance of managing your budget proactively. \n\nWe recently announced the general availability (GA) of **token-based** **cost management** **for BigQuery generative AI functions**: daily quotas that let administrators set self-serve guardrails on AI token consumption, so teams can innovate while staying within your budget. In this blog, we provide an overview of cost management for BigQuery generative AI functions, walk through a few practical examples, and share resources to help you get started. Let’s jump in.  \n\nFour daily quotas, managed through the Google Cloud Identity and Access Management (IAM) quota system, provide controls at the **project** level and the **per-user** level. Per-user limits apply to each user within a project, not across your organization.\n\n| **Quota name** | **Metric** | **Scope** | **Default value** | \n|---|---|---|---|\n| **AI input tokens per day** | Input tokens used by the LLM | Per day, per project | 200 billion | \n| **AI input tokens per day per user** | Input tokens used by the LLM | Per day, per project, per user | 150 billion | \n| **AI output tokens per day** | Output and thinking tokens used by the LLM | Per day, per project, per project | 20 billion | \n| **AI output tokens per day per user** | Output and thinking tokens used by the LLM | Per day, per project, per user | 15 billion | \n\nKey details:\n\n**The quotas are global.** Usage is summed across all regions, so costs can't pile up unnoticed in a region you weren't watching.\n\n**Output quotas include \"thinking\" tokens.** Reasoning tokens count toward your output quota, just as they count toward your Gemini platform bill.\n\nThe quotas apply to these BigQuery functions that perform LLM-backed generation:\n\n`AI.GENERATE`\n\n`AI.GENERATE_TABLE`\n\n[`AI.GENERATE_TEXT`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-generate-text) (and its alias [`ML.GENERATE_TEXT`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-generate-text))\n\n`AI.CLASSIFY`\n\n`AI.IF`\n\n`AI.SCORE`\n\n`AI.AGG`\n\n**What's not covered:** Embedding functions such as [`AI.GENERATE_EMBEDDING`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-generate-text) (also available as [`ML.GENERATE_EMBEDDING`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-generate-embedding)) and [`AI.EMBED`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-embed) are not subject to these quotas, because they run on different, substantially cheaper models.\n\nAdministrators can view and adjust the quotas directly in the [Google Cloud console](https://docs.cloud.google.com/bigquery/docs/control-genai-costs) as workloads change, with no support case required.\n\nNavigate to **IAM & Admin →** [**Quotas & System Limits**](https://console.cloud.google.com/iam-admin/quotas/list).\n\nFilter by service and select **BigQuery API**.\n\nSort by the **Name** column to bring the four AI quotas to the top.\n\n4. Find the quota, for example **AI input tokens per day**.\n\n5. Open the three-dot menu and choose **Edit quota**.\n\nFrom there:\n\n**To tighten cost control,** lower a quota. This takes effect immediately with no approval needed.\n\n**To support higher usage,** request an increase from the same page. Many requests are auto-approved; larger increases may go through a quick review.\n\n**You'll need the right permissions.** You need one of: **Owner**, **Editor,** [**Quota Administrator**](https://docs.cloud.google.com/iam/docs/roles-permissions/servicemanagement#servicemanagement.quotaAdmin) (`roles/servicemanagement.quotaAdmin`), or [**Service Usage Admin**](https://docs.cloud.google.com/iam/docs/roles-permissions/serviceusage#serviceusage.serviceUsageAdmin) (`roles/serviceusage.serviceUsageAdmin`).\n\n**Prefer automation?** You can also [manage these quotas programmatically](https://medium.com/google-cloud/bigquery-ai-cost-guardrails-how-to-set-daily-token-limits-programmatically-02d7a35f843a) through the [Cloud Quotas API](https://docs.cloud.google.com/docs/quotas), the `gcloud` CLI, and Terraform to apply consistent guardrails across projects.\n\nBeyond setting limits, the [**Quotas & System Limits**](https://console.cloud.google.com/iam-admin/quotas/list) page displays your historical token consumption so you can quickly detect spikes and right-size your budgets. Use these trends to see how new generative AI workloads and data pipelines affect your overall token usage.\n\nFor a step-by-step walkthrough, see the BigQuery documentation on [controlling costs with token quotas](https://docs.cloud.google.com/bigquery/docs/control-genai-costs).\n\nToken quotas aren't the only cost guardrail in Google Cloud.\n\n[**Token quotas (this feature)**](https://docs.cloud.google.com/bigquery/docs/control-genai-costs) are preventive and AI-specific. BigQuery tracks token usage during query execution and stops work close to the limit, with separate limits per project and per user.\n\n**Cloud Billing** [**spend caps**](https://docs.cloud.google.com/billing/docs/how-to/budgets-spend-caps#eligible-services) operate on dollars at the project and service level and can automatically block usage when a threshold is reached. They're a broad, financial backstop rather than a precise usage control, and because enforcement is not instant, some overages are incurred.\n\nUse token quotas as your first line of defense for AI spend, and a spend cap as a project-wide safety net.\n\nQuotas are enforced by stopping work rather than letting a query run past your limit. A query is rejected up front with a `QuotaExceeded` error only if a quota it needs is already exhausted. Otherwise, it starts, and if a quota runs out mid-query, BigQuery stops sending new LLM calls:\n\n**Functions that support** **max_error_ratio**`AI.IF`) return partial results if unprocessed rows stay within the ratio, and otherwise fail.\n\n**General-purpose functions** (such as `AI.GENERATE`) still succeed. Skipped rows have no generated value, and their `status` field contains the quota-exceeded error.\n\nFor details, see [quota enforcement behavior](https://docs.cloud.google.com/bigquery/docs/control-genai-costs#quota_enforcement_behavior) in the documentation.\n\n`AI.COUNT_TOKENS`\nTo choose quota values, it helps to know how much text your workloads send to a model. The [`AI.COUNT_TOKENS`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-count-tokens) function helps with this.\n\n`AI.COUNT_TOKENS` returns the number of tokens a model's tokenizer produces for a text string, without making a billable generation call. Run it over a column to measure your input data:\n\nThe count is a lower bound on input tokens. It doesn't include output or thinking tokens, the instructions each AI function adds around your input, or non-text inputs such as images. Use it to:\n\n**Gauge the input side of a workload** before you launch it.\n\n**Right-size your quotas** together with a small sample run that measures actual input and output usage.\n\n**Translate tokens into dollars** using the published [Gemini platform pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing) for your model.\n\nSuppose you want to keep a project's daily AI spend around **$100** with the [Gemini 3.1 Flash-Lite](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-1-flash-lite) model. As of today's published pricing (BigQuery processes in batch which provides a 50% discount):\n\n**Input tokens:** $0.125 per 1 million tokens\n\n**Output tokens (response + reasoning):** $0.75 per 1 million tokens\n\nIf a small sample run shows an average **100:1 input-to-output token ratio**, you can solve for a daily budget:\n\nSolving gives about **754 million input tokens** and **7.54 million output tokens** per day. Set **AI input tokens per day** and **AI output tokens per day** to these values to hold the project near $100/day. If a project uses models with different prices, budget per model or blend the rates.\n\n**Start with per-user quotas.** They stop one user or runaway experiment from draining the project's budget.\n\n**Measure before you scale.** Use `AI.COUNT_TOKENS` to size your input, then check a small sample run in the usage chart before setting limits.\n\n**Mind the output side.** Output tokens cost more. Where a function accepts `max_output_tokens`, set it to bound generation length.\n\n**Monitor and iterate.** Adjust limits as real usage and budgets change.\n\nToken-based cost management is available now. To begin:\n\nOpen **IAM & Admin →** [**Quotas & System Limits**](https://console.cloud.google.com/iam-admin/quotas/list) in the Google Cloud Console and filter by **BigQuery API**.\n\nReview the four **AI-related** **token quotas** and set limits that match your budget.\n\nUse [`AI.COUNT_TOKENS`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-count-tokens) to size your input data.\n\nFor the full details, see the documentation on [controlling generative AI costs](https://docs.cloud.google.com/bigquery/docs/control-genai-costs).\n\nWith token-based guardrails in place, your teams can use generative AI in BigQuery with the cost predictability your organization needs.", "url": "https://wpnews.pro/news/predictable-ai-spend-in-bigquery-introducing-cost-management-for-generative-ai", "canonical_source": "https://cloud.google.com/blog/products/data-analytics/using-bigquerys-generative-ai-cost-management-features/", "published_at": "2026-10-14 16:00:00+00:00", "updated_at": "2026-10-15 05:02:08.211534+00:00", "lang": "en", "topics": ["ai-infrastructure", "large-language-models", "generative-ai", "mlops"], "entities": ["Google", "BigQuery", "Google Cloud Identity and Access Management", "AI.GENERATE", "AI.GENERATE_TABLE", "AI.GENERATE_TEXT", "AI.CLASSIFY", "AI.IF"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/predictable-ai-spend-in-bigquery-introducing-cost-management-for-generative-ai", "markdown": "https://wpnews.pro/news/predictable-ai-spend-in-bigquery-introducing-cost-management-for-generative-ai.md", "text": "https://wpnews.pro/news/predictable-ai-spend-in-bigquery-introducing-cost-management-for-generative-ai.txt", "jsonld": "https://wpnews.pro/news/predictable-ai-spend-in-bigquery-introducing-cost-management-for-generative-ai.jsonld"}}