Proofreadings
Grammarly-style writing assistance: correct spelling, grammar and punctuation, adjust tone, replace borrowed words with pure-language equivalents, rewrite or paraphrase text, suggest alternatives for a selection, and analyze writing quality.
POST
/v1/proofreadingsRequest
Request
{
"model": "your-proofreading-model",
"task": "proofread",
"input": "Ths sentense have some erors.",
"language": "en",
"spell_check": true,
"grammar": true,
"explain": true
}Parameters
modelstringrequired- Proofreading model id (type: proofreading).
inputstringrequired- The text to check. Max length depends on the model (Max Input Characters).
taskstring- One of
proofread,spelling,grammar,punctuation,suggestions,kurdish_pure,tone,rewrite,paraphrase,simplify,shorten,expand,alternatives,analyze,statistics. Defaults to the model's default task. languagestring- BCP 47 language tag, e.g.
ckb(Sorani),kmr(Kurmanji),ar,en. Must be one of the model's supported languages. spell_checkboolean- Fix spelling mistakes (proofread task).
grammarboolean- Fix grammar mistakes (proofread task).
punctuationboolean- Fix punctuation (proofread task).
suggestionsboolean- Include style / clarity / word-choice suggestions.
kurdish_pureboolean- Pure language: replace borrowed words with native equivalents.
tonestring- Target tone:
neutral,formal,informal,professional,friendly,casual,academic,confident,persuasive,diplomatic,empathetic,enthusiastic,simple,journalistic,creative. Required fortask: "tone". explainboolean- Attach an explanation to each change.
merge_adjacent_changesboolean- Merge neighbouring edits into a single change.
goalstring- Rewrite goal:
clarity,fluency,concise,simplify,expand,paraphrase,formalize,polish. lengthstringshorter,sameorlonger(rewrite tasks).ninteger- Number of rewrites / alternatives to return.
selection{ start, end }- UTF-16 offsets of the span to generate alternatives for (alternatives task).
custom_dictionarystring[]- Words that must never be flagged (names, brands, jargon).
instructionsstring- Extra free-form instructions (max 500 chars).
Model-specific support
Each model declares which properties, tasks, tones and languages it supports (see the model page or
GET /v1/models → parameters). Sending an unsupported property or value returns 400 unsupported_parameter. Omitted properties fall back to the model's defaults.Response
200 OK — proofread / rewrite tasks
{
"id": "prf_abc123",
"object": "proofreading",
"created": 1790000000,
"model": "your-proofreading-model",
"task": "proofread",
"choices": [
{
"index": 0,
"text": "This sentence has some errors.",
"changes": [
{
"id": "chg_1",
"type": "spell-correction",
"start_index": 0,
"end_index": 3,
"old_text": "Ths",
"new_text": "This",
"category": "spelling",
"explanation": "Misspelled word."
},
{
"id": "chg_2",
"type": "replace",
"start_index": 13,
"end_index": 17,
"old_text": "have",
"new_text": "has",
"category": "grammar",
"explanation": "Subject-verb agreement."
}
],
"finish_reason": "stop"
}
],
"usage": { "input_tokens": 24, "output_tokens": 61, "total_tokens": 85 }
}Each change has a type (insert, delete, replace, spell-correction), UTF-16 start_index/end_index into the original input, and an optional category (spelling, grammar, punctuation, style, clarity, tone, word-choice). The alternatives task returns selection + alternatives[], and statistics returns a statistics object.
200 OK — analyze task
{
"id": "prf_def456",
"object": "proofreading",
"task": "analyze",
"analysis": {
"detected_language": "en",
"tone": "informal",
"tone_scores": [{ "tone": "informal", "score": 0.82 }],
"formality": "informal",
"readability": 71.4,
"grade_level": "intermediate",
"sentiment": "neutral",
"quality_score": 64,
"issue_counts": { "spelling": 2, "grammar": 1, "punctuation": 0, "style": 1 },
"summary": "Casual message with a few spelling mistakes.",
"statistics": { "characters": 34, "characters_no_spaces": 28, "words": 7, "sentences": 1, "paragraphs": 1, "average_words_per_sentence": 7, "reading_time_seconds": 2 }
},
"usage": { "input_tokens": 20, "output_tokens": 110, "total_tokens": 130 }
}Examples
cURL — professional rewrite
curl https://api.pawan.krd/v1/proofreadings \
-H "Authorization: Bearer pk-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "your-proofreading-model",
"task": "rewrite",
"input": "hey, can u send me the report asap",
"tone": "professional",
"goal": "polish",
"n": 2
}'JavaScript — Sorani with pure language
const response = await fetch("https://api.pawan.krd/v1/proofreadings", {
method: "POST",
headers: {
Authorization: "Bearer pk-your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "your-proofreading-model",
task: "proofread",
input: "ئەم دەقە هەڵەی تێدایە",
language: "ckb",
kurdish_pure: true,
}),
});
const result = await response.json();
for (const change of result.choices[0].changes) {
console.log(change.category, change.old_text, "→", change.new_text);
}Python — alternatives for a selection
import requests
response = requests.post(
"https://api.pawan.krd/v1/proofreadings",
headers={"Authorization": "Bearer pk-your_key"},
json={
"model": "your-proofreading-model",
"task": "alternatives",
"input": "The meeting was very good.",
"selection": {"start": 16, "end": 25},
"n": 3,
},
)
for alt in response.json()["alternatives"]:
print(alt["text"], "-", alt["note"])Streaming
Proofreadings are returned as a single JSON response;
stream: true is rejected.