How to Run Gemini 4 Argon in BigQuery AI Functions
Your data is already in BigQuery, so sending it to a model shouldn't mean exporting it anywhere. On October 13, 2026, the BigQuery release notes added gemini-4-argon to the generative AI functions as generally available. By the end of this guide you'll be running Gemini 4 Argon in BigQuery from SQL with AI.GENERATE and AI.AGG, you'll know which endpoint your query hits, and you'll have a cost estimate for a full table.
Gemini 4 Argon in BigQuery: pick the endpoint first
Pass the model name as the endpoint argument. If you forget it, AI.GENERATE falls back to gemini-3.5-flash-lite, a different model with a different bill.
These models run on multi-regional endpoints only; the generative AI overview says regional endpoints aren't supported. A short name like gemini-4-argon resolves from the region your query runs in:
usor a single US region: theusendpoint.euor a single EU region, excepteurope-west2andeurope-west6: theeuendpoint.- Everywhere else, including those two: the
globalendpoint.
Queries in asia-south1 must use the fully qualified global endpoint:
SELECT AI.GENERATE(
'Reply with one word: ready?',
endpoint => 'https://aiplatform.googleapis.com/v1/projects/<your-project-id>/locations/global/publishers/google/models/gemini-4-argon'
).result AS smoke_test;
The docs say not to use the global endpoint if you have data processing location requirements. By default the query runs with your end-user credentials. To use a Cloud resource connection instead, add connection_id => '<your-project-id>.<location>.<your-connection-id>'.
Run Gemini 4 Argon over a sample table
Don't point a new model at a billion rows. The AI.GENERATE reference recommends materializing the rows into a separate table first, which also gives you a fixed row count to price.
CREATE OR REPLACE TABLE `<your-project-id>.support.tickets_sample` AS
SELECT ticket_id, product_id, body
FROM `<your-project-id>.support.tickets`
WHERE body IS NOT NULL
LIMIT 1000;
SELECT
ticket_id,
AI.GENERATE(
CONCAT('Summarize in one sentence: ', body),
endpoint => 'gemini-4-argon'
).result AS summary
FROM `<your-project-id>.support.tickets_sample`;
result is NULL when a request fails or is filtered by responsible AI.
Return typed columns with output_schema
Free text is hard to join against. Give AI.GENERATE an output_schema and your fields replace result, next to full_response and status.
SELECT
ticket_id,
info.category,
info.is_urgent,
info.status
FROM (
SELECT
ticket_id,
AI.GENERATE(
body,
endpoint => 'gemini-4-argon',
output_schema => 'category STRING, is_urgent BOOL'
) AS info
FROM `<your-project-id>.support.tickets_sample`
);
Cap thinking with model_params
Thinking tokens are billed as output, and output is the expensive side. The Gemini 4 Argon model page lists low, medium and high thinking levels. The BigQuery docs say that for Gemini 3.0 and later, thinking_level replaces thinking_budget, and show it inside model_params:
SELECT
ticket_id,
AI.GENERATE(
CONCAT('Is this ticket about billing? Answer yes or no: ', body),
endpoint => 'gemini-4-argon',
model_params => JSON '{"generation_config":{"thinking_config":{"thinking_level":"LOW"}}}'
).result AS is_billing
FROM `<your-project-id>.support.tickets_sample`;
The docs don't describe Argon's default thinking behavior, so measure token counts on your sample rather than assuming.
Summarize groups with AI.AGG
AI.AGG takes a column and an instruction, and returns one value per group.
SELECT
product_id,
AI.AGG(
body,
'List the three most common complaints, one short phrase each.',
endpoint => 'gemini-4-argon',
max_error_ratio => 0.05
) AS top_complaints
FROM `<your-project-id>.support.tickets_sample`
GROUP BY product_id;
Output is capped at 10,000 tokens per group, and the docs recommend at most 1,000 distinct groups. With max_error_ratio => 0.05, the query fails if more than 5% of rows error, instead of quietly returning partial results.
Estimate a table-wide run before the Dec 1 price change
Three tools, in order:
AI.COUNT_TOKENSestimates input tokens and, per its reference, incurs no Vertex AI charge. It ignores thinking and output tokens, and the page doesn't list supported models, so treat the number as an estimate.- Run the sample, then open the job's Information pane. For Gemini models it shows input, output, thought and cache token counts.
- Multiply by (full rows / sample rows).
SELECT SUM(AI.COUNT_TOKENS(CONCAT('Summarize in one sentence: ', body), endpoint => 'gemini-4-argon').result) AS input_tokens
FROM `<your-project-id>.support.tickets_sample`;
For prices, the Gemini API pricing page lists Argon at $2.00 input and $10.00 output (thinking included) per 1M tokens through November 30, 2026. From December 1 it is $4.00 and $20.00. BigQuery bills these calls as Vertex AI usage plus query compute, so check the Google Cloud pricing page for the rate on your invoice.
A worked example at the Gemini API list rates: 100,000 rows at 500 input tokens each is 50M input tokens, and 300 output and thinking tokens each is 30M output tokens. That costs $100 + $300 = $400 through November 30, and $800 for the same run from December 1. Output is 75% of the bill, so a short answer format and a low thinking level are your cheapest levers.
Catch silent failures
Row-level errors return NULL and the query still succeeds with a warning. Materialize results once, then inspect them without paying for inference twice:
CREATE OR REPLACE TABLE `<your-project-id>.support.tickets_summarized` AS
SELECT
ticket_id,
AI.GENERATE(CONCAT('Summarize in one sentence: ', body), endpoint => 'gemini-4-argon') AS r
FROM `<your-project-id>.support.tickets_sample`;
SELECT COUNTIF(COALESCE(r.status, '') != '') AS failed_rows, COUNT(*) AS total_rows
FROM `<your-project-id>.support.tickets_summarized`;
Gotchas
- Omit
endpointand you getgemini-3.5-flash-lite, not Argon. - The global endpoint carries no data location guarantee.
asia-south1needs the fully qualified global endpoint.- AI.AGG batches input, so Gemini can receive more tokens than your source data contains.
- Vertex AI charges can take up to 24 hours to show in Cloud Billing. Filter by service and the
bigquery_job_id_prefixlabel.
Price a 1,000-row sample before the full table, because the same SQL costs twice as much after December 1 at the Gemini API list rates.