Create a chapter
curl --request POST \
--url https://api.relettr.com/v1/chapters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"source_language": "ko",
"series_id": "ser_3hT9aB7cD1eF2gH3iJ4kL5",
"number": 42,
"layout": "strip",
"translate_sfx": false,
"output": {
"layout": "original",
"format": "webp",
"quality": 90
},
"auto_start": true,
"max_credits": 600,
"files": [
{
"index": 1,
"filename": "001.jpg",
"content_type": "image/jpeg",
"size_bytes": 812345
},
{
"index": 2,
"filename": "002.jpg",
"content_type": "image/jpeg",
"size_bytes": 790111
}
],
"metadata": {
"source_ref": "tower-42"
}
}
'import requests
url = "https://api.relettr.com/v1/chapters"
payload = {
"source_language": "ko",
"series_id": "ser_3hT9aB7cD1eF2gH3iJ4kL5",
"number": 42,
"layout": "strip",
"translate_sfx": False,
"output": {
"layout": "original",
"format": "webp",
"quality": 90
},
"auto_start": True,
"max_credits": 600,
"files": [
{
"index": 1,
"filename": "001.jpg",
"content_type": "image/jpeg",
"size_bytes": 812345
},
{
"index": 2,
"filename": "002.jpg",
"content_type": "image/jpeg",
"size_bytes": 790111
}
],
"metadata": { "source_ref": "tower-42" }
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source_language: 'ko',
series_id: 'ser_3hT9aB7cD1eF2gH3iJ4kL5',
number: 42,
layout: 'strip',
translate_sfx: false,
output: {layout: 'original', format: 'webp', quality: 90},
auto_start: true,
max_credits: 600,
files: [
{index: 1, filename: '001.jpg', content_type: 'image/jpeg', size_bytes: 812345},
{index: 2, filename: '002.jpg', content_type: 'image/jpeg', size_bytes: 790111}
],
metadata: {source_ref: 'tower-42'}
})
};
fetch('https://api.relettr.com/v1/chapters', 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": "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>"
}
}{
"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>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Chapters
Create a chapter
Creates a chapter, declares its files in reading order, and returns one
presigned PUT URL per file. Upload each file to its URL with exactly
the Content-Type and Content-Length you declared, then call
POST /chapters/{id}/uploads/complete.
Idempotency-Key is required on this endpoint.
POST
/
chapters
Create a chapter
curl --request POST \
--url https://api.relettr.com/v1/chapters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"source_language": "ko",
"series_id": "ser_3hT9aB7cD1eF2gH3iJ4kL5",
"number": 42,
"layout": "strip",
"translate_sfx": false,
"output": {
"layout": "original",
"format": "webp",
"quality": 90
},
"auto_start": true,
"max_credits": 600,
"files": [
{
"index": 1,
"filename": "001.jpg",
"content_type": "image/jpeg",
"size_bytes": 812345
},
{
"index": 2,
"filename": "002.jpg",
"content_type": "image/jpeg",
"size_bytes": 790111
}
],
"metadata": {
"source_ref": "tower-42"
}
}
'import requests
url = "https://api.relettr.com/v1/chapters"
payload = {
"source_language": "ko",
"series_id": "ser_3hT9aB7cD1eF2gH3iJ4kL5",
"number": 42,
"layout": "strip",
"translate_sfx": False,
"output": {
"layout": "original",
"format": "webp",
"quality": 90
},
"auto_start": True,
"max_credits": 600,
"files": [
{
"index": 1,
"filename": "001.jpg",
"content_type": "image/jpeg",
"size_bytes": 812345
},
{
"index": 2,
"filename": "002.jpg",
"content_type": "image/jpeg",
"size_bytes": 790111
}
],
"metadata": { "source_ref": "tower-42" }
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source_language: 'ko',
series_id: 'ser_3hT9aB7cD1eF2gH3iJ4kL5',
number: 42,
layout: 'strip',
translate_sfx: false,
output: {layout: 'original', format: 'webp', quality: 90},
auto_start: true,
max_credits: 600,
files: [
{index: 1, filename: '001.jpg', content_type: 'image/jpeg', size_bytes: 812345},
{index: 2, filename: '002.jpg', content_type: 'image/jpeg', size_bytes: 790111}
],
metadata: {source_ref: 'tower-42'}
})
};
fetch('https://api.relettr.com/v1/chapters', 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": "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>"
}
}{
"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>"
}
}{
"error": {
"type": "invalid_request",
"code": "parameter_invalid",
"message": "<string>",
"request_id": "<string>",
"param": "files[3].content_type",
"doc_url": "<string>"
}
}Authorizations
Headers
Body
application/json
Response
The chapter, in awaiting_upload, with its upload URLs.