POST /api/identify-product
Builds the meta-prompt for a brand and viewer profile, sends it to Google Gemini, and returns the specific product SKU Gemini selected along with the prompt that was used./api/ai/identify-product is an alias for this endpoint. Both paths accept identical request bodies and return identical responses.Request body
The brand to advertise. Gemini infers the best-fitting specific product from the viewer context.
Viewer context. Accepts a JSON object or a freeform string describing the viewer (demographics, interests, region, etc.).
Prompt size. Must be
"full" or "minimal". "full" produces a detailed prompt; "minimal" produces a shorter one.Optional language for the output, e.g.
"English" or "Spanish".Optional tone guidance, legal constraints, or words to avoid. Applied when Gemini selects the product.
Response
The specific product SKU Gemini selected for this viewer profile, e.g.
"2025 Toyota RAV4 XLE Hybrid AWD".The meta-prompt that was sent to Gemini.
Example
Errors
| Status | Cause |
|---|---|
400 | brand_name is missing or empty. |
400 | mode is not "full" or "minimal". |
503 | GEMINI_API_KEY is not configured. |
502 | Gemini request failed. |