developer docs

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.

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

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

StatusWhat it meansWhat to do
400A 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.
401No key, or a key that is not valid: mistyped, revoked, or its owner left the workspace.Check the key on the API screen.
402Not enough credits for the run.Top up, or run fewer pages.
403A key used outside /api/v1, or spending paused on the workspace (Billing paused).Use an /api/v1 route; contact us about a pause.
404The 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.
409The 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.
413An image over the size limits, a novel chapter over 200,000 characters, or a file that would be over 90 MB.Split it.
415An SVG page.Send PNG, JPEG or WebP.
422An image that cannot be opened: damaged or cut short.Save it again and resend it.
425A file asked for in a language nothing is translated into yet.Wait for the run.
500Something 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

WhatLimit
API keys10 a workspace
Webhook endpoints5 a workspace
Page width700 to 1300 pixels
Page height15,000 pixels
Page file25 MB
Page area10 megapixels; a larger page is scaled down
Novel chapter200,000 characters
One exported file90 MB
A webhook's answer10 seconds
Request log30 days, and a workspace's newest 10,000 calls
Webhook log30 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.