cookbook · Restyler · CMS and catalogue copy
Restyle a batch of product descriptions
Product catalogues are full of short, templated, AI-written descriptions. Send several in one request, one per paragraph, and the response comes back with the same paragraphs in the same order plus a status for each. This recipe sends four entries, splits the result back into entries, and flags the ones that came back unchanged so you know which to leave alone or write by hand.
Request
POST /v1/restyle, documented in the Restyler reference.
curl https://meragpt.com/v1/restyle \
-H "Authorization: Bearer $MERAGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "restyler-1",
"text": "Introducing our premium stainless steel water bottle, meticulously crafted to elevate your hydration experience. Holds 750 ml and keeps drinks cold for 24 hours.\n\nOrganic cotton tee.\n\nThis versatile and stylish backpack seamlessly combines form and function, featuring a padded 16-inch laptop sleeve, two side pockets and a water-resistant base, making it the perfect companion for your daily adventures.\n\nUnlock unparalleled comfort with our ergonomic office chair, designed to support you through every workday. Adjustable seat height from 42 to 54 cm, breathable mesh back, five-year warranty."
}'What came back
The real output from running this recipe, unedited.
{
"text": "Introducing our premium stainless steel water bottle, meticulously crafted to elevate your hydration experience. Holds 750 ml and keeps drinks cold for 24 hours.\n\nOrganic cotton tee.\n\nThis versatile and stylish backpack seamlessly combines form and function, with a padded 16-inch laptop sleeve, two side pockets and a water-resistant base making it the perfect companion for your daily adventures.\n\nUnleash unmatched comfort with our ergonomic office chair that’s designed to support you through every workday. Adjustable seat height from 42 to 54 cm, breathable mesh back, five-year warranty.",
"blocks": [
{
"index": 0,
"words": 24,
"status": "rewritten"
},
{
"index": 1,
"words": 3,
"status": "rewritten"
},
{
"index": 2,
"words": 32,
"status": "rewritten"
},
{
"index": 3,
"words": 28,
"status": "rewritten"
}
],
"rewritten": 4,
"total": 4,
"usage": {
"input_tokens": 142,
"output_tokens": 123,
"total_tokens": 265,
"cost_usd": "$0.000025"
}
}Python
import os, requests
API = "https://meragpt.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MERAGPT_API_KEY']}"}
entries = [
"Introducing our premium stainless steel water bottle, meticulously crafted to elevate your hydration experience. Holds 750 ml and keeps drinks cold for 24 hours.",
"Organic cotton tee.",
"This versatile and stylish backpack seamlessly combines form and function, featuring a padded 16-inch laptop sleeve, two side pockets and a water-resistant base, making it the perfect companion for your daily adventures.",
"Unlock unparalleled comfort with our ergonomic office chair, designed to support you through every workday. Adjustable seat height from 42 to 54 cm, breathable mesh back, five-year warranty.",
]
r = requests.post(f"{API}/restyle", headers=HEADERS, json={"model": "restyler-1", "text": "\n\n".join(entries)}).json()
rewrites = r["text"].split("\n\n")
for entry, new, block in zip(entries, rewrites, r["blocks"]):
same = new.strip() == entry.strip()
print(block["status"], "(word for word)" if same else "", "-", new)
TypeScript
const API = "https://meragpt.com/v1";
const headers = {
Authorization: `Bearer ${process.env.MERAGPT_API_KEY}`,
"Content-Type": "application/json",
};
const entries = [
"Introducing our premium stainless steel water bottle, meticulously crafted to elevate your hydration experience. Holds 750 ml and keeps drinks cold for 24 hours.",
"Organic cotton tee.",
"This versatile and stylish backpack seamlessly combines form and function, featuring a padded 16-inch laptop sleeve, two side pockets and a water-resistant base, making it the perfect companion for your daily adventures.",
"Unlock unparalleled comfort with our ergonomic office chair, designed to support you through every workday. Adjustable seat height from 42 to 54 cm, breathable mesh back, five-year warranty.",
];
const r = await fetch(`${API}/restyle`, {
method: "POST",
headers,
body: JSON.stringify({ model: "restyler-1", text: entries.join("\n\n") }),
}).then((res) => res.json());
const rewrites: string[] = r.text.split("\n\n");
entries.forEach((entry, i) => {
const same = rewrites[i].trim() === entry.trim();
console.log(r.blocks[i].status, same ? "(word for word)" : "", "-", rewrites[i]);
});
When to trust it
All four paragraphs report "rewritten", but two of them came back word for word: the water bottle and the three-word "Organic cotton tee." A one-line entry gives the model nothing to change, so compare each entry with its rewrite rather than relying on the status alone. A paragraph can also come back with status "unchanged" on purpose, when it is too short or when a rewrite would have lost a fact; treat those as finished, not failed. The chair's "Unlock unparalleled comfort" became "Unleash unmatched comfort", still marketing-speak, so review hero copy by eye.
Try it without code in the playground, or see more Restyler recipes: restyle a draft, then check the numbers, clean up your own draft with strict mode, rewrite release notes without losing a version number.