✅ BenefitsDigital MarketingIntermediate✨ AI-assisted

Benefits of Gemini 3.8 Flash for Ad Creative Review

WittyTech Daily··5 min read
#gemini#ad review#structured output#batch api

Your brand book runs 60 pages, your designers ship 40 banners a week, and someone still parks the logo too close to the edge. Gemini ad creative review hands that repetitive check to a model: give Gemini 3.8 Flash the guideline PDF and the creative, and get back JSON that says pass, fail or send to a human.

Gemini ad creative review in one API call

Per the Gemini 3.8 Flash model page, the model takes text, images, video, audio and PDFs, with a 1,048,576-token input limit and structured outputs supported. The call below sends a PDF, one image and an instruction, and forces the reply to match a schema. It uses the Interactions API, which Google's docs recommend for new projects.

import base64
from typing import Literal

from google import genai
from pydantic import BaseModel, Field

client = genai.Client()


class CreativeReview(BaseModel):
    verdict: Literal['pass', 'fail', 'needs_human']
    violated_rules: list[str] = Field(description='Guideline section or rule name for each violation')
    evidence: list[str] = Field(description='What in the creative breaks each rule')
    suggested_fix: str


def b64(path: str) -> str:
    with open(path, 'rb') as f:
        return base64.b64encode(f.read()).decode('utf-8')


interaction = client.interactions.create(
    model='gemini-3.8-flash',
    input=[
        {'type': 'document', 'data': b64('brand-guidelines.pdf'), 'mime_type': 'application/pdf'},
        {'type': 'image', 'data': b64('spring-sale-banner.jpg'), 'mime_type': 'image/jpeg'},
        {'type': 'text', 'text': 'The PDF is our brand guideline. Review the image ad against it. '
                                 'Return fail if any rule is broken and needs_human if the rules do not '
                                 'clearly cover the case. Cite the rule for every violation.'},
    ],
    response_format={
        'type': 'text',
        'mime_type': 'application/json',
        'schema': CreativeReview.model_json_schema(),
    },
)

review = CreativeReview.model_validate_json(interaction.output_text)
print(review.verdict, review.violated_rules)

The schema is flat on purpose, which keeps it inside the supported JSON Schema subset. Inline data counts toward a 20 MB request limit, so for a heavy brand book upload it once with the Files API and reuse the reference (uploads are stored for 48 hours).

brand_book = client.files.upload(file='brand-guidelines.pdf')
guideline_part = {'type': 'document', 'uri': brand_book.uri, 'mime_type': brand_book.mime_type}

Put guideline_part first in input in place of the inline document.

Benefits of Gemini 3.8 Flash for creative review

1. The rulebook and the ad are read together. You skip the text-extraction and chunking pipeline: the PDF goes in as a PDF. The document processing docs put a page at 258 tokens, so a 60-page guideline is 15,480 tokens, about 1.5% of the context window.

2. The verdict is structured, so it can be routed. fail opens a ticket, needs_human goes to a reviewer queue, pass moves on. The structured output docs warn that schema-valid output can still be semantically wrong, so keep the needs_human exit and spot-check the passes.

3. A review costs about a cent and a half. Assume the 60-page guideline (15,480 tokens), a 960x540 banner (6 tiles at 258 tokens, so 1,548), about 400 tokens of instructions and 500 output tokens including thinking. That is roughly 17,500 input tokens at $0.75 per million plus 500 output tokens at $3.75 per million: about $0.015 per ad. At today's rates, 1,000 ads cost about $15. Thinking tokens bill as output, and the minimal thinking setting is not supported, so you cannot switch thinking off.

The Batch API is priced at 50% of standard with a 24-hour target turnaround, which suits a weekly sweep of finished creatives. That drops 1,000 ads to about $7.50.

import time

from google import genai
from google.genai import types

client = genai.Client()

# one line per ad: a key plus a GenerateContentRequest under request
uploaded_file = client.files.upload(
    file='ad-review-requests.jsonl',
    config=types.UploadFileConfig(display_name='ad-review-requests', mime_type='jsonl'),
)

batch_job = client.batches.create(
    model='gemini-3.8-flash',
    src=uploaded_file.name,
    config={'display_name': 'weekly-ad-review'},
)

done = {'JOB_STATE_SUCCEEDED', 'JOB_STATE_FAILED', 'JOB_STATE_CANCELLED', 'JOB_STATE_EXPIRED'}
while batch_job.state.name not in done:
    time.sleep(30)
    batch_job = client.batches.get(name=batch_job.name)

if batch_job.state.name == 'JOB_STATE_SUCCEEDED':
    results = client.files.download(file=batch_job.dest.file_name)

Batch currently works only with the generateContent API, so each request line uses that format, with response_mime_type and response_schema in its config. Jobs that wait or run past 48 hours expire with no results.

4. Video and audio use the same endpoint. The model page lists video and audio as inputs, so a 15-second spot can go through the same schema: is the logo on the end card, is the required disclaimer spoken. Nothing on the model page measures review accuracy, so replay last quarter's rejected ads before you trust it.

5. Search grounding can check the claims. A line like "number one in customer satisfaction" is not in your brand book, but search grounding is supported. Paid tiers include 5,000 free grounding requests a month, then $14 per 1,000. Combining structured outputs with built-in tools is in preview, and the free tier has no grounding for this model.

When Gemini ad creative review is not worth it

Prices double on January 1, 2027, per the pricing page: standard input goes from $0.75 to $1.50 per million tokens and output from $3.75 to $7.50, with batch at half those rates. The review above becomes about 3 cents, or 1.5 cents in batch, so 1,000 ads a month cost $30 or $15.

That will not break a budget, so the better reasons to skip are low volume (at a dozen ads a week, a person with the book is quicker than building and tuning this), subjective rules like "feels premium", and regulated claims that need legal sign-off whatever the model says. To prototype, standard usage is free on the free tier, though batch and grounding are not.

A reviewer that returns routable JSON at a per-ad cost you can calculate is what turns a model demo into a check you can run on every creative before it ships.

← More in Digital Marketing