Skip to content

edits

Create text edit

Edit given text according to instructions

Request

POST /edits

Request Body

FieldTypeRequiredDescription
modelstringYesModel name
inputstringNoInput text to edit
instructionstringYesEdit instruction
nintegerNo-
temperaturenumberNo-
top_pnumberNo-

Request Examples

Fix grammar errors

{
  "model": "gpt-5.6-luna",
  "input": "What day of the wek is it?",
  "instruction": "Fix the spelling mistakes"
}

Improve text

{
  "model": "qwen-plus",
  "input": "The cat sat on the mat.",
  "instruction": "Make this more interesting and descriptive",
  "temperature": 0.7
}

Rewrite tone (more formal)

{
  "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

Response Schema

FieldTypeRequiredDescription
objectstringYes-
createdintegerYes-
choicesArray<EditChoice>Yes-
usageobjectYes-

Response Example

{
  "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
  }
}

Code Examples

JavaScript (Fetch)

const response = await fetch('https://api.uuroute.ai/v1/edits', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
  "model": "gpt-5.6-luna",
  "input": "What day of the wek is it?",
  "instruction": "Fix the spelling mistakes"
})
});

const data = await response.json();
console.log(data);

Python (requests)

import requests

url = "https://api.uuroute.ai/v1/edits"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, json={
  "model": "gpt-5.6-luna",
  "input": "What day of the wek is it?",
  "instruction": "Fix the spelling mistakes"
}, headers=headers)
data = response.json()
print(data)

cURL

curl -X POST "https://api.uuroute.ai/v1/edits" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.6-luna","input":"What day of the wek is it?","instruction":"Fix the spelling mistakes"}'

Schema Reference

EditRequest

FieldTypeRequiredDescription
modelstringYesModel name
inputstringNoInput text to edit
instructionstringYesEdit instruction
nintegerNo-
temperaturenumberNo-
top_pnumberNo-

EditResponse

FieldTypeRequiredDescription
objectstringYes-
createdintegerYes-
choicesArray<EditChoice>Yes-
usageobjectYes-

EditChoice

FieldTypeRequiredDescription
textstringYes-
indexintegerYes-

Usage

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)