Persian editing
Not a translation. Send Persian text (AI copy, a literal translation, stiff prose, or plain ordinary copy) and get every sentence back written again in natural, fluent Persian, the way an Iranian writer would write it today, with the same meaning and the same structure. Sequence:
POST /api/v1/content/editwithdryRun: true(the price) →POST /api/v1/content/edit→ the answer hascontentandchanges, or pollGET /api/v1/content/jobs/{id}.
At a glance#
- Base path:
/api/v1/content - Auth:
Authorization: Bearer fara_sk_...(Authentication) - Scope:
write - Spends Fara: yes,
POST /api/v1/content/edit(not withdryRun: true). Strings already edited before for the same project are free. - Price: the model's token cost at our rate, never more than the quote (
quote.maxFara), which is held while the work runs. - Async: small work (about 1,000 words) answers in the same call; more answers 202 with a job.
- Terminal statuses:
completed,completed_partial,failed - Webhook events:
content.completed,content.completed_partial,content.failed - Results are kept 7 days.
What it does#
Every sentence and paragraph is written again from its meaning: it comes back as a new sentence in the words and word order a native writer would choose, not as the original with a few words changed. Each text is treated as what it is on the page: a heading is written again as a heading (a phrase stays a phrase, a question stays a question, about as long as it was), while buttons, menu and footer links, tabs, form labels, plan names and fixed section names («سوالات متداول», «درباره ما») keep the wording sites and apps usually use unless a clearly better one exists. Names, brands and standard formulas come back as they were. The meaning, the tense and mood of every verb, and the voice (formal or friendly, «شما» or «ما», every hedge and promise) never change. The new text must be Persian that Iranians really say: a sentence keeps its verb («است» too) and is never cut down to a phrase or to fragments set apart by commas, a question stays a question in the same person, and an everyday word is not swapped for a rarer, more literary one. A rewrite that is only different, or less natural, is avoided: the text then comes back as it was. To leave short texts alone, send minWords; to pin a word, send keep.
The Persian reads as written by a native writer: Persian word order instead of English, Persian expressions instead of word-for-word ones, active voice instead of «توسط» passives, plain current words instead of stiff ones («است» for «میباشد», «کردن» for «نمودن»), no filler or AI phrases, correct punctuation.
The text stays the writer's:
- Technical terms, names and the loanwords Iranians really say stay. Use
glossaryto have one term replaced everywhere, andkeepto pin a word. - The same string in two places gets the same edit: identical strings are edited once.
- A word is written one way across the request. When a word was kept in some strings and replaced in others, or a compound is written both joined and apart («کسبوکار», «کسب و کار»), one form is chosen and used in every string.
- Headings, buttons and labels stay what they are: a phrase is not turned into a full sentence, a heading that is a sentence stays a sentence, and none is made more than about a word longer. Each text is edited with the texts next to it and the page's headings in view, so the voice stays the same across the page.
What never changes:
- The meaning: every fact, number, date, name, condition and call to action stays; nothing is added or summarised.
- The structure, exactly as for translation: JSON keys and data values, placeholders (
{name},{{count}},%s, ICU plural frames), tags, links, code, Markdown layout and HTML markup. - The spacing next to a tag or a line break: «کلمه،
کلمه» comes back with no space before or after<br>, as it was sent. - The writer's spelling, where Persian accepts more than one form (
orthography: "source", the default): half-spaces in compounds, «لطفا» / «لطفاً», «متاسفانه» / «متأسفانه», the ezafe mark on ه («خانه» / «خانهٔ» / «خانهی»). No vowel marks are added. Plain mistakes are corrected («می شود» → «میشود», Arabic ي and ك). - Strings without Persian letters (English, code, numbers), text in Arabic, Urdu, Kurdish or Pashto, and single slugs, paths, file names or addresses (
آموزش-ترجمه،/blog/راهنما) are left as they are. Leave out more withskipKeysorminWords. - Digits stay as written (
digits: "source", the default), and an HTML page'slanganddirare not touched (setDirectionis off by default here).
Every edit is checked before it is returned. It must keep every placeholder and tag, keep every number of the original with the same value, keep the English words and names of the original and the words in keep, follow glossary, add no English words, stay close to the original length for texts of 40 characters or more (no summary, no additions), keep a heading, button or label about as long as it was (and a question a question), keep the verb of a sentence (a sentence is not cut down to a phrase), and keep any maxLength and maxGrowthPercent. An edit that does not pass is not used: the string keeps its original text and is listed in failed; a heading, button or label that cannot keep its shape, and a sentence that cannot be written again as a full sentence, simply come back as they were. The price is the work done, also when few strings change.
What you send#
| Field | Meaning |
|---|---|
format |
json, markdown, html or strings, as for translation. |
content |
The Persian text in that shape. |
brief |
One or two sentences: what the text is and who reads it. |
tone |
The register. source (default): keep each text's own register. neutral, formal, friendly, or conversational (everyday spoken Persian as Iranians write it in chats). |
keep |
Words and names to leave exactly as written. |
glossary |
Terms to write one way everywhere: { "دیجیتال مارکتینگ": "بازاریابی دیجیتال" } (or a list of { "term", "use" }). Where a string has the first form, the edit has the second, and the first form is never written. Whole words («نام» is not replaced inside «ثبتنام»); a term is written as you give it, also when the text spells otherwise; up to 500 entries. |
orthography |
source (default): the writer's spelling style stays. standard: standard Persian orthography (half-spaces in compounds and affixes, tanvin, hamza); the ezafe mark on ه still follows the text. |
minWords |
Strings with fewer words are left as they are (labels, buttons, short headings). Default 1: every Persian string is read. |
maxGrowthPercent |
An edit may not be longer than the original by more than this percentage. For text with line breaks (<br>, a new line) the limit holds for each line, so a title laid out on two lines keeps its shape. |
notes |
Per JSON key: where the string is used and a length limit: { "nav.signup": { "note": "button", "maxLength": 12 } }. |
skipKeys |
json: key paths to leave as they are; see skipKeys. |
onlyChanged |
true: changes lists only the strings that changed. |
project |
Your name for the site. Edits are remembered per project, apart from translations. |
memory |
use (default), refresh (edit again), off. |
digits |
source (default): as written. persian or latin: convert. The values never change. |
dryRun |
true: only the price. |
async |
true: always answer 202 with a job. |
Steps#
1. Get the price#
POST /api/v1/content/edit HTTP/1.1
Authorization: Bearer fara_sk_...
Content-Type: application/json
{
"format": "json",
"content": { "hero": { "title": "در دنیای امروز، فروشگاه شما توسط ما سریعتر میباشد", "cta": "شروع {trial} رایگان" } },
"brief": "Hosting for small online shops in Iran.",
"project": "acme-site",
"dryRun": true
}Response 200 OK:
{ "object": "content_edit_quote", "quote": { "maxFara": 1, "characters": 66, "strings": 2, "editable": 2, "fromMemory": 0, "toEdit": 2, "repeated": 0, "runs": "now" } }maxFara is the most the request can cost. Show it to the user before you send the request without dryRun. repeated counts strings that repeat another string of the request: they are edited once and cost nothing more. When something in the request had no effect, the answer also has warnings (for example a skipKeys pattern that matched nothing).
curl -sS -X POST "https://faraatarjomeh.com/api/v1/content/edit" \
-H "Authorization: Bearer $FARA_API_KEY" -H "Content-Type: application/json" \
-d '{"format":"strings","content":["این فایل توسط سیستم ذخیره گردید"],"dryRun":true}'2. Edit#
Send the same body without dryRun, with an Idempotency-Key (a new UUID per request; reuse it on retries).
Response 200 OK (small work):
{
"id": "6740c1f2a9e4b1d2c3f4a5b7",
"object": "content_edit",
"status": "completed",
"format": "json",
"project": "acme-site",
"counts": { "strings": 2, "editable": 2, "fromMemory": 0, "edited": 2, "changed": 1, "failed": 0 },
"price": { "maxFara": 1, "chargedFara": 1 },
"failed": [],
"content": { "hero": { "title": "فروشگاهتان با ما سریعتر است", "cta": "شروع {trial} رایگان" } },
"changes": [
{
"key": "hero.title",
"changed": true,
"kind": "wording",
"before": "در دنیای امروز، فروشگاه شما توسط ما سریعتر میباشد",
"after": "فروشگاهتان با ما سریعتر است",
"note": "عبارت زائد و «توسط» حذف شد."
},
{ "key": "hero.cta", "changed": false }
],
"createdAt": "2026-11-16T09:00:00.000Z",
"updatedAt": "2026-11-16T09:00:09.000Z",
"completedAt": "2026-11-16T09:00:09.000Z",
"links": { "self": "https://faraatarjomeh.com/api/v1/content/jobs/6740c1f2a9e4b1d2c3f4a5b7" }
}Response 202 Accepted (more work, or async: true): the same job with status: "queued" or "running" and no content, plus quote. Poll links.self (first after 10 s, then every 30–60 s) or wait for a content.completed webhook. While the job runs, counts.edited grows.
3. Read changes and failed#
changes has one entry per Persian string, in content order (only the changed ones with onlyChanged: true). A changed entry has:
kind:spellingwhen only half-spaces, marks, commas, quotes or letter forms differ (the same words in the same order),wordingwhen words changed.beforeandafter: the original text and the edited text, as they are in the request and incontent. They are left out when the changed text of a job is very large (over 600,000 characters together);contentalways has the edited text.note: a short Persian note on the main change. It may be missing.
Show the wording changes to the user when they review the edit; a spelling change needs only a quick look. failed lists strings that could not be edited safely; they keep their original text in content, and the job is completed_partial.
skipKeys#
For format: "json". A pattern is a key path with its parts joined by dots. * matches any characters inside one part; a whole ** part matches any number of parts. A list index can be written as the key shows it or as a part of its own.
| Pattern | Leaves out |
|---|---|
meta.* |
Every string directly under meta. |
**.url |
Every url, at any depth. |
faq.*.q or faq[*].q |
q of every item of the list faq. |
footer.** |
Everything under footer, at any depth. |
A pattern that matches no string is reported in warnings (SKIP_KEYS_UNMATCHED), in the quote and in the answer, so a pattern that does nothing is seen before the work is paid for.
Memory#
Edits are remembered per account and project, apart from translations: the same string with the same register, spelling choice, digits, terms and note comes back the same and costs nothing. A string that came back as it was because no rewrite kept its shape or its verb is not remembered: the next request tries it again, and prices it again. memory: "refresh" edits again. DELETE /api/v1/content/memory?project=acme-site clears a project (translations and edits).
Errors#
| Code | When | What to do |
|---|---|---|
CONTENT_FORMAT_INVALID (400) |
content does not match format. |
Fix the request. |
BAD_REQUEST (400) |
A field is wrong (for example minWords: 0); detail names it. |
Fix the request. |
CONTENT_TOO_LARGE (413) |
More than 20,000 strings or 1,000,000 characters. | Split the content. |
INSUFFICIENT_CREDITS (402) |
The balance is below maxFara. |
Tell the user to top up. |
Limits#
| Limit | Value |
|---|---|
| Strings per request | 20,000 |
| Text per request | 1,000,000 characters |
| Answered in the same call | about 6,000 characters (≈1,000 words) of new text |
| Rate limits | 120 requests per 60 s per API key |