Rewrite a text in a voice
POST /v1/rewrite writes a text again in a voice, so it sounds like the person. It keeps the text's facts and adds none, checks the version, fixes what the check flags and answers what it still flags.
Send text the person wrote. It costs Letra writes, one per started 1,000 words returned.
Request
curl https://letralayer.com/api/v1/rewrite \ -H "Authorization: Bearer $LETRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"voice_ref":"user-42","channel":"linkedin","text":"We close early on Friday for the staff party."}'| Field | What it holds |
|---|---|
voice_ref or voice_id | Required. The voice: your own ref, or Letra's id. |
text | Optional. The text to write again, up to 5,000 characters. Left out, Letra writes its preview instead (below). |
channel | Optional. A channel slug of the voice. Left out: the base voice. |
char_limit | Optional. The most characters the version may have. 0 or left out: no limit. |
instruction | Optional. The task in your words, up to 2,000 characters, such as "shorter, lead with the time". |
count | Optional. How many versions, 1 to 12, none alike. Fewer may come back. |
context | Optional. Facts about the writer for this call, up to 8,000 characters. Never stored. |
avoid_repeating | Optional. Up to 12 texts the versions must not repeat. |
revise | Optional. false skips the fix after the check, for a task that must keep the writer's words. |
Answer
{ "text": "...", "texts": [ "..." ], "write_id": "6f1c...", "ai_generated": true, "letra_writes": 1, "channel": "linkedin", "check": { "clean": true, "tells": [], "revised": false }}textandcheckare the best version and its check;textsandcheckshold every version, best first.check.tellslists what still fails the check, andcheck.revisedwhether the fix replaced the first version.write_idis the receipt to send with a learn event about these texts.ai_generatedistrueon every text Letra's model wrote, short or long. Store it with the text and carry it on where you publish. Check a text against its receipt.
The preview
Without text, Letra writes one fixed neutral story in the voice, so a person can see how their voice reads. It runs only after the voice changed: otherwise 409 voice_unchanged. Each plan has its own preview runs; past them, 429 preview_limit.