# InkHand API - **OpenAPI Version:** `3.1.0` - **API Version:** `1.0.0` - **Contact:** InkHand Real handwriting from text. Our model draws every letter as pen strokes, in 1,743 hands, so no two letters are the same. ## Quick start 1. [Create a test key](https://inkhand.app/dashboard/api-keys). It's free; output is watermarked. 2. Write your first page, a PDF on ruled paper: ```bash curl https://api.inkhand.app/v1/documents \ -H "Authorization: Bearer ink_test_..." \ -H "Content-Type: application/json" \ -d '{"text": "Hello from InkHand", "paper": "college"}' \ -o hello.pdf ``` 3. Switch to a live key when you're ready. ## Two ways to write | Endpoint | You get | Billed | | ---------------------- | ----------------------------------------------------------------- | ----------------- | | `POST /v1/documents` | Finished pages: PDF, PNG or SVG on paper, like the editor | Per page returned | | `POST /v1/handwriting` | One SVG strip or raw pen strokes, for plotters and custom layouts | Per 150 words | ## llms.txt Using an AI assistant? Point it at [`https://api.inkhand.app/llms.txt`](https://api.inkhand.app/llms.txt): this whole reference as one Markdown file. ## Keys | Key | Output | Billing | | -------------- | ----------- | ------------------------------- | | `ink_test_...` | Watermarked | Free, 50 pages a month | | `ink_live_...` | Clean | Your plan's pages, then top-ups | Send it as `Authorization: Bearer `. Keep keys on your server, never in browser or app code. ## Pages - Documents: 1 page = 1 page returned. - Handwriting: 1 page = up to 150 words. 151–300 words = 2 pages. - Failed requests are free. - Plan pages are used first, then [top-up pages](https://inkhand.app/dashboard/billing), which never expire. - `GET /v1/usage` shows what's left. ## Limits | Key | Requests/min | At once | Words/request | Pages/month | | ------------- | ------------ | ------- | ------------- | -------------- | | API plan | 120 | 4 | 5,000 | 1,000 | | Scale plan | 300 | 12 | 10,000 | 5,000 | | Pay as you go | 60 | 2 | 5,000 | top-up balance | | Test | 10 | 1 | 300 | 50 | Over the limit: `429` with `Retry-After`. Out of pages: `402`. Every response has `RateLimit` headers. ## Retries Send an `Idempotency-Key` (e.g. a UUID) with each `POST`. Retrying with the same key within 24 hours returns the first response and isn't billed again. ## Errors [Problem details](https://www.rfc-editor.org/rfc/rfc9457) with a stable `code` and a `request_id`. Quote the `request_id` when you [contact us](https://inkhand.app/contact). ## Versioning `/v1` only grows: new fields and endpoints. Breaking changes get `/v2` and at least 6 months' notice. ## Contents **Operations** - [POST /v1/documents](#scalar-operation-post-v1documents) - [POST /v1/handwriting](#scalar-operation-post-v1handwriting) - [GET /v1/hands](#scalar-operation-get-v1hands) - [GET /v1/usage](#scalar-operation-get-v1usage) **Schemas** - [DocumentRequest](#scalar-schema-documentrequest) - [Document](#scalar-schema-document) - [HandwritingRequest](#scalar-schema-handwritingrequest) - [Handwriting](#scalar-schema-handwriting) - [HandList](#scalar-schema-handlist) - [Usage](#scalar-schema-usage) - [Problem](#scalar-schema-problem) ## Servers - **URL:** `https://api.inkhand.app` ## Authentication - **bearerAuth**: HTTP bearer An API key: `ink_live_...` or `ink_test_...`. ## Tags ### Documents Finished pages on paper, as PDF, PNG or SVG: the same as the /write editor. ### Handwriting Turn text into an SVG or raw pen strokes. ### Hands The handwriting styles you can write in. ### Account Pages used and left, and your limits. ## Operations ### Write a document - **Method:** `POST` - **Path:** `/v1/documents` - **Operation ID:** `createDocument` - **Tags:** Documents Writes the text on paper and returns finished pages, exactly as the editor makes them: the same papers, page sizes, margins and pen settings. Returns the file itself (`application/pdf`, `image/png`, `image/svg+xml`, or `application/zip` for several PNG/SVG pages). Send `Accept: application/json` to get it base64-encoded in JSON instead. **Billed per page returned** (not per word). Test keys add a watermark. **Servers:** [Inherited servers](#scalar-context-global-servers) **Authentication:** [Global authentication](#scalar-context-global-authentication) #### Header parameters - **`Idempotency-Key`**: `string`, maxLength: `255` Unique key for safe retries (kept 24 hours). #### Request body **Required:** `true` **Content type:** `application/json` [DocumentRequest](#scalar-schema-documentrequest) **Generated example:** ```json { "text": "Dear Anna,\n\nThank you so much for the flowers!\n\nLove, Sam", "markdown": false, "mistakes": 0, "hand": "br_119", "format": "pdf", "page_size": "a4", "paper": "wide", "size_mm": 2, "line_spacing_mm": 9, "on_lines": true, "word_spacing": 1, "margins_mm": { "top": 0, "right": 0, "bottom": 0, "left": 0 }, "natural": true, "variation": 0, "seed": 0, "ink_color": "#1f3fa6", "pen_width": 1, "pen": "ballpoint", "ink_texture": 0, "ink_flow": 0, "slant": 0, "movement": { "words": 0, "lines": 0, "spacing": 0 }, "paper_texture": 0, "paper_grain": "recycled", "shading": false, "soft_focus": false, "quality": "standard", "transparent": false, "pages": [ 1 ] } ``` #### Responses ##### 200 The document. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` - **`X-Pages`** Pages in the document. `integer` - **`X-Pages-Billed`** Pages returned and billed. `integer` **Content type:** `application/pdf` `string`, format: `binary` **Generated example:** ```json "@filename" ``` **Content type:** `image/png` `string`, format: `binary` **Generated example:** ```json "@filename" ``` **Content type:** `image/svg+xml` `string` **Generated example:** ```xml ``` **Content type:** `application/zip` `string`, format: `binary` **Generated example:** ```json "@filename" ``` **Content type:** `application/json` [Document](#scalar-schema-document) **Generated example:** ```json { "id": "doc_3kd9x0aQ1b2C3d4E", "object": "document", "created": 1795680145, "livemode": true, "format": "pdf", "pages": 2, "billed_pages": 2, "unwritable": [], "filename": "handwriting.pdf", "content_type": "application/pdf", "data": "" } ``` ##### 400 Invalid JSON or fields, or \`pages\` names no page (\`invalid\_request\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) **Generated example:** ```json { "type": "https://inkhand.app/docs/api/errors#rate_limited", "title": "", "status": 429, "code": "rate_limited", "detail": "", "request_id": "req_8f2kQ0xZ1yW3vU5t", "errors": [ { "path": "", "message": "" } ] } ``` ##### 401 Missing, malformed, revoked or expired API key (\`missing\_api\_key\`, \`invalid\_api\_key\`, \`api\_key\_revoked\`, \`api\_key\_expired\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 402 Not enough pages for this document (\`quota\_exceeded\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 404 Unknown hand (\`unknown\_hand\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 409 A request with this \`Idempotency-Key\` is still running (\`idempotency\_in\_progress\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 413 Too many words for one request (\`payload\_too\_large\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 422 \`Idempotency-Key\` reused with a different request (\`idempotency\_mismatch\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 429 Rate or concurrency limit reached (\`rate\_limited\`, \`concurrency\_limited\`). Wait \`Retry-After\` seconds. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` - **`Retry-After`** Seconds to wait before retrying. `integer` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 500 Unexpected error (\`internal\_error\`). Safe to retry with the same \`Idempotency-Key\`. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 503 Busy or temporarily unavailable (\`renderer\_busy\`, \`renderer\_unavailable\`). Retry after \`Retry-After\` seconds. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ### Write text by hand - **Method:** `POST` - **Path:** `/v1/handwriting` - **Operation ID:** `createHandwriting` - **Tags:** Handwriting Writes the text in the chosen hand and returns an SVG or raw pen strokes. Send `Accept: image/svg+xml` with `format: "svg"` to get the SVG file itself instead of JSON. **Servers:** [Inherited servers](#scalar-context-global-servers) **Authentication:** [Global authentication](#scalar-context-global-authentication) #### Header parameters - **`Idempotency-Key`**: `string`, maxLength: `255` Unique key for safe retries (kept 24 hours). #### Request body **Required:** `true` **Content type:** `application/json` [HandwritingRequest](#scalar-schema-handwritingrequest) **Generated example:** ```json { "text": "Dear Anna,\nThank you so much for the flowers!\nLove, Sam", "hand": "br_119", "format": "svg", "ink_color": "#1a237e", "variation": 0, "seed": 0, "line_width": 8, "pen": "ballpoint", "ink_texture": 0, "ink_flow": 0, "soft_focus": false } ``` #### Responses ##### 200 The handwriting. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` - **`Idempotent-Replayed`** `true` when this is a stored response to an earlier request with the same key. `string` **Content type:** `application/json` [Handwriting](#scalar-schema-handwriting) **Generated example:** ```json { "id": "hw_3kd9x0aQ1b2C3d4E", "object": "handwriting", "created": 1795680145, "livemode": true, "hand": "br_119", "format": "svg", "words": 12, "pages": 1, "unwritable": [], "svg": "…", "strokes": [ [ [ [ 0.012, -0.034 ] ] ] ] } ``` **Content type:** `image/svg+xml` `string` **Generated example:** ```xml ``` ##### 400 Invalid JSON or fields (\`invalid\_request\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 401 Missing, malformed, revoked or expired API key (\`missing\_api\_key\`, \`invalid\_api\_key\`, \`api\_key\_revoked\`, \`api\_key\_expired\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 402 Not enough pages: the monthly allowance and top-up pages don't cover this request (\`quota\_exceeded\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 404 Unknown hand (\`unknown\_hand\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 409 A request with this \`Idempotency-Key\` is still running (\`idempotency\_in\_progress\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 413 Too many words for one request (\`payload\_too\_large\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 422 \`Idempotency-Key\` reused with a different request (\`idempotency\_mismatch\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 429 Rate or concurrency limit reached (\`rate\_limited\`, \`concurrency\_limited\`). Wait \`Retry-After\` seconds. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` - **`Retry-After`** Seconds to wait before retrying. `integer` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 500 Unexpected error (\`internal\_error\`). Safe to retry with the same \`Idempotency-Key\`. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 503 Busy or temporarily unavailable (\`renderer\_busy\`, \`renderer\_unavailable\`). Retry after \`Retry-After\` seconds. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ### List hands - **Method:** `GET` - **Path:** `/v1/hands` - **Operation ID:** `listHands` - **Tags:** Hands The curated hands, with names, styles and a preview image. Add `?all=true` to also list every other renderer id (unnamed, no preview). **Servers:** [Inherited servers](#scalar-context-global-servers) **Authentication:** [Global authentication](#scalar-context-global-authentication) #### Query parameters - **`all`**: `boolean`, default: `false` `true` to include all 1,743 renderer ids. #### Responses ##### 200 The hands you can write in. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` **Content type:** `application/json` [HandList](#scalar-schema-handlist) **Generated example:** ```json { "object": "list", "data": [ { "id": "br_119", "object": "hand", "name": "Leo", "style": "cursive", "tags": [ "neat" ], "description": "Neat cursive", "recommended": true, "preview_url": "https://inkhand.app/hands/br_119.svg" } ], "has_more": true } ``` ##### 401 Missing, malformed, revoked or expired API key (\`missing\_api\_key\`, \`invalid\_api\_key\`, \`api\_key\_revoked\`, \`api\_key\_expired\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 429 Rate or concurrency limit reached (\`rate\_limited\`, \`concurrency\_limited\`). Wait \`Retry-After\` seconds. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` - **`Retry-After`** Seconds to wait before retrying. `integer` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 500 Unexpected error (\`internal\_error\`). Safe to retry with the same \`Idempotency-Key\`. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ### Usage this period - **Method:** `GET` - **Path:** `/v1/usage` - **Operation ID:** `getUsage` - **Tags:** Account Pages used and left for the key's mode (live or test), and the limits that apply. **Servers:** [Inherited servers](#scalar-context-global-servers) **Authentication:** [Global authentication](#scalar-context-global-authentication) #### Responses ##### 200 Usage and limits. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` **Content type:** `application/json` [Usage](#scalar-schema-usage) **Generated example:** ```json { "object": "usage", "livemode": true, "plan": "free", "period": { "start": "2026-11-01T00:00:00.000Z", "end": "2026-12-01T00:00:00.000Z" }, "pages": { "used": 120, "included": 2000, "remaining": 1880 }, "credits": { "pages": 500 }, "limits": { "requests_per_minute": 120, "concurrency": 4, "words_per_request": 5000, "pages_per_period": 1000 } } ``` ##### 401 Missing, malformed, revoked or expired API key (\`missing\_api\_key\`, \`invalid\_api\_key\`, \`api\_key\_revoked\`, \`api\_key\_expired\`). **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 429 Rate or concurrency limit reached (\`rate\_limited\`, \`concurrency\_limited\`). Wait \`Retry-After\` seconds. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` - **`RateLimit-Policy`** The limits that apply, e.g. `"minute";q=120;w=60`. `string` - **`RateLimit`** What is left, e.g. `"minute";r=119;t=1` (remaining requests, seconds until full). `string` - **`Retry-After`** Seconds to wait before retrying. `integer` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ##### 500 Unexpected error (\`internal\_error\`). Safe to retry with the same \`Idempotency-Key\`. **Headers:** - **`X-Request-Id`** Unique id of this request; quote it to support. `string` **Content type:** `application/problem+json` [Problem](#scalar-schema-problem) [Generated example](#scalar-example-7) ## Schemas ### DocumentRequest **Type:** `object`, no additional properties - **`text` (required)**: `string`, minLength: `1`, maxLength: `100000` The text to write. Newlines start new lines; blank lines leave a gap. Long text continues on new pages. - **`format`**: `string`, possible values: `"pdf", "png", "svg"`, default: `"pdf"` `pdf`: one file with every page, at the real page size. `png` / `svg`: one file per page; several pages come as a ZIP. - **`hand`**: `string`, default: `"br_119"`, minLength: `1`, maxLength: `64` Hand id. `GET /v1/hands` lists them. - **`ink_color`**: `string`, default: `"#1f3fa6"`, pattern: `^#[0-9a-fA-F]{6}$` Ink colour as `#rrggbb`. - **`ink_flow`**: `number`, default: `0`, minimum: `0`, maximum: `1` Pen pressure, 0 (an even line, the default) to 1: ink pools where the pen lands, the line thins as it lifts off and on fast strokes. - **`ink_texture`**: `number`, default: `0`, minimum: `0`, maximum: `1` Ink imperfections, 0 (flat ink, the default) to 1: crossings darken, ink pools where the pen slows, the paper's grain shows in the ink, and the pen's own quirks (see `pen`). - **`line_spacing_mm`**: `number`, default: `9`, minimum: `3`, maximum: `30` Distance between lines on plain paper, or when `on_lines` is false, in mm. - **`margins_mm`**: `object`, no additional properties Page margins in mm. Each one you leave out uses the paper's own margin. - **`bottom`**: `number`, minimum: `0`, maximum: `100` - **`left`**: `number`, minimum: `0`, maximum: `100` - **`right`**: `number`, minimum: `0`, maximum: `100` - **`top`**: `number`, minimum: `0`, maximum: `100` - **`markdown`**: `boolean`, default: `false` Read `text` as markdown, as the /write editor writes it: `**bold**` (a heavier pen), `*italic*` (leans further), `~~strikethrough~~`, `++underline++` and `==highlight==` (all drawn by hand), `[text]{red}` or `[text]{#c0392b}` (ink colour), `[text]{mark=green}` (highlighter colour: yellow, green, pink, blue, orange), `# Heading` to `### Heading` (larger writing), tables (rows start with `|`, cells between `|`; the `|---|---|` row under the header is optional; each row goes on one line of the paper, lines drawn by hand, the table shrunk to fit between the margins). Styles cover whole words. `\*` writes a literal marker. Off: the text is written exactly as given. - **`mistakes`**: `number`, default: `0`, minimum: `0`, maximum: `1` Crossed-out mistakes, 0-1: now and then a word is started wrong or misspelt, struck through, and written again (1: about one word in twenty; only longer lowercase words). Where they fall depends on `seed`. - **`movement`**: `object`, no additional properties With `natural`: how much each kind of movement varies, 0 to 1 (0.5 when left out). - **`lines`**: `number`, minimum: `0`, maximum: `1` Where each line starts, and its slope. - **`spacing`**: `number`, minimum: `0`, maximum: `1` How far each line sits from its rule. - **`words`**: `number`, minimum: `0`, maximum: `1` Words' height and the gaps between them. - **`natural`**: `boolean`, default: `true` Small random shifts of lines and words, as a real hand makes. - **`on_lines`**: `boolean`, default: `true` Ruled and squared paper: sit every line of writing on a printed rule. - **`page_size`**: `string`, possible values: `"a3", "a4", "a5", "a6", "b5", "letter", "legal", "tabloid", "postcard", "card", "jis-b5", "india-school"`, default: `"a4"` `a3`, `a4`, `a5`, `a6`, `b5` (176 × 250 mm), `letter`, `legal`, `tabloid` (11 × 17 in), `postcard` (4 × 6 in), `card` (5 × 7 in), `jis-b5` (182 × 257 mm) or `india-school` (18 × 24 cm). - **`pages`**: `array`, maxItems: `500` Page numbers to return, from 1. All pages when left out. **Items:** `integer`, minimum: `1`, maximum: `9007199254740991` - **`paper`**: `string`, possible values: `"plain", "college", "wide", "feint", "legal", "squared", "squared10", "dotted", "lineatur27", "lineatur28", "seyes", "russian-grid", "russian-ruled", "indian-ruled"`, default: `"wide"` `plain`, `college` ruled, `wide` ruled, `feint` ruled (8 mm, no margin), `legal` pad (yellow), `squared` (5 mm grid), `squared10` (10 mm grid), `dotted` (dot grid), `lineatur27` (German, 9 mm lined, margins both sides), `lineatur28` (German, 5 mm squared, margins both sides), `seyes` (French Seyès, 8 mm with 2 mm fine rules), `russian-grid` (5 mm grid, margin on the right), `russian-ruled` (8 mm lined, margin on the right) or `indian-ruled` (8 mm lined, red margin and top line). - **`paper_grain`**: `string`, possible values: `"recycled", "smooth", "cold-press"`, default: `"recycled"` Which paper's texture: `recycled` (fine grain, a few fibres), `smooth` (heavy paper) or `cold-press` (watercolour paper). - **`paper_texture`**: `number`, default: `0`, minimum: `0`, maximum: `1` A scanned paper texture over the page, 0 (none, the default) to 1. PNG, SVG and PDF; not with `transparent`. - **`pen`**: `string`, possible values: `"ballpoint", "gel", "fountain"`, default: `"ballpoint"` The pen the ink comes from; shapes `ink_texture`. `ballpoint`: grainy, uneven ink that darkens on turns, with now and then a blob or a skip. `gel`: smooth, dark ink. `fountain`: wet ink, lighter strokes that pool at the ends and turns, soft edges. - **`pen_width`**: `number`, default: `1`, minimum: `0.25`, maximum: `3` Multiplies the pen's line width (1 = a fine pen). - **`quality`**: `string`, possible values: `"standard", "hd", "4k"`, default: `"standard"` PNG only: `standard` 150 dpi, `hd` 300 dpi, `4k` 3840 px across the page's shorter side (A4: 3840 × 5431). - **`seed`**: `integer`, minimum: `0`, maximum: `4294967296` Same seed and settings, same pages. Change it for another take. - **`shading`**: `boolean`, default: `false` Light falls off towards the edges, like a photo of the page. - **`size_mm`**: `number`, minimum: `2`, maximum: `15` Height of tall letters, in mm. Left out: a size that fits the paper's lines (about 0.6 of a line; 5 on plain and wide ruled, 4.5 on college and legal ruled, 6 on squared and dotted). - **`slant`**: `number`, default: `0`, minimum: `-15`, maximum: `15` Lean of the writing in degrees: positive leans forward, negative back. - **`soft_focus`**: `boolean`, default: `false` Slightly out of focus, like a phone photo (in a PDF, the ink). - **`transparent`**: `boolean`, default: `false` PNG only: leave the paper out, ink on a transparent background. - **`variation`**: `number`, default: `0`, minimum: `0`, maximum: `1.5` 0 writes the steadiest version of the hand; higher values vary the letters more. - **`word_spacing`**: `number`, default: `1`, minimum: `0.25`, maximum: `3` Multiplies the gap between words. **Generated example:** ```json { "text": "Dear Anna,\n\nThank you so much for the flowers!\n\nLove, Sam", "markdown": false, "mistakes": 0, "hand": "br_119", "format": "pdf", "page_size": "a4", "paper": "wide", "size_mm": 2, "line_spacing_mm": 9, "on_lines": true, "word_spacing": 1, "margins_mm": { "top": 0, "right": 0, "bottom": 0, "left": 0 }, "natural": true, "variation": 0, "seed": 0, "ink_color": "#1f3fa6", "pen_width": 1, "pen": "ballpoint", "ink_texture": 0, "ink_flow": 0, "slant": 0, "movement": { "words": 0, "lines": 0, "spacing": 0 }, "paper_texture": 0, "paper_grain": "recycled", "shading": false, "soft_focus": false, "quality": "standard", "transparent": false, "pages": [ 1 ] } ``` ### Document **Type:** `object`, no additional properties - **`billed_pages` (required)**: `number` Pages returned and billed. - **`content_type` (required)**: `string` - **`created` (required)**: `number` Unix time in seconds. - **`data` (required)**: `string` The file, base64-encoded. - **`filename` (required)**: `string` - **`format` (required)**: `string`, possible values: `"pdf", "png", "svg"` - **`id` (required)**: `string` - **`livemode` (required)**: `boolean` false for test keys: pages are watermarked and not billed. - **`object` (required)**: `string`, possible values: `"document"` - **`pages` (required)**: `number` Pages in the document. - **`unwritable` (required)**: `array of string` Characters in `text` that no hand can write yet, each once; they are written as `?`. The hands write Latin letters (accents included), numbers and common punctuation. Binary responses send the same as the `X-Unwritable-Characters` header, as code points (`U+00B0 U+0416`). **Generated example:** ```json { "id": "doc_3kd9x0aQ1b2C3d4E", "object": "document", "created": 1795680145, "livemode": true, "format": "pdf", "pages": 2, "billed_pages": 2, "unwritable": [], "filename": "handwriting.pdf", "content_type": "application/pdf", "data": "" } ``` ### HandwritingRequest **Type:** `object`, no additional properties - **`text` (required)**: `string`, minLength: `1`, maxLength: `100000` The text to write. Newlines start new lines; blank lines start paragraphs. - **`format`**: `string`, possible values: `"svg", "strokes"`, default: `"svg"` `svg`: a finished SVG image. `strokes`: raw pen strokes per word, for plotters and custom rendering. - **`hand`**: `string`, default: `"br_119"`, minLength: `1`, maxLength: `64` Hand id. `GET /v1/hands` lists the curated hands with names and previews; any of the 1,743 ids from `GET /v1/hands?all=true` works too. - **`ink_color`**: `string`, pattern: `^#[0-9a-fA-F]{6}$` Ink colour as `#rrggbb`. Default: the hand's own ink. - **`ink_flow`**: `number`, default: `0`, minimum: `0`, maximum: `1` `svg` only: pen pressure, 0 (an even line, the default) to 1: heavier where the pen lands, thinner as it lifts off. - **`ink_texture`**: `number`, default: `0`, minimum: `0`, maximum: `1` `svg` only: ink imperfections, 0 (flat ink, the default) to 1: crossings darken, ink pools where the pen slows, the pen's own quirks. - **`line_width`**: `number`, default: `8`, minimum: `2`, maximum: `20` Line length in the model's units (8 fits a card, 14 a page). - **`pen`**: `string`, possible values: `"ballpoint", "gel", "fountain"`, default: `"ballpoint"` `svg` only: the pen the ink comes from; shapes `ink_texture` (see `POST /v1/documents`). - **`seed`**: `integer`, minimum: `0`, maximum: `4294967296` With `variation` > 0, the same seed gives the same result. - **`soft_focus`**: `boolean`, default: `false` `svg` only: slightly out of focus, like a phone photo. - **`variation`**: `number`, default: `0`, minimum: `0`, maximum: `1.5` 0 writes the steadiest version of the hand; higher values vary the letters more. **Generated example:** ```json { "text": "Dear Anna,\nThank you so much for the flowers!\nLove, Sam", "hand": "br_119", "format": "svg", "ink_color": "#1a237e", "variation": 0, "seed": 0, "line_width": 8, "pen": "ballpoint", "ink_texture": 0, "ink_flow": 0, "soft_focus": false } ``` ### Handwriting **Type:** `object`, no additional properties - **`created` (required)**: `integer`, minimum: `-9007199254740991`, maximum: `9007199254740991` Unix time in seconds. - **`format` (required)**: `string`, possible values: `"svg", "strokes"` - **`hand` (required)**: `string` - **`id` (required)**: `string` - **`livemode` (required)**: `boolean` false for test keys: output is watermarked and not billed. - **`object` (required)**: `string`, possible values: `"handwriting"` - **`pages` (required)**: `number` Pages billed for this request (1 page = up to 150 words). - **`unwritable` (required)**: `array of string` Characters in `text` that no hand can write yet, each once; they are written as `?`. The hands write Latin letters (accents included), numbers and common punctuation. Binary responses send the same as the `X-Unwritable-Characters` header, as code points (`U+00B0 U+0416`). - **`words` (required)**: `integer`, minimum: `-9007199254740991`, maximum: `9007199254740991` - **`strokes`**: `array` Present when `format` is `strokes`: words → strokes → points. **Items:** **Array of:** **Array of:** `array of (number | number)`, minItems: `2`, maxItems: `2` \[x, y] - **`svg`**: `string` Present when `format` is `svg`. **Generated example:** ```json { "id": "hw_3kd9x0aQ1b2C3d4E", "object": "handwriting", "created": 1795680145, "livemode": true, "hand": "br_119", "format": "svg", "words": 12, "pages": 1, "unwritable": [], "svg": "…", "strokes": [ [ [ [ 0.012, -0.034 ] ] ] ] } ``` ### HandList **Type:** `object`, no additional properties - **`data` (required)**: `array` **Items:** no additional properties - **`description` (required)**: `string | null` - **`id` (required)**: `string` - **`name` (required)**: `string | null` Display name of a curated hand; null for the other renderer ids. - **`object` (required)**: `string`, possible values: `"hand"` - **`preview_url` (required)**: `string | null` An SVG sample of the hand. - **`recommended` (required)**: `boolean` One of the clearest hands, a good first choice. - **`style` (required)**: `string | null`, possible values: `"print", "slanted", "cursive"` - **`tags` (required)**: `array` **Items:** `string`, possible values: `"neat", "large", "small", "wide", "narrow", "back-slanted"` - **`has_more` (required)**: `boolean` - **`object` (required)**: `string`, possible values: `"list"` **Generated example:** ```json { "object": "list", "data": [ { "id": "br_119", "object": "hand", "name": "Leo", "style": "cursive", "tags": [ "neat" ], "description": "Neat cursive", "recommended": true, "preview_url": "https://inkhand.app/hands/br_119.svg" } ], "has_more": true } ``` ### Usage **Type:** `object`, no additional properties - **`credits` (required)**: `object`, no additional properties Top-up pages on the account. They never expire; live keys use them after the monthly allowance, test keys never do. - **`pages` (required)**: `number` - **`limits` (required)**: `object`, no additional properties - **`concurrency` (required)**: `integer`, minimum: `-9007199254740991`, maximum: `9007199254740991` - **`pages_per_period` (required)**: `number` - **`requests_per_minute` (required)**: `integer`, minimum: `-9007199254740991`, maximum: `9007199254740991` - **`words_per_request` (required)**: `integer`, minimum: `-9007199254740991`, maximum: `9007199254740991` - **`livemode` (required)**: `boolean` - **`object` (required)**: `string`, possible values: `"usage"` - **`pages` (required)**: `object`, no additional properties The plan's monthly allowance. - **`included` (required)**: `number` - **`remaining` (required)**: `number` - **`used` (required)**: `number` - **`period` (required)**: `object`, no additional properties - **`end` (required)**: `string` ISO 8601 - **`start` (required)**: `string` ISO 8601 - **`plan` (required)**: `string`, possible values: `"free", "pro", "api", "scale"` **Generated example:** ```json { "object": "usage", "livemode": true, "plan": "free", "period": { "start": "2026-11-01T00:00:00.000Z", "end": "2026-12-01T00:00:00.000Z" }, "pages": { "used": 120, "included": 2000, "remaining": 1880 }, "credits": { "pages": 500 }, "limits": { "requests_per_minute": 120, "concurrency": 4, "words_per_request": 5000, "pages_per_period": 1000 } } ``` ### Problem **Type:** `object`, no additional properties - **`code` (required)**: `string` - **`request_id` (required)**: `string` - **`status` (required)**: `integer`, minimum: `-9007199254740991`, maximum: `9007199254740991` - **`title` (required)**: `string` - **`type` (required)**: `string` - **`detail`**: `string` - **`errors`**: `array` Validation errors, for `invalid_request`. **Items:** no additional properties - **`message` (required)**: `string` - **`path` (required)**: `string` **Generated example:** ```json { "type": "https://inkhand.app/docs/api/errors#rate_limited", "title": "", "status": 429, "code": "rate_limited", "detail": "", "request_id": "req_8f2kQ0xZ1yW3vU5t", "errors": [ { "path": "", "message": "" } ] } ```