lucidity.sh platform
← All posts

Bulk Product Descriptions with Synth 2.5 Flash: Fact Checks, Google's AI Label and a Job You Can Restart

Generating ten thousand product descriptions costs about 21 cents. The work is in what surrounds the model: staying under the rate limit, catching invented facts, and labeling the text the way Google requires.

Short answer: send one product per request to synth-2.5-flash, starting a request about every 1.1 seconds. Give the model a list of facts and reject any reply that contains a number or a risky claim that isn't on it. Write results to a file as they arrive so a crash costs you nothing. If the text goes to Google Merchant Center, put it in structured_description with trained_algorithmic_media, and make sure no plain description is sent for the same product, because Google uses that one when it gets both.

Why Flash, and what it costs

Synth 2.5 is a creative-writing model line, and short product copy suits it. For batches, use Flash. Synth 2.5 Pro allows 5 requests per minute across all callers, so a batch sent to Pro is mostly answered by Flash through automatic fallback anyway, and it takes Pro slots from your interactive users on the way.

These figures assume 250 input and 130 output tokens per product. Flash times use the pace in the script below. Pro times are a best case with nobody else using it.

ProductsFlash costFlash timePro costPro time
1,000$0.02About 18 minutes$0.053 hours 20 minutes
10,000$0.21About 3 hours$0.5133 hours
100,000$2.05About 31 hours$5.10About 14 days

Time is the limit here, so plan around it. The chat completions route accepts 60 requests a minute, counted by network address and not by API key. More keys won't speed it up.

Flash has one weakness that shapes the design. Its model card says it is "incapable of following deep prompts that require heavy, specific formatting". So don't ask it for JSON, bullet lists, or five fields at once. Ask for one plain paragraph, and let your code build the structure.

Start from facts, not from a product page

Give the model a short list of facts per product and nothing else. One product per line keeps the input easy to check:

{"id":"KT-120","title":"Fellside 1.2 litre kettle","facts":["1.2 litre capacity","brushed steel body","stay-cool handle","lifts off a corded base"]}
{"id":"KT-170","title":"Fellside 1.7 litre kettle","facts":["1.7 litre capacity","brushed steel body","removable limescale filter"]}
  • Facts come from your own records: the product database, the supplier's spec sheet, the packaging. If nobody can point to the source of a fact, leave it out.
  • Leave prices and offers out of the list. They change, and Google doesn't want them in a description. That matters most in a sale week, when someone will ask for "Black Friday" in the copy.
  • Thin facts give thin copy. With two facts and a 50-word minimum, the model has to pad, and padding is where inventions come from. Set products with fewer than three or four facts aside for a person.

Checks that run on every reply

Google's own guidance on generative AI says these models "don't retrieve facts, but predict a likely sequence of words". A description of a kettle pulls toward what descriptions of kettles usually say. These checks need no second model:

Reject when the reply hasWhat it catches
finish_reason is not "stop"The reply hit max_tokens, so the last sentence is cut.
A number that isn't in the factsInvented sizes, capacities, hours and pack counts.
A risky claim word that isn't in the facts"Waterproof", "organic", "certified" and similar words you would have to prove.
Price, shipping or sale wordingGoogle wants these in their own attributes, not in the description.
Markup, a link or a line breakA prompt that got ignored, or a feed that will render badly.
Length outside 40 to 110 wordsEmpty replies, one-liners and rambling.

The number check is the most useful one for its size. Its blind spot is spelled-out numbers ("twelve hours") and claims without digits ("fits any worktop"). Edit the risky-word list for your category: a cosmetics shop and a toy shop have different lists. A reply that fails twice goes to a person, with the reasons attached.

The job

It needs Node 20 or later and no packages. The next three blocks are one file, bulk.mjs. First, the settings and the checks:

import { appendFileSync, existsSync, readFileSync } from 'node:fs'
import { createHash } from 'node:crypto'

const BASE = process.env.LUCIDITY_BASE ?? 'https://platform.lucidity.sh/v1'
const VERSION = 'desc-v1' // change it when the prompt changes, and items are redone
const PACE_MS = 1100      // one request start at a time, just under 60 a minute
const sleep = (ms) => new Promise((r) => setTimeout(r, ms))

const SYSTEM = `You write product descriptions for an online store.
Use only the facts you are given. Never add a material, size, certification, award or result that is not listed.
Write one plain-text paragraph of 50 to 90 words. No price, shipping, discounts or comparisons with other products.`

const RISKY = /\b(waterproof|non-?toxic|organic|eco-?friendly|hypoallergenic|guaranteed?|clinically|certified|medical|cures?|award|best|safest)\b/gi
const PROMO = /\b(free shipping|sale|discount|% off|buy now|order today|limited time)\b|[$€£]\s?\d/i
const numbers = (s) => s.match(/\d+(?:[.,]\d+)*/g) ?? []

export function check(text, product, finish) {
  const source = [product.title, ...product.facts].join('\n')
  const problems = []
  if (finish !== 'stop') problems.push(`finish_reason ${finish}`)
  const words = text.trim().split(/\s+/).length
  if (words < 40 || words > 110) problems.push(`${words} words`)
  if (/[<>*#]|https?:|\n/.test(text)) problems.push('markup, link or line break')
  if (PROMO.test(text)) problems.push('promotional text')
  const known = new Set(numbers(source))
  for (const n of numbers(text)) if (!known.has(n)) problems.push(`number not in facts: ${n}`)
  for (const [w] of text.matchAll(RISKY)) {
    if (!source.toLowerCase().includes(w.toLowerCase())) problems.push(`claim not in facts: ${w}`)
  }
  return problems
}

Next, the pacing and the API call. Every worker asks turn() for a start time, so four workers together still start only one request per 1.1 seconds. A 429 moves that shared clock, which slows all of them and not only the one that was refused:

let next = 0
async function turn() { // hand out start times 1.1 s apart, across all workers
  const at = Math.max(Date.now(), next)
  next = at + PACE_MS
  await sleep(at - Date.now())
}

async function write(product, tries = 5) {
  for (let i = 0; i < tries; i++) {
    await turn()
    const res = await fetch(`${BASE}/chat/completions`, {
      method: 'POST',
      signal: AbortSignal.timeout(55_000),
      headers: { Authorization: `Bearer ${process.env.LUCIDITY_API_KEY}`, 'Content-Type': 'application/json' },
      body: JSON.stringify({
        model: 'synth-2.5-flash', temperature: 0.8, top_p: 0.95, max_tokens: 220,
        messages: [
          { role: 'system', content: SYSTEM },
          { role: 'user', content: `Product: ${product.title}\nFacts:\n- ${product.facts.join('\n- ')}` },
        ],
      }),
    })
    if (res.ok) {
      const data = await res.json()
      const { message, finish_reason } = data.choices[0]
      return { text: message.content.trim(), finish: finish_reason, model: data.model, usage: data.usage }
    }
    if (![429, 500, 502].includes(res.status)) {
      const err = new Error(`HTTP ${res.status}`)
      err.fatal = [401, 402, 403].includes(res.status) // stop the whole run
      throw err
    }
    const wait = Number(res.headers.get('retry-after')) * 1000 || 2 ** i * 1000
    next = Math.max(next, Date.now() + wait) // slows every worker, not just this one
  }
  throw new Error('gave up after retries')
}

Last, the runner:

export async function run(input, output, workers = 4) {
  const lines = (f) => readFileSync(f, 'utf8').split('\n').filter(Boolean).map((l) => JSON.parse(l))
  const keyOf = (p) => createHash('sha256').update(JSON.stringify([VERSION, p.id, p.title, p.facts])).digest('hex')
  const done = new Set(existsSync(output) ? lines(output).filter((r) => r.status !== 'error').map((r) => r.key) : [])
  const queue = lines(input).filter((p) => !done.has(keyOf(p)))
  let stop = null
  const worker = async () => {
    for (let p; !stop && (p = queue.shift());) {
      const row = { key: keyOf(p), id: p.id }
      try {
        for (let attempt = 1; attempt <= 2; attempt++) {
          Object.assign(row, await write(p))
          row.problems = check(row.text, p, row.finish)
          row.status = row.problems.length ? 'review' : 'ok'
          if (row.status === 'ok') break
        }
      } catch (err) {
        if (err.fatal) { stop = err; return } // not logged, so the next run retries it
        Object.assign(row, { status: 'error', error: err.message })
      }
      appendFileSync(output, JSON.stringify(row) + '\n')
    }
  }
  await Promise.all(Array.from({ length: workers }, worker))
  if (stop) throw stop
}

if (process.argv[2]) await run(process.argv[2], process.argv[3])

Run it with node bulk.mjs products.jsonl out.jsonl. What happens when things go wrong:

  • It crashes, or you stop it: start it again. Products already in out.jsonl are skipped. The key covers the product's facts and the prompt version, so a product whose facts changed is written again and the rest are left alone.
  • Your balance runs out: a 402 stops the run at once. Top up and start it again.
  • A key is wrong or paused: the 401 also stops the run. It doesn't write ten thousand error rows.
  • A product times out or the model server keeps failing: it gets an error row and is tried again on the next run. A timed-out request may still have been billed; the streaming guide explains why.

If you run it for several customers, use one key per customer and keep the usage field from each row. The cost tracking guide has the rest.

Labeling the text for Google

Google Merchant Center has a rule many teams miss. Descriptions created with generative AI must be sent in structured_description, with digital_source_type set to trained_algorithmic_media and the text in content. AI-written titles use structured_title in the same way. Three details decide whether your label counts:

  • The plain attribute wins. If a product has both description and structured_description, Google says it only uses description. An old export that still sends it will hide your new text.
  • The default is "not AI". Leave digital_source_type out and Google treats the value as default, which means no generative AI was used.
  • The limit is 5,000 characters for a description and 150 for a title. Longer text is cut off with a warning.

This script writes the labeled part of the feed from the rows a person has approved:

import { readFileSync, writeFileSync } from 'node:fs'

const rows = (f) => readFileSync(f, 'utf8').split('\n').filter(Boolean).map((l) => JSON.parse(l))
const xml = (s) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')

// The last row per product, and only if a person has copied that row into approved.jsonl.
const latest = new Map(rows('out.jsonl').map((r) => [r.id, r]))
const approved = new Set(rows('approved.jsonl').map((r) => r.key))
const items = [...latest.values()].filter((r) => approved.has(r.key) && r.text)

writeFileSync('descriptions.xml', `<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0"><channel>
<title>Descriptions</title><link>https://shop.example/</link><description>AI-written descriptions</description>
${items.map((r) => `<item>
  <g:id>${xml(r.id)}</g:id>
  <g:structured_description>
    <g:digital_source_type>trained_algorithmic_media</g:digital_source_type>
    <g:content>${xml(r.text)}</g:content>
  </g:structured_description>
</item>`).join('\n')}
</channel></rss>
`)
console.log(`${items.length} of ${latest.size} products written`)

The output has only the product ID and the description. Merge it into your main feed, which carries the price, link, image and the other required attributes. In a tab-separated feed the same value is written trained_algorithmic_media:"Your text", with the text in double quotes if it contains a colon.

Google also says what to leave out: price, sale dates, shipping, your company name, comparisons with other products, HTML, all-caps emphasis and links. The text should match the product on your landing page. If you sell in the EU, the label on your feed is separate from the AI Act's marking duty; see our Article 50 guide.

How much to read by hand

Google tells site owners to "manually factcheck and review all AI-generated content" before publishing. For a small catalog, do that. For a large one, decide what you will read and write it down:

  • Read every row marked review. They are the ones with a known problem.
  • Read all of the risky categories: anything for children, anything people eat or put on skin, anything electrical, anything with a safety or health claim.
  • Read a random sample of the rest. If you read 300 at random and find no factual error, you can be about 95% confident the true rate is under 1% (the rule of three: 3 divided by 300). On 100,000 products, 1% is still 1,000 wrong descriptions, so pick the sample size with that in mind.
  • One error means look for its family. If the model called one steel kettle "rustproof", search every row for the word, add it to the list, change VERSION and run the affected products again.

Copy the rows you accept from out.jsonl into approved.jsonl. Nothing else reaches the feed.

On search: Google's spam policy on scaled content is about many pages made mainly to manipulate rankings, with little value, "no matter how it's created". Its examples include using generative AI to make many pages without adding value. Better text on products you really sell isn't that. A thousand near-identical pages for color names might be.

Who answers for a false claim

You do. In the US, the FTC's advertising guide says advertisers "must have evidence to back up their claims", and that they need it before the ad runs. It says ad agencies can be held responsible too, and must check the claims independently. If you write copy for other shops, that includes you. "The model wrote it" isn't evidence. The facts list is, which is a good reason to store it next to each description. For catalogs of other companies' products, the guide says to stick to claims that can be supported and not to embellish what the manufacturer says. A model asked for lively copy will embellish, so treat supplier claims about health, safety or performance as unproven until you have seen the proof.

Synth's model cards also say the models can produce harmful or NSFW text and recommend a moderation layer. A kettle is unlikely to trigger it. Product titles typed in by marketplace sellers are another matter, since they go straight into your prompt, so screen those before and after. Our guide to writing moderation policies covers the rules to use.

Product description FAQ

How much does it cost to write 10,000 product descriptions with Synth 2.5?

About $0.21 on Synth 2.5 Flash and $0.51 on Synth 2.5 Pro, assuming 250 input and 130 output tokens each. Flash costs $0.03 per million input tokens and $0.10 per million output tokens; Pro costs $0.10 and $0.20. Retries add to that, because every attempt that gets an answer is billed.

Do I have to tell Google that a product description was written by AI?

Yes, in your Merchant Center product data. Google says descriptions created with generative AI must use the structured_description attribute, with digital_source_type set to trained_algorithmic_media. AI-written titles use structured_title the same way.

What happens if I send both description and structured_description?

Google says it will only use the plain description attribute. If an old feed still sends description for the same product, your labeled AI text is ignored, so remove one before adding the other.

How fast can I run a batch on Synth 2.5 Flash?

Plan for a little under one request per second. The chat completions route allows 60 requests per minute, counted by network address and not by key, so you may see a 429 sooner. Wait for the Retry-After header when you do. Synth 2.5 Pro also has a limit of 5 requests per minute shared by all callers.

Will Google penalize AI-written product descriptions?

Not for being AI-written. Google's spam policy is about many pages made mainly to manipulate rankings that add little value, however they are created. Descriptions built from real product facts, checked and reviewed, are a different thing from pages spun up around keywords.

How we tested

On November 24, 2026 we ran these scripts against the platform's gateway code on a local machine, with a stand-in model server scripted to return good text, invented claims, cut-off replies and errors. A 64-product run passed or flagged each reply as designed, a restart skipped the finished rows, a bad key stopped the run, and with the pacing turned off the job hit the 60-per-minute limit, waited and finished. The feed parsed as valid XML. The stand-in isn't Synth, so this says nothing about how often Synth invents facts. Measure that on your own catalog.

Sources

Make a key, run ten products, and read all ten before you run the rest. Prepaid, per token, no monthly fee.

Create an account