Restore a photograph
pinin_restore_photoQueue one or up to 100 photographs for damage repair, colorization, deblurring or upscaling, then read results with pinin_get_restoration. Use dry_run to price without spending credits.
Instructions
Queue photographs for restoration — damage repair, colorization, deblurring, upscaling — on the account behind the key. Send one photo as a public https image_url (preferred) or as image_base64, or up to 100 with images. Costs one credit per image, charged when the job settles and refunded automatically if it fails. Returns the new job in pending and does not wait: read the result with pinin_get_restoration. Pass idempotency_key when a retry must not charge twice, and dry_run: true to price a request without spending. Not for reading, listing or cancelling existing jobs — those are pinin_get_restoration, pinin_list_restorations and pinin_cancel_restoration.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pinin_restore_photo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | What to do to the photo. `all-in-one` (default) repairs damage and improves the image in one pass; `dust-scratch` removes specks and scratches only; `colorize` adds colour to black-and-white photos; `deblur-upscale` fixes soft focus and enlarges; `upscale-only` enlarges without other changes. Call pinin_list_modes for the cost of each. | |
| seed | No | Deterministic output: the same seed with the same image and mode gives the same result. Omit for a fresh variation. | |
| images | No | Batch of up to 100 photographs, each a public https URL string or an object with `image_url`. Use this instead of `image_url` for more than one photo; `images` wins if both are given. | |
| dry_run | No | Price the request without spending credits or queueing anything. The answer is a `dry_run` object with `credits_required`, `credits_balance` and `valid` instead of a restoration. | |
| metadata | No | Your own JSON object, max 2 KB. Stored on the job, returned by pinin_get_restoration and echoed in webhook payloads — use it to carry your own identifier. | |
| image_url | No | Public https URL of one photograph. Any image format; the URL must be reachable by Pinin, not a private or localhost address. | |
| mime_type | No | Content type of `image_base64`, for example `image/jpeg` or `image/png`. Ignored when the input is a URL. | |
| image_base64 | No | Inline image as base64 or a data URL. Single image only, and only when the photo cannot be hosted: prefer `image_url` for anything over a few megabytes. | |
| idempotency_key | No | 8–128 printable ASCII characters. A repeat with the same key returns the jobs the first call created instead of queueing and charging again. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Restoration id — pass it to pinin_get_restoration, pinin_download_restoration or pinin_cancel_restoration. | |
| mode | No | The restoration mode the job was queued with. | |
| seed | No | The deterministic seed in force, or null when unset. | |
| error | No | Failure detail ({ code, message }) when status is `failed`, otherwise null. | |
| valid | No | Whether the request would be accepted (dry_run only). | |
| images | No | Signed URLs (`original`, `restored`), each `{ url, expires_in }` in seconds — null until the job completes. | |
| object | No | `restoration`, or `dry_run` when `dry_run` was true. | |
| status | No | `pending` on creation; progresses to `processing`, `completed` or `failed`. | |
| credits | No | Credits this job will charge, or charged if it already settled. | |
| metadata | No | The metadata object supplied at creation. | |
| share_url | No | Public share link for the restored photo, or null before completion. | |
| created_at | No | ISO 8601 creation instant. | |
| expires_at | No | ISO 8601 instant when the input and output files are deleted. | |
| updated_at | No | ISO 8601 instant of the last state change. | |
| completed_at | No | ISO 8601 completion instant, or null while running. | |
| order_number | No | Human-readable order reference for support. | |
| credits_balance | No | Balance at the time of pricing (dry_run only). | |
| credits_required | No | Credits the request would cost (dry_run only). |