Help
Errors and limits
What an error answer looks like, what each status means, and the limits a request runs into.
What an error looks like
A request the API refuses is answered with a status of 400 or more and a JSON body. statusMessage says why, in a sentence meant for a person: log it, or show it to whoever started the upload.
{
"error": true,
"url": "https://tinypica.com/api/v1/chapters/00000000-0000-0000-0000-000000000000",
"statusCode": 404,
"statusMessage": "Chapter not found",
"message": "Chapter not found"
} A field that is missing or of the wrong type is a 400 with Validation Error, and message lists the fields that were wrong:
{
"error": true,
"url": "https://tinypica.com/api/v1/chapters/f56d2008-…/export/prepare",
"statusCode": 400,
"statusMessage": "Validation Error",
"message": "[{\"expected\": \"string\", \"code\": \"invalid_type\", \"path\": [\"language\"], \"message\": \"Invalid input: expected string, received undefined\"}]",
"data": { "name": "ZodError", "message": "…the same list…" }
}Statuses
| Status | What it means | What to do |
|---|---|---|
400 | A field is missing or wrong, or the chapter or project cannot do what was asked: page images for a novel, a format the project does not reach. | Fix the request. |
401 | No key, or a key that is not valid: mistyped, revoked, or its owner left the workspace. | Check the key on the API screen. |
402 | Not enough credits for the run. | Top up, or run fewer pages. |
403 | A key used outside /api/v1, or spending paused on the workspace (Billing paused). | Use an /api/v1 route; contact us about a pause. |
404 | The project or chapter does not exist, was deleted, or is another workspace's. Or the route does not exist: No such API route. | Check the id and the path. |
409 | The chapter is still running; the chapter number is taken; a file was not prepared or is out of date. | Wait for the run, pick another number, or prepare the file. |
413 | An image over the size limits, a novel chapter over 200,000 characters, or a file that would be over 90 MB. | Split it. |
415 | An SVG page. | Send PNG, JPEG or WebP. |
422 | An image that cannot be opened: damaged or cut short. | Save it again and resend it. |
425 | A file asked for in a language nothing is translated into yet. | Wait for the run. |
500 | Something went wrong on our side. The answer does not say what. | Try again later; tell us if it lasts. |
Worth sending again as they are, after a pause: a 409 while the chapter is still running or its file is still being packaged, a 425, and a 5xx. Any other refusal will be refused again until the request, the chapter or the balance changes.
Limits
| What | Limit |
|---|---|
| API keys | 10 a workspace |
| Webhook endpoints | 5 a workspace |
| Page width | 700 to 1300 pixels |
| Page height | 15,000 pixels |
| Page file | 25 MB |
| Page area | 10 megapixels; a larger page is scaled down |
| Novel chapter | 200,000 characters |
| One exported file | 90 MB |
| A webhook's answer | 10 seconds |
| Request log | 30 days, and a workspace's newest 10,000 calls |
| Webhook log | 30 days |
How often to ask
There is no request rate limit, and we would like to keep it that way. Ask about a chapter no more than every ten seconds, send a chapter's pages a few at a time rather than all in parallel, and let a webhook say when a chapter is done.