Skip to content

edits

Edit given text according to instructions

POST /edits
FieldTypeRequiredDescription
modelstringYesModel name
inputstringNoInput text to edit
instructionstringYesEdit instruction
nintegerNo-
temperaturenumberNo-
top_pnumberNo-
{
"model": "gpt-4o-mini",
"input": "What day of the wek is it?",
"instruction": "Fix the spelling mistakes"
}
{
"model": "qwen-plus",
"input": "The cat sat on the mat.",
"instruction": "Make this more interesting and descriptive",
"temperature": 0.7
}
{
"model": "gpt-5-nano",
"input": "Can you send me that report asap?",
"instruction": "Rewrite in a polite and formal tone",
"temperature": 0.2
}

Successful response

FieldTypeRequiredDescription
objectstringYes-
createdintegerYes-
choicesArray<EditChoice>Yes-
usageobjectYes-
{
"object": "edit",
"created": 1677652288,
"choices": [
{
"text": "What day of the week is it?",
"index": 0
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 8,
"total_tokens": 18
}
}
const response = await fetch('https://api.r9s.ai/v1/edits', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"model": "gpt-4o-mini",
"input": "What day of the wek is it?",
"instruction": "Fix the spelling mistakes"
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.r9s.ai/v1/edits"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json={
"model": "gpt-4o-mini",
"input": "What day of the wek is it?",
"instruction": "Fix the spelling mistakes"
}, headers=headers)
data = response.json()
print(data)
Terminal window
curl -X POST "https://api.r9s.ai/v1/edits" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","input":"What day of the wek is it?","instruction":"Fix the spelling mistakes"}'
FieldTypeRequiredDescription
modelstringYesModel name
inputstringNoInput text to edit
instructionstringYesEdit instruction
nintegerNo-
temperaturenumberNo-
top_pnumberNo-
FieldTypeRequiredDescription
objectstringYes-
createdintegerYes-
choicesArray<EditChoice>Yes-
usageobjectYes-
FieldTypeRequiredDescription
textstringYes-
indexintegerYes-
FieldTypeRequiredDescription
prompt_tokensintegerYesNumber of tokens in the prompt (input)
prompt_tokens_detailsobjectNoDetails about prompt tokens
completion_tokensintegerYesNumber of tokens in the completion (output)
completion_tokens_detailsobjectNoDetails about completion tokens
total_tokensintegerYesTotal number of tokens (prompt + completion)