Read the Room

Public API

One endpoint. Send text and a room; get back the Qloo-grounded rewrite with every reference's affinity, the verified swaps, and the Room Score. Same rate limits as the site.

POST /api/v1/rewrite

curl -X POST https://YOUR-APP-URL/api/v1/rewrite   -H "Content-Type: application/json"   -d '{"text": "Mornings with Brewly feel like the opening of a Friends episode.", "room": "Austin, ages 25-34"}'

Response (abridged)

{
  "text": "Mornings with Brewly feel like the opening of a Friends episode.",
  "room": { "label": "Austin, ages 25-34", "locationQuery": "Austin", "ageBucket": "25_to_29,30_to_34" },
  "finalText": "…the sentence with verified swaps applied…",
  "llmOnlyText": "…the same text rewritten with no taste data…",
  "references": [{
    "id": "r1", "surface": "Friends", "start": 50, "end": 57,
    "entityId": "…", "entityName": "Friends", "entityType": "urn:entity:tv_show",
    "affinity": 0.05, "omitted": true, "status": "weak",
    "swap": { "entityName": "…", "affinity": 0.94, "sharedTags": ["…"],
              "originalSentence": "…", "rewrittenSentence": "…", "lengthDelta": 0.03, "accepted": true }
  }],
  "roomScoreBefore": 5, "roomScoreAfter": 94,
  "snapshot": { "tv_show": [{ "entityId": "…", "name": "…", "affinity": 0.99 }] },
  "qlooCalls": 6, "rounds": 1, "notes": [], "createdAt": "…"
}

Notes