← Blog

How to Build a Claude-Powered Product Description Generator

2026-11-02 · 5 min read · SubToAPI Team

What You're Actually Building

A Claude-powered product description generator is a small pipeline: you feed Claude structured product data (name, attributes, category, maybe a few bullet points), it returns polished marketing copy in your brand voice, and you push that copy into your store, CMS, or feed. The hard part isn't calling the model once — it's making the output consistent across thousands of SKUs, handling variants (tone, length, language), and keeping the whole thing cheap and fast enough to run on catalog updates.

This guide covers the practical build: prompt structure, batching strategy, handling product variants, and turning Claude into a reliable backend service rather than a one-off script.

Step 1: Define Your Input Schema

Before writing any prompt, lock down what data you actually have for each product. A loose schema leads to inconsistent output. A reasonable baseline:

{
  "name": "Aurora Wireless Earbuds",
  "category": "Audio > Headphones",
  "attributes": {
    "battery_life": "30 hours",
    "connectivity": "Bluetooth 5.3",
    "color": "Matte Black",
    "water_resistance": "IPX5"
  },
  "bullets": ["Active noise cancellation", "Touch controls", "Fast charging"],
  "tone": "premium, concise",
  "max_length_words": 120
}

Feeding Claude structured JSON instead of a vague sentence produces far more consistent descriptions, and it makes the prompt reusable across your entire catalog.

Step 2: Write a Prompt Template, Not a One-Off Prompt

Treat the prompt as code you version, not a string you tweak by hand each time. A solid template separates instructions (how to write) from data (what to write about):

You are a product copywriter for an e-commerce store.
Write a product description using only the facts provided. Do not invent
specifications, prices, or claims that aren't in the input.

Rules:
- Tone: {{tone}}
- Max length: {{max_length_words}} words
- Output plain text, no markdown, no headings
- Mention the top 2-3 attributes naturally, don't list them all
- End with a short call-to-action sentence

Product data:
{{product_json}}

Keep the "do not invent facts" instruction explicit — product copy is one of the few content types where hallucinated specifications create real legal and customer-trust problems (wrong battery life, wrong materials). Claude follows constraint instructions reliably when they're stated directly rather than implied.

Step 3: Call the API

Here's a minimal call using SubToAPI's chat endpoint, which wraps Claude behind a standard HTTPS API with an application key (sub_live_...) instead of managing provider credentials directly:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-3-5-sonnet",
    "max_tokens": 300,
    "messages": [
      {
        "role": "user",
        "content": "You are a product copywriter... [template above with product JSON filled in]"
      }
    ]
  }'

For a Node.js batch job that loops over a catalog export:

async function generateDescription(product) {
  const res = await fetch("https://api.subtoapi.app/v1/messages", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SUBTOAPI_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "claude-3-5-sonnet",
      max_tokens: 300,
      messages: [{ role: "user", content: buildPrompt(product) }],
    }),
  });
  const data = await res.json();
  return data.content[0].text;
}

The full request/response shape is documented at /docs/messages, and the /docs/quickstart walks through getting an API key set up.

Step 4: Handle Variants and Localization

Most catalogs need more than one description per product: short versions for search snippets, long versions for product pages, and localized versions for different markets. Instead of writing separate prompts for each, parameterize the template:

Run these as separate calls rather than asking Claude to return all variants in one response. Separate calls are easier to retry individually when one variant fails validation, and they keep token usage per request predictable.

Step 5: Validate Before Publishing

Never pipe Claude's output straight to your live store. Add a validation layer:

This is the difference between a demo and a production content pipeline.

Step 6: Batch and Rate-Limit Properly

Generating descriptions for 5,000 SKUs in one burst will hit rate limits regardless of provider. Process in batches of 10-20 concurrent requests with a queue, and add retry logic with backoff for transient failures. If you're running this as a recurring job (e.g., nightly for new or updated products), log token usage per run so you can track cost over time — SubToAPI's dashboard exposes usage metadata per key, which is useful for attributing spend to this specific job if you're running multiple Claude-powered tools from one account. Pricing details are on /pricing.

Step 7: Wire It Into Your Workflow

Once the generation and validation logic work, the integration point is usually one of:

Keep the generator stateless — it takes product data in, returns text out. All state (what's been generated, what's pending review) lives in your own database, not in the API layer.

Should You Use Claude Directly or Through an API Wrapper

If you're already a Claude subscriber and want to avoid setting up separate provider billing, a service like SubToAPI turns your existing access into a standard HTTPS API with API keys, streaming support (/docs/streaming), and tool use (/docs/tools) if you later want Claude to pull live inventory data before writing copy. Plans start at Solo (€9), with Team (€19/seat) and Scale (€49/seat) tiers for larger catalogs with multiple contributors, and a free trial at /signup.

Questions

How long should a Claude-generated product description be? It depends on the channel. 40-60 words works for marketplace listings and search snippets; 100-150 words suits dedicated product pages. Pass the limit explicitly in your prompt rather than letting Claude decide.

How do I stop Claude from inventing product specifications? State explicitly in the prompt that it may only use facts present in the input data, and validate output against your source attributes before publishing. Vague instructions like "be accurate" are far less effective than "do not invent specifications not listed above."

Can I generate descriptions in multiple languages from one prompt? Yes — pass a language field in your input JSON and instruct Claude to write natively in that language rather than translating an English draft. Native generation per language typically reads more naturally than a translation step.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →