cookbook · Restyler · Changelogs and customer updates
Rewrite release notes without losing a version number
Release notes are where a changed number does real damage: a wrong version, date or limit sends customers the wrong way. This recipe restyles a three-paragraph changelog and then checks, in code, that every number, link and email address in the draft is still in the rewrite.
The draft
We are excited to announce the release of version 2.4.1, which delivers a seamless and significantly improved experience for every team. CSV exports now complete up to 4x faster for workspaces with more than 50,000 rows, and scheduled exports can run as often as every 15 minutes. Furthermore, we have addressed a critical issue in version 2.4.0 where shared links created before 12 November 2026 could expire early. Affected links have been restored automatically, and the full details are available at https://example.com/changelog/2-4-1. Additionally, the API rate limit for the Pro plan has been raised from 600 to 1,200 requests per minute, effective immediately. As always, our support team is available at support@example.com should you require any assistance.
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": "We are excited to announce the release of version 2.4.1, which delivers a seamless and significantly improved experience for every team. CSV exports now complete up to 4x faster for workspaces with more than 50,000 rows, and scheduled exports can run as often as every 15 minutes.\n\nFurthermore, we have addressed a critical issue in version 2.4.0 where shared links created before 12 November 2026 could expire early. Affected links have been restored automatically, and the full details are available at https://example.com/changelog/2-4-1.\n\nAdditionally, the API rate limit for the Pro plan has been raised from 600 to 1,200 requests per minute, effective immediately. As always, our support team is available at support@example.com should you require any assistance."
}'What came back
The real output from running this recipe, unedited.
{
"text": "We’re excited to announce the release of version 2.4.1 which will provide a seamless and greatly improved experience for every team. CSV exports now complete up to 4x faster for workspaces with more than 50,000 rows and scheduled exports can run as often as every 15 minutes.\n\nAlso in version 2.4.0 we’ve fixed a critical issue where shared links that were created before 12 November 2026 could expire early. Those links have been restored automatically and the full details are at https://example.com/changelog/2-4-1.\n\nThe API rate limit for the Pro plan has also been increased from 600 to 1,200 requests per minute effective immediately. As always our support team are available at support@example.com if you need any help.",
"blocks": [
{
"index": 0,
"words": 47,
"status": "rewritten"
},
{
"index": 1,
"words": 35,
"status": "rewritten"
},
{
"index": 2,
"words": 35,
"status": "rewritten"
}
],
"rewritten": 3,
"total": 3,
"usage": {
"input_tokens": 203,
"output_tokens": 176,
"total_tokens": 379,
"cost_usd": "$0.000036"
}
}Python
import os, requests
API = "https://meragpt.com/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MERAGPT_API_KEY']}"}
import re
notes = open("release-notes.md").read()
r = requests.post(f"{API}/restyle", headers=HEADERS, json={"model": "restyler-1", "text": notes}).json()
# numbers, links and email addresses must all survive
facts = lambda s: set(re.findall(r"https?://\S+|[\w.+-]+@[\w.-]+\.\w+|\d+(?:[.,]\d+)*", s))
missing = {f.rstrip(".,") for f in facts(notes)} - {f.rstrip(".,") for f in facts(r["text"])}
if missing:
raise ValueError(f"lost in the rewrite: {missing}")
print(r["text"])
TypeScript
const API = "https://meragpt.com/v1";
const headers = {
Authorization: `Bearer ${process.env.MERAGPT_API_KEY}`,
"Content-Type": "application/json",
};
import { readFileSync } from "node:fs";
const notes = readFileSync("release-notes.md", "utf8");
const r = await fetch(`${API}/restyle`, {
method: "POST",
headers,
body: JSON.stringify({ model: "restyler-1", text: notes }),
}).then((res) => res.json());
// numbers, links and email addresses must all survive
const facts = (s: string) => new Set((s.match(/https?:\/\/\S+|[\w.+-]+@[\w.-]+\.\w+|\d+(?:[.,]\d+)*/g) ?? []).map((f) => f.replace(/[.,]$/, "")));
const kept = facts(r.text);
const missing = [...facts(notes)].filter((f) => !kept.has(f));
if (missing.length) throw new Error(`lost in the rewrite: ${missing.join(", ")}`);
console.log(r.text);
When to trust it
Every number, link and address survived here, and the check would have caught it if one had not. Read the result anyway for meaning, not just figures: the rewrite turned "addressed a critical issue in version 2.4.0" into "in version 2.4.0 we've fixed a critical issue", which reads as if the fix shipped in 2.4.0 rather than 2.4.1. It also kept the word "seamless". A check catches lost facts; a person catches shifted ones.
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, restyle a batch of product descriptions.