Create text edit
Edit given text according to instructions
Request
POST /edits
Request Body
| Field | Type | Required | Description |
|---|
| model | string | Yes | Model name |
| input | string | No | Input text to edit |
| instruction | string | Yes | Edit instruction |
| n | integer | No | - |
| temperature | number | No | - |
| top_p | number | No | - |
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
| Field | Type | Required | Description |
|---|
| object | string | Yes | - |
| created | integer | Yes | - |
| choices | Array<EditChoice> | Yes | - |
| usage | object | Yes | - |
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
| Field | Type | Required | Description |
|---|
| model | string | Yes | Model name |
| input | string | No | Input text to edit |
| instruction | string | Yes | Edit instruction |
| n | integer | No | - |
| temperature | number | No | - |
| top_p | number | No | - |
EditResponse
| Field | Type | Required | Description |
|---|
| object | string | Yes | - |
| created | integer | Yes | - |
| choices | Array<EditChoice> | Yes | - |
| usage | object | Yes | - |
EditChoice
| Field | Type | Required | Description |
|---|
| text | string | Yes | - |
| index | integer | Yes | - |
Usage
| Field | Type | Required | Description |
|---|
| prompt_tokens | integer | Yes | Number of tokens in the prompt (input) |
| prompt_tokens_details | object | No | Details about prompt tokens |
| completion_tokens | integer | Yes | Number of tokens in the completion (output) |
| completion_tokens_details | object | No | Details about completion tokens |
| total_tokens | integer | Yes | Total number of tokens (prompt + completion) |
Related APIs