Re-translate regions
curl --request POST \
--url https://api.relettr.com/v1/chapters/{chapter_id}/retranslate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"region_ids": [
"<string>"
]
}
'import requests
url = "https://api.relettr.com/v1/chapters/{chapter_id}/retranslate"
payload = { "region_ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({region_ids: ['<string>']})
};
fetch('https://api.relettr.com/v1/chapters/{chapter_id}/retranslate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ch_7Kq2mXaB3cD4eF5gH6iJ7k",
"object": "chapter",
"livemode": true,
"status": "awaiting_upload",
"series_id": "<string>",
"number": 123,
"source_language": "ko",
"target_language": "en",
"options": {
"layout": "strip",
"translate_sfx": false,
"output": {
"layout": "original",
"strip": false,
"format": "png",
"quality": 90
},
"on_mask_failure": "hold",
"auto_start": false,
"max_credits": 2
},
"uploads": [
{
"index": 123,
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "2023-11-07T05:31:56Z"
}
],
"quote": {
"credits": 462,
"parts": 21,
"breakdown": {
"ocr": 123,
"translate": 123,
"clean_letter": 123,
"sfx": 123
}
},
"credits": {
"held": 123,
"charged": 123,
"refunded": 123
},
"progress": {
"step": "read",
"percent": 50,
"parts_total": 123,
"parts_done": 123,
"steps": [
{
"name": "read",
"status": "pending"
}
]
},
"queue": {
"position": 123,
"estimated_start_at": "2023-11-07T05:31:56Z",
"gpu": "online"
},
"review": {
"open": 123,
"accepted": 123,
"zones": [
{
"id": "<string>",
"page": 123,
"box": [
123
],
"reason": "<string>"
}
]
},
"warnings": [
{
"code": "missing_glyphs",
"page": 123,
"region_ids": [
"<string>"
]
}
],
"error": {
"code": "invalid_image",
"message": "<string>",
"step": "<string>",
"file_index": 123
},
"result_version": 123,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "payment_required",
"code": "insufficient_credits",
"message": "This chapter needs 3,300 credits; 1,140 are available. Buy credits at https://relettr.com/billing.",
"required": 3300,
"available": 1140,
"doc_url": "https://docs.relettr.com/errors#insufficient_credits",
"request_id": "req_c02a1b3c4d5e6f7a8b9c0d"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Regions and review
Re-translate regions
Asks the translator again for the given regions (with neighbouring
lines as context). Runs without the GPU. The changed parts become
dirty; call POST /rerender to letter them.
Pricing: translate rate (8 credits) per part touched.
POST
/
chapters
/
{chapter_id}
/
retranslate
Re-translate regions
curl --request POST \
--url https://api.relettr.com/v1/chapters/{chapter_id}/retranslate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"region_ids": [
"<string>"
]
}
'import requests
url = "https://api.relettr.com/v1/chapters/{chapter_id}/retranslate"
payload = { "region_ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({region_ids: ['<string>']})
};
fetch('https://api.relettr.com/v1/chapters/{chapter_id}/retranslate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ch_7Kq2mXaB3cD4eF5gH6iJ7k",
"object": "chapter",
"livemode": true,
"status": "awaiting_upload",
"series_id": "<string>",
"number": 123,
"source_language": "ko",
"target_language": "en",
"options": {
"layout": "strip",
"translate_sfx": false,
"output": {
"layout": "original",
"strip": false,
"format": "png",
"quality": 90
},
"on_mask_failure": "hold",
"auto_start": false,
"max_credits": 2
},
"uploads": [
{
"index": 123,
"method": "PUT",
"url": "<string>",
"headers": {},
"expires_at": "2023-11-07T05:31:56Z"
}
],
"quote": {
"credits": 462,
"parts": 21,
"breakdown": {
"ocr": 123,
"translate": 123,
"clean_letter": 123,
"sfx": 123
}
},
"credits": {
"held": 123,
"charged": 123,
"refunded": 123
},
"progress": {
"step": "read",
"percent": 50,
"parts_total": 123,
"parts_done": 123,
"steps": [
{
"name": "read",
"status": "pending"
}
]
},
"queue": {
"position": 123,
"estimated_start_at": "2023-11-07T05:31:56Z",
"gpu": "online"
},
"review": {
"open": 123,
"accepted": 123,
"zones": [
{
"id": "<string>",
"page": 123,
"box": [
123
],
"reason": "<string>"
}
]
},
"warnings": [
{
"code": "missing_glyphs",
"page": 123,
"region_ids": [
"<string>"
]
}
],
"error": {
"code": "invalid_image",
"message": "<string>",
"step": "<string>",
"file_index": 123
},
"result_version": 123,
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "payment_required",
"code": "insufficient_credits",
"message": "This chapter needs 3,300 credits; 1,140 are available. Buy credits at https://relettr.com/billing.",
"required": 3300,
"available": 1140,
"doc_url": "https://docs.relettr.com/errors#insufficient_credits",
"request_id": "req_c02a1b3c4d5e6f7a8b9c0d"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Authorizations
Headers
Response
Accepted; the chapter is processing.