{
    "openapi": "3.0.3",
    "info": {
        "title": "Bloodweb Microservices API",
        "version": "1.0.0",
        "description": "Small pay-per-call APIs for everyday file and data jobs. Send your API key as a Bearer token. Every successful call costs tokens (see x-tokens on each operation); failed calls cost nothing. Responses carry X-Tokens (what the call cost) and X-Balance (what is left).",
        "termsOfService": "https://bloodweb.net/microservices/terms",
        "contact": {
            "name": "Bloodweb support",
            "email": "support@bloodweb.net",
            "url": "https://bloodweb.net/microservices/docs"
        }
    },
    "servers": [
        {
            "url": "https://bloodweb.net/api/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Media"
        },
        {
            "name": "Codes"
        },
        {
            "name": "Data"
        },
        {
            "name": "Shipping"
        },
        {
            "name": "Images"
        },
        {
            "name": "PDF"
        },
        {
            "name": "Account"
        }
    ],
    "paths": {
        "/audio-convert": {
            "post": {
                "operationId": "audioConvertPost",
                "tags": [
                    "Media"
                ],
                "summary": "Audio converter",
                "description": "Convert audio between MP3, OGG, Opus, M4A, WAV and FLAC. Trim it, make it mono, or change the sample rate. The audio track of an MP4 or WebM video works too, so it doubles as a way to pull the sound out of a clip. Costs 1,085 tokens per minute.",
                "x-tokens": {
                    "tokens": 1085,
                    "per": "minute"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "mp3",
                                            "ogg",
                                            "opus",
                                            "m4a",
                                            "wav",
                                            "flac"
                                        ],
                                        "description": "Output format.",
                                        "example": "mp3"
                                    },
                                    "bitrate": {
                                        "type": "integer",
                                        "minimum": 32,
                                        "maximum": 320,
                                        "default": 192,
                                        "description": "kbps, for MP3, OGG, Opus and M4A. 128 is fine for speech, 192 or more for music.",
                                        "example": 128
                                    },
                                    "channels": {
                                        "type": "string",
                                        "enum": [
                                            "keep",
                                            "mono",
                                            "stereo"
                                        ],
                                        "default": "keep",
                                        "description": "Keep the channels, or mix to mono or stereo."
                                    },
                                    "sample_rate": {
                                        "type": "string",
                                        "enum": [
                                            "keep",
                                            "8000",
                                            "16000",
                                            "22050",
                                            "24000",
                                            "32000",
                                            "44100",
                                            "48000"
                                        ],
                                        "default": "keep",
                                        "description": "Hz. Opus only takes 8000, 16000, 24000 or 48000; other values become 48000."
                                    },
                                    "start": {
                                        "type": "number",
                                        "minimum": 0,
                                        "description": "Start at this many seconds in."
                                    },
                                    "duration": {
                                        "type": "number",
                                        "minimum": 0.1,
                                        "description": "Keep this many seconds."
                                    },
                                    "normalize": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Even out the loudness to -16 LUFS, the usual level for podcasts and voice."
                                    },
                                    "fade_in": {
                                        "type": "number",
                                        "minimum": 0,
                                        "maximum": 30,
                                        "description": "Fade in over this many seconds."
                                    },
                                    "fade_out": {
                                        "type": "number",
                                        "minimum": 0,
                                        "maximum": 30,
                                        "description": "Fade out over this many seconds at the end."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The audio, up to 50MB and 30 minutes: mp3, wav, ogg, flac, m4a, mp4, aac, webm (the audio track of an MP4 or WebM is used)."
                                    }
                                },
                                "required": [
                                    "to",
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The converted audio. X-Duration gives its length in seconds.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "audio/mpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "audio/ogg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "audio/mp4": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "audio/wav": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "audio/flac": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/barcode-generate": {
            "get": {
                "operationId": "barcodeGenerateGet",
                "tags": [
                    "Codes"
                ],
                "summary": "Barcode generator",
                "description": "Make product and shipping barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, ITF-14 and Codabar, as PNG or SVG. Bars are drawn on whole pixels with a proper quiet zone either side, so labels scan first time. Use a bar width of 2 or more for printing. Costs 38 tokens per call.",
                "x-tokens": {
                    "tokens": 38,
                    "per": "call"
                },
                "parameters": [
                    {
                        "name": "data",
                        "in": "query",
                        "required": true,
                        "description": "What to encode. For EAN and UPC, leave off the check digit and it is added; include it and it is verified.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "590123412345"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "Symbology.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "code128",
                                "code39",
                                "code93",
                                "ean13",
                                "ean8",
                                "upca",
                                "upce",
                                "itf14",
                                "codabar"
                            ],
                            "default": "code128"
                        },
                        "example": "ean13"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "Image format.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "png",
                                "svg"
                            ],
                            "default": "png"
                        }
                    },
                    {
                        "name": "bar_width",
                        "in": "query",
                        "required": false,
                        "description": "Width of the narrowest bar in pixels. 2 or more for printing.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10,
                            "default": 2
                        }
                    },
                    {
                        "name": "height",
                        "in": "query",
                        "required": false,
                        "description": "Bar height in pixels.",
                        "schema": {
                            "type": "integer",
                            "minimum": 10,
                            "maximum": 1000,
                            "default": 80
                        }
                    },
                    {
                        "name": "text",
                        "in": "query",
                        "required": false,
                        "description": "Print the human-readable value under the bars.",
                        "schema": {
                            "type": "boolean",
                            "default": true
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "required": false,
                        "description": "Bar colour.",
                        "schema": {
                            "type": "string",
                            "default": "#000000"
                        }
                    },
                    {
                        "name": "background",
                        "in": "query",
                        "required": false,
                        "description": "Background colour, or \"transparent\".",
                        "schema": {
                            "type": "string",
                            "default": "#ffffff"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "image/png or image/svg+xml, with a quiet zone of ten bar widths each side.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/svg+xml": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            },
            "post": {
                "operationId": "barcodeGeneratePost",
                "tags": [
                    "Codes"
                ],
                "summary": "Barcode generator",
                "description": "Make product and shipping barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, ITF-14 and Codabar, as PNG or SVG. Bars are drawn on whole pixels with a proper quiet zone either side, so labels scan first time. Use a bar width of 2 or more for printing. Costs 38 tokens per call.",
                "x-tokens": {
                    "tokens": 38,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "data": {
                                        "type": "string",
                                        "description": "What to encode. For EAN and UPC, leave off the check digit and it is added; include it and it is verified.",
                                        "example": "590123412345"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "code128",
                                            "code39",
                                            "code93",
                                            "ean13",
                                            "ean8",
                                            "upca",
                                            "upce",
                                            "itf14",
                                            "codabar"
                                        ],
                                        "default": "code128",
                                        "description": "Symbology.",
                                        "example": "ean13"
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "png",
                                            "svg"
                                        ],
                                        "default": "png",
                                        "description": "Image format."
                                    },
                                    "bar_width": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 10,
                                        "default": 2,
                                        "description": "Width of the narrowest bar in pixels. 2 or more for printing."
                                    },
                                    "height": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 1000,
                                        "default": 80,
                                        "description": "Bar height in pixels."
                                    },
                                    "text": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Print the human-readable value under the bars."
                                    },
                                    "color": {
                                        "type": "string",
                                        "default": "#000000",
                                        "description": "Bar colour."
                                    },
                                    "background": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "Background colour, or \"transparent\"."
                                    }
                                },
                                "required": [
                                    "data"
                                ]
                            },
                            "example": {
                                "data": "590123412345",
                                "type": "ean13"
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "data": {
                                        "type": "string",
                                        "description": "What to encode. For EAN and UPC, leave off the check digit and it is added; include it and it is verified.",
                                        "example": "590123412345"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "code128",
                                            "code39",
                                            "code93",
                                            "ean13",
                                            "ean8",
                                            "upca",
                                            "upce",
                                            "itf14",
                                            "codabar"
                                        ],
                                        "default": "code128",
                                        "description": "Symbology.",
                                        "example": "ean13"
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "png",
                                            "svg"
                                        ],
                                        "default": "png",
                                        "description": "Image format."
                                    },
                                    "bar_width": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 10,
                                        "default": 2,
                                        "description": "Width of the narrowest bar in pixels. 2 or more for printing."
                                    },
                                    "height": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 1000,
                                        "default": 80,
                                        "description": "Bar height in pixels."
                                    },
                                    "text": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Print the human-readable value under the bars."
                                    },
                                    "color": {
                                        "type": "string",
                                        "default": "#000000",
                                        "description": "Bar colour."
                                    },
                                    "background": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "Background colour, or \"transparent\"."
                                    }
                                },
                                "required": [
                                    "data"
                                ]
                            },
                            "example": {
                                "data": "590123412345",
                                "type": "ean13"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "image/png or image/svg+xml, with a quiet zone of ten bar widths each side.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/svg+xml": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/color-convert": {
            "get": {
                "operationId": "colorConvertGet",
                "tags": [
                    "Data"
                ],
                "summary": "Colour converter",
                "description": "Convert a colour between hex, RGB, HSL, HSV, CMYK and CIE Lab, find its nearest CSS name, and check WCAG contrast against another colour. Give it a brand colour and it also tells you whether black or white text reads better on top of it. Costs 14 tokens per call.",
                "x-tokens": {
                    "tokens": 14,
                    "per": "call"
                },
                "parameters": [
                    {
                        "name": "color",
                        "in": "query",
                        "required": true,
                        "description": "Any of: #c0392b, #c0392b80, rgb(192, 57, 43), rgba(...), hsl(6, 63%, 46%), hsv(6, 78%, 75%), cmyk(0%, 70%, 78%, 25%), or a CSS name such as tomato.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "#c0392b"
                    },
                    {
                        "name": "contrast_with",
                        "in": "query",
                        "required": false,
                        "description": "A second colour, in any of the same forms. Adds the WCAG 2 contrast ratio and pass or fail for AA and AAA.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "white"
                    },
                    {
                        "name": "scheme",
                        "in": "query",
                        "required": false,
                        "description": "Also return a matching set of colours built from this one.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "complementary",
                                "analogous",
                                "triadic",
                                "split",
                                "tetradic",
                                "shades",
                                "tints"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON: hex, rgb, hsl, hsv, cmyk, lab (each as numbers and as a CSS string where CSS has one), name (exact CSS name or null), nearest_name, luminance, best_text (black or white), and contrast when asked.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            },
            "post": {
                "operationId": "colorConvertPost",
                "tags": [
                    "Data"
                ],
                "summary": "Colour converter",
                "description": "Convert a colour between hex, RGB, HSL, HSV, CMYK and CIE Lab, find its nearest CSS name, and check WCAG contrast against another colour. Give it a brand colour and it also tells you whether black or white text reads better on top of it. Costs 14 tokens per call.",
                "x-tokens": {
                    "tokens": 14,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "color": {
                                        "type": "string",
                                        "description": "Any of: #c0392b, #c0392b80, rgb(192, 57, 43), rgba(...), hsl(6, 63%, 46%), hsv(6, 78%, 75%), cmyk(0%, 70%, 78%, 25%), or a CSS name such as tomato.",
                                        "example": "#c0392b"
                                    },
                                    "contrast_with": {
                                        "type": "string",
                                        "description": "A second colour, in any of the same forms. Adds the WCAG 2 contrast ratio and pass or fail for AA and AAA.",
                                        "example": "white"
                                    },
                                    "scheme": {
                                        "type": "string",
                                        "enum": [
                                            "complementary",
                                            "analogous",
                                            "triadic",
                                            "split",
                                            "tetradic",
                                            "shades",
                                            "tints"
                                        ],
                                        "description": "Also return a matching set of colours built from this one."
                                    }
                                },
                                "required": [
                                    "color"
                                ]
                            },
                            "example": {
                                "color": "#c0392b",
                                "contrast_with": "white"
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "color": {
                                        "type": "string",
                                        "description": "Any of: #c0392b, #c0392b80, rgb(192, 57, 43), rgba(...), hsl(6, 63%, 46%), hsv(6, 78%, 75%), cmyk(0%, 70%, 78%, 25%), or a CSS name such as tomato.",
                                        "example": "#c0392b"
                                    },
                                    "contrast_with": {
                                        "type": "string",
                                        "description": "A second colour, in any of the same forms. Adds the WCAG 2 contrast ratio and pass or fail for AA and AAA.",
                                        "example": "white"
                                    },
                                    "scheme": {
                                        "type": "string",
                                        "enum": [
                                            "complementary",
                                            "analogous",
                                            "triadic",
                                            "split",
                                            "tetradic",
                                            "shades",
                                            "tints"
                                        ],
                                        "description": "Also return a matching set of colours built from this one."
                                    }
                                },
                                "required": [
                                    "color"
                                ]
                            },
                            "example": {
                                "color": "#c0392b",
                                "contrast_with": "white"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON: hex, rgb, hsl, hsv, cmyk, lab (each as numbers and as a CSS string where CSS has one), name (exact CSS name or null), nearest_name, luminance, best_text (black or white), and contrast when asked.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/csv-json": {
            "post": {
                "operationId": "csvJsonPost",
                "tags": [
                    "Data"
                ],
                "summary": "CSV and JSON converter",
                "description": "Convert CSV to JSON or JSON to CSV. Handles quoted fields, line breaks inside cells, semicolon and tab files, BOMs and nested JSON. Turn on excel_safe when the CSV is headed for a spreadsheet: cells that start with = or + are then never run as formulas. Costs 64 tokens per call. Limits: 10MB and 100,000 rows.",
                "x-tokens": {
                    "tokens": 64,
                    "per": "call"
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "description": "The CSV or JSON to convert.",
                                        "example": "sku,qty\nPEN-1,2\nINK-3,5"
                                    },
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "json",
                                            "csv"
                                        ],
                                        "description": "Output. Defaults to the opposite of what was sent."
                                    },
                                    "delimiter": {
                                        "type": "string",
                                        "enum": [
                                            "auto",
                                            "comma",
                                            "semicolon",
                                            "tab",
                                            "pipe"
                                        ],
                                        "default": "auto",
                                        "description": "CSV delimiter. auto detects it when reading; writing defaults to comma."
                                    },
                                    "header": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "CSV to JSON: the first row holds column names, giving an array of objects. Off gives an array of arrays."
                                    },
                                    "types": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "CSV to JSON: turn numbers, true/false and empty cells into JSON numbers, booleans and null. Off keeps every value as text."
                                    },
                                    "excel_safe": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "JSON to CSV: prefix cells starting with = + - @ with an apostrophe, so spreadsheets do not run them as formulas."
                                    },
                                    "bom": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "JSON to CSV: start with a UTF-8 byte order mark, which Excel needs to show accents correctly."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Optional: the CSV or JSON as a file, up to 10MB, instead of the text parameter."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "application/json (an array) or text/csv. Nested JSON objects become dotted columns such as address.city.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            },
                            "text/csv": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/currency-convert": {
            "get": {
                "operationId": "currencyConvertGet",
                "tags": [
                    "Data"
                ],
                "summary": "Currency converter",
                "description": "Convert between about 30 currencies using the European Central Bank's daily reference rates. Rates update once each working day, around 16:00 Central European Time. They are reference rates for information, not the rate a bank or card will give. Costs 19 tokens per call. Limits: Reference rates are for information. They are not the rate a bank or card will give.",
                "x-tokens": {
                    "tokens": 19,
                    "per": "call"
                },
                "parameters": [
                    {
                        "name": "amount",
                        "in": "query",
                        "required": false,
                        "description": "The amount to convert.",
                        "schema": {
                            "type": "number",
                            "default": 1
                        },
                        "example": 100
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "Three-letter currency code, such as AUD.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "AUD"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "One or more codes, comma separated. Leave out for every currency.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "USD,INR"
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "A past date as YYYY-MM-DD, for that day's rates (back to 4 January 1999). Weekends and holidays use the last working day before. Leave out for the latest.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON: amount, from, date (the publication date of the rates used), rates and results per currency, source, and stale: true when the source could not be reached and older rates were used.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            },
            "post": {
                "operationId": "currencyConvertPost",
                "tags": [
                    "Data"
                ],
                "summary": "Currency converter",
                "description": "Convert between about 30 currencies using the European Central Bank's daily reference rates. Rates update once each working day, around 16:00 Central European Time. They are reference rates for information, not the rate a bank or card will give. Costs 19 tokens per call. Limits: Reference rates are for information. They are not the rate a bank or card will give.",
                "x-tokens": {
                    "tokens": 19,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "amount": {
                                        "type": "number",
                                        "default": 1,
                                        "description": "The amount to convert.",
                                        "example": 100
                                    },
                                    "from": {
                                        "type": "string",
                                        "description": "Three-letter currency code, such as AUD.",
                                        "example": "AUD"
                                    },
                                    "to": {
                                        "type": "string",
                                        "description": "One or more codes, comma separated. Leave out for every currency.",
                                        "example": "USD,INR"
                                    },
                                    "date": {
                                        "type": "string",
                                        "description": "A past date as YYYY-MM-DD, for that day's rates (back to 4 January 1999). Weekends and holidays use the last working day before. Leave out for the latest."
                                    }
                                },
                                "required": [
                                    "from"
                                ]
                            },
                            "example": {
                                "amount": 100,
                                "from": "AUD",
                                "to": "USD,INR"
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "amount": {
                                        "type": "number",
                                        "default": 1,
                                        "description": "The amount to convert.",
                                        "example": 100
                                    },
                                    "from": {
                                        "type": "string",
                                        "description": "Three-letter currency code, such as AUD.",
                                        "example": "AUD"
                                    },
                                    "to": {
                                        "type": "string",
                                        "description": "One or more codes, comma separated. Leave out for every currency.",
                                        "example": "USD,INR"
                                    },
                                    "date": {
                                        "type": "string",
                                        "description": "A past date as YYYY-MM-DD, for that day's rates (back to 4 January 1999). Weekends and holidays use the last working day before. Leave out for the latest."
                                    }
                                },
                                "required": [
                                    "from"
                                ]
                            },
                            "example": {
                                "amount": 100,
                                "from": "AUD",
                                "to": "USD,INR"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON: amount, from, date (the publication date of the rates used), rates and results per currency, source, and stale: true when the source could not be reached and older rates were used.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/customs-description-check": {
            "get": {
                "operationId": "customsDescriptionCheckGet",
                "tags": [
                    "Shipping"
                ],
                "summary": "Customs description checker",
                "description": "Check customs goods descriptions before you ship. Flags the vague wording EU customs (ICS2) rejects, category-only descriptions, product codes and missing materials. Send up to 50 descriptions at once. It is advice on wording, not a customs ruling, and it does not pick tariff codes. Costs 33 tokens per call. Limits: Advice on wording only. It is not a customs ruling or a tariff classification.",
                "x-tokens": {
                    "tokens": 33,
                    "per": "call"
                },
                "parameters": [
                    {
                        "name": "descriptions",
                        "in": "query",
                        "required": true,
                        "description": "One description per line, or a JSON array. Up to 50.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "Gifts"
                    },
                    {
                        "name": "max_length",
                        "in": "query",
                        "required": false,
                        "description": "Flag descriptions longer than this many characters and show where they would be cut.",
                        "schema": {
                            "type": "integer",
                            "minimum": 10,
                            "maximum": 500,
                            "default": 40
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON: results with description, level (good, warn or bad), issues, tips, cut (the shortened text, or null) and length; plus a summary count per level.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            },
            "post": {
                "operationId": "customsDescriptionCheckPost",
                "tags": [
                    "Shipping"
                ],
                "summary": "Customs description checker",
                "description": "Check customs goods descriptions before you ship. Flags the vague wording EU customs (ICS2) rejects, category-only descriptions, product codes and missing materials. Send up to 50 descriptions at once. It is advice on wording, not a customs ruling, and it does not pick tariff codes. Costs 33 tokens per call. Limits: Advice on wording only. It is not a customs ruling or a tariff classification.",
                "x-tokens": {
                    "tokens": 33,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "descriptions": {
                                        "type": "string",
                                        "description": "One description per line, or a JSON array. Up to 50.",
                                        "example": "Gifts"
                                    },
                                    "max_length": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 500,
                                        "default": 40,
                                        "description": "Flag descriptions longer than this many characters and show where they would be cut."
                                    }
                                },
                                "required": [
                                    "descriptions"
                                ]
                            },
                            "example": {
                                "descriptions": "Gifts"
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "descriptions": {
                                        "type": "string",
                                        "description": "One description per line, or a JSON array. Up to 50.",
                                        "example": "Gifts"
                                    },
                                    "max_length": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 500,
                                        "default": 40,
                                        "description": "Flag descriptions longer than this many characters and show where they would be cut."
                                    }
                                },
                                "required": [
                                    "descriptions"
                                ]
                            },
                            "example": {
                                "descriptions": "Gifts"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON: results with description, level (good, warn or bad), issues, tips, cut (the shortened text, or null) and length; plus a summary count per level.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/favicon-generate": {
            "post": {
                "operationId": "faviconGeneratePost",
                "tags": [
                    "Images"
                ],
                "summary": "Favicon generator",
                "description": "Turn one image into a full favicon set: favicon.ico, PNG sizes, the Apple touch icon, Android icons, site.webmanifest and the HTML tags. Send a square logo of at least 512 pixels for the sharpest result. Non-square images are centred, and the Apple icon gets a solid background because iOS shows transparent ones on black. Costs 415 tokens per call.",
                "x-tokens": {
                    "tokens": 415,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "padding": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 40,
                                        "default": 0,
                                        "description": "Space around the image, as a percentage of the icon size."
                                    },
                                    "background": {
                                        "type": "string",
                                        "default": "transparent",
                                        "description": "Icon background, or \"transparent\"."
                                    },
                                    "apple_background": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "Background for the Apple touch icon, which iOS shows on a black square when transparent."
                                    },
                                    "name": {
                                        "type": "string",
                                        "default": "My site",
                                        "description": "App name for site.webmanifest.",
                                        "example": "My site"
                                    },
                                    "theme_color": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "theme_color for site.webmanifest."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "A square image works best, at least 512px: jpg, png, gif, webp, bmp, tiff, heic, avif, ico. Non-square images are centred."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A zip: favicon.ico (16, 32, 48), favicon-16x16.png, favicon-32x32.png, apple-touch-icon.png (180), android-chrome-192x192.png, android-chrome-512x512.png, site.webmanifest, favicon-tags.html.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/html-to-pdf": {
            "post": {
                "operationId": "htmlToPdfPost",
                "tags": [
                    "PDF"
                ],
                "summary": "HTML to PDF",
                "description": "Turn HTML and CSS into a PDF: invoices, receipts, reports, tickets. Rendered by Chromium, so modern CSS (flexbox, grid, web fonts) works. Keep the HTML self-contained: styles inline, and images and fonts as data URIs. For safety, scripts do not run and nothing is fetched from the internet. Costs 500 tokens per call. Limits: HTML up to 5MB. Scripts do not run and nothing is fetched from the network.",
                "x-tokens": {
                    "tokens": 500,
                    "per": "call"
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "html": {
                                        "type": "string",
                                        "description": "The HTML. It must be self-contained: inline <style>, and images and fonts as data: URIs. Remote files and scripts are not loaded.",
                                        "example": "<h1>Invoice 1001</h1><p>Total due: US$42.00</p>"
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "A3",
                                            "A4",
                                            "A5",
                                            "Letter",
                                            "Legal",
                                            "Tabloid"
                                        ],
                                        "default": "A4",
                                        "description": "Paper size. When format, landscape and margin are all left out, the page's own CSS @page rule decides.",
                                        "example": "A4"
                                    },
                                    "landscape": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Landscape orientation."
                                    },
                                    "margin": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 50,
                                        "default": 10,
                                        "description": "Page margin in millimetres."
                                    },
                                    "background": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Print background colours and images."
                                    },
                                    "page_numbers": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Print \"Page 1 of 3\" at the bottom centre of every page."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Optional: an .html file instead of the html parameter, up to 5MB."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A PDF.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/image-compress": {
            "post": {
                "operationId": "imageCompressPost",
                "tags": [
                    "Images"
                ],
                "summary": "Image compressor",
                "description": "Shrink an image for the web: lower quality, strip metadata, cap the width, or switch to WebP or AVIF. A target size is the easy way to meet an upload limit: ask for 200KB and you get the best quality that fits. Costs 172 tokens per call.",
                "x-tokens": {
                    "tokens": 172,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100,
                                        "default": 75,
                                        "description": "Lower is smaller. 70 to 80 is a good range for photos.",
                                        "example": 75
                                    },
                                    "max_width": {
                                        "type": "integer",
                                        "minimum": 16,
                                        "maximum": 8000,
                                        "description": "Shrink wider images to this width. Never enlarges."
                                    },
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "jpg",
                                            "png",
                                            "webp",
                                            "avif",
                                            "gif",
                                            "tiff",
                                            "bmp"
                                        ],
                                        "description": "Output format. Defaults to the input format (HEIC becomes JPG).",
                                        "example": "webp"
                                    },
                                    "target_kb": {
                                        "type": "integer",
                                        "minimum": 5,
                                        "maximum": 20000,
                                        "description": "Aim for a file no bigger than this many kilobytes. The highest quality that fits is used (JPG, WebP and AVIF). If even the lowest quality is too big, set max_width as well."
                                    },
                                    "lossy_png": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Reduce PNGs to 256 colours. Much smaller for graphics and screenshots; not for photos."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The image, up to 25MB: jpg, png, gif, webp, bmp, tiff, heic, avif, ico."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The smaller image. X-Original-Bytes and X-Output-Bytes give both sizes; X-Quality the quality used, and X-Target-Met whether target_kb was reached. When compression would not help, the original comes back unchanged with X-Kept-Original: true.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/jpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/webp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/avif": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/gif": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/tiff": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/bmp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/image-convert": {
            "post": {
                "operationId": "imageConvertPost",
                "tags": [
                    "Images"
                ],
                "summary": "Image converter",
                "description": "Convert an image to JPG, PNG, WebP, AVIF, GIF, TIFF or BMP. Reads HEIC (iPhone photos) and ICO too. Most people need it for iPhone photos: HEIC files that websites and older software cannot open. Send one in and get a JPG back. Costs 160 tokens per call.",
                "x-tokens": {
                    "tokens": 160,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "jpg",
                                            "png",
                                            "webp",
                                            "avif",
                                            "gif",
                                            "tiff",
                                            "bmp"
                                        ],
                                        "description": "The output format.",
                                        "example": "jpg"
                                    },
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100,
                                        "default": 85,
                                        "description": "For JPG, WebP and AVIF."
                                    },
                                    "strip": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Remove metadata such as camera details and GPS location."
                                    },
                                    "background": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "Fills transparent areas when the output format has no transparency (JPG, BMP)."
                                    },
                                    "rotate": {
                                        "type": "string",
                                        "enum": [
                                            "0",
                                            "90",
                                            "180",
                                            "270"
                                        ],
                                        "default": "0",
                                        "description": "Turn the image clockwise, in degrees, after it is put the right way up."
                                    },
                                    "flip": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "horizontal",
                                            "vertical"
                                        ],
                                        "default": "none",
                                        "description": "Mirror the image."
                                    },
                                    "grayscale": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Convert to black and white."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The image, up to 25MB: jpg, png, gif, webp, bmp, tiff, heic, avif, ico."
                                    }
                                },
                                "required": [
                                    "to",
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The converted image. Animated GIF and WebP stay animated when converted to GIF or WebP.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/jpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/webp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/avif": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/gif": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/tiff": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/bmp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/image-metadata": {
            "post": {
                "operationId": "imageMetadataPost",
                "tags": [
                    "Images"
                ],
                "summary": "Image metadata reader",
                "description": "Read an image's format, dimensions, frames and colour details, plus EXIF camera data, date taken and GPS location. Phones store where a photo was taken inside the file. This shows exactly what a photo gives away before you share it; the image converter removes it. Costs 87 tokens per call.",
                "x-tokens": {
                    "tokens": 87,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "raw": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Also return every EXIF field as found."
                                    },
                                    "palette": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 10,
                                        "default": 0,
                                        "description": "Also return this many dominant colours, as hex with the share of the image each covers."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The image, up to 25MB: jpg, png, gif, webp, bmp, tiff, heic, avif, ico."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON: format, width, height, frames, colorspace, has_alpha, bit_depth, orientation, bytes, camera, taken_at, exposure, gps (null when absent).",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/image-resize": {
            "post": {
                "operationId": "imageResizePost",
                "tags": [
                    "Images"
                ],
                "summary": "Image resizer",
                "description": "Resize an image to fit inside a box, fill it and crop, fit and pad, or stretch to exact dimensions. Ask for a box and pick how the image fills it. Cover suits thumbnails and grids; pad suits product photos that must not be cropped. Costs 145 tokens per call.",
                "x-tokens": {
                    "tokens": 145,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "width": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 8000,
                                        "description": "Target width in pixels. Give width, height or both.",
                                        "example": 800
                                    },
                                    "height": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 8000,
                                        "description": "Target height in pixels.",
                                        "example": 800
                                    },
                                    "fit": {
                                        "type": "string",
                                        "enum": [
                                            "inside",
                                            "cover",
                                            "pad",
                                            "exact"
                                        ],
                                        "default": "inside",
                                        "description": "inside: fit within the box, keeping proportions. cover: fill the box and crop the overflow from the centre. pad: fit within the box and fill the rest with the background. exact: stretch to the box. cover, pad and exact need both width and height.",
                                        "example": "cover"
                                    },
                                    "gravity": {
                                        "type": "string",
                                        "enum": [
                                            "center",
                                            "top",
                                            "bottom",
                                            "left",
                                            "right",
                                            "top-left",
                                            "top-right",
                                            "bottom-left",
                                            "bottom-right"
                                        ],
                                        "default": "center",
                                        "description": "Which part of the image to keep when fit=cover crops it."
                                    },
                                    "upscale": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Allow enlarging an image smaller than the box (inside and pad)."
                                    },
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "jpg",
                                            "png",
                                            "webp",
                                            "avif",
                                            "gif",
                                            "tiff",
                                            "bmp"
                                        ],
                                        "description": "Output format. Defaults to the input format (HEIC becomes JPG, ICO becomes PNG)."
                                    },
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100,
                                        "default": 85,
                                        "description": "For JPG, WebP and AVIF."
                                    },
                                    "background": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "Padding colour for fit=pad, or \"transparent\" where the format allows it."
                                    },
                                    "strip": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Remove metadata."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The image, up to 25MB: jpg, png, gif, webp, bmp, tiff, heic, avif, ico."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The resized image. X-Image-Width and X-Image-Height give its final size.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/jpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/webp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/avif": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/gif": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/tiff": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/bmp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/images-to-pdf": {
            "post": {
                "operationId": "imagesToPdfPost",
                "tags": [
                    "PDF"
                ],
                "summary": "Images to PDF",
                "description": "Combine photos, scans or receipts into one PDF, one image per page, in the order sent. Send the images in the order you want the pages. Transparent images get a white background. Costs 96 tokens per image.",
                "x-tokens": {
                    "tokens": 96,
                    "per": "image"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "page": {
                                        "type": "string",
                                        "enum": [
                                            "A4",
                                            "Letter",
                                            "Legal",
                                            "A5",
                                            "fit"
                                        ],
                                        "default": "A4",
                                        "description": "Paper size, or fit to make each page the size of its image."
                                    },
                                    "margin": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 50,
                                        "default": 10,
                                        "description": "Margin in millimetres (ignored for fit)."
                                    },
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 30,
                                        "maximum": 100,
                                        "default": 85,
                                        "description": "JPEG quality of the images inside the PDF."
                                    },
                                    "files": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        },
                                        "description": "1 to 20 images, up to 25MB each (send as files[]): jpg, png, gif, webp, bmp, tiff, heic, avif, ico."
                                    }
                                },
                                "required": [
                                    "files"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A PDF. Pages turn landscape for landscape images.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/pdf-compress": {
            "post": {
                "operationId": "pdfCompressPost",
                "tags": [
                    "PDF"
                ],
                "summary": "PDF compressor",
                "description": "Make a PDF smaller by downsampling its images. Choose how far: screen (smallest), ebook, printer or prepress. Made for scanned documents and image-heavy PDFs. Text-only PDFs are usually small already. Costs 54 tokens per page.",
                "x-tokens": {
                    "tokens": 54,
                    "per": "page"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "level": {
                                        "type": "string",
                                        "enum": [
                                            "screen",
                                            "ebook",
                                            "printer",
                                            "prepress"
                                        ],
                                        "default": "ebook",
                                        "description": "screen: images at 72 DPI, smallest. ebook: 150 DPI, good for email. printer: 300 DPI. prepress: 300 DPI, colour kept for print shops.",
                                        "example": "ebook"
                                    },
                                    "grayscale": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Convert everything to shades of grey. Often halves a scanned colour document again."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The PDF, up to 50MB."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The smaller PDF, with X-Original-Bytes and X-Output-Bytes. If it would not get smaller, the original comes back with X-Kept-Original: true.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/pdf-merge": {
            "post": {
                "operationId": "pdfMergePost",
                "tags": [
                    "PDF"
                ],
                "summary": "PDF merger",
                "description": "Combine up to 20 PDFs into one, in the order you send them. Pages are copied as they are, with no loss of quality. Text stays selectable and file sizes stay close to the originals, because nothing is redrawn. Costs 68 tokens per file.",
                "x-tokens": {
                    "tokens": 68,
                    "per": "file"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "files": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        },
                                        "description": "2 to 20 PDFs, up to 50MB each (send as files[] in a multipart form)."
                                    }
                                },
                                "required": [
                                    "files"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "One PDF. X-Page-Count gives its page count.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/pdf-split": {
            "post": {
                "operationId": "pdfSplitPost",
                "tags": [
                    "PDF"
                ],
                "summary": "PDF splitter",
                "description": "Extract pages into a new PDF, remove pages, or split a PDF into one file per page. Pages are copied rather than redrawn, so quality and selectable text are kept. Costs 9 tokens per page. Limits: 500 pages per call.",
                "x-tokens": {
                    "tokens": 9,
                    "per": "page"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "extract",
                                            "remove",
                                            "each"
                                        ],
                                        "default": "extract",
                                        "description": "extract: a PDF of the chosen pages, in the order given. remove: the PDF without the chosen pages. each: a zip with one PDF per chosen page.",
                                        "example": "extract"
                                    },
                                    "pages": {
                                        "type": "string",
                                        "description": "Pages such as 1-3,5 or 8- (to the end). Required for extract and remove; each defaults to all pages.",
                                        "example": "2-4"
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The PDF, up to 50MB."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A PDF (extract, remove) or a zip of single-page PDFs (each).",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "application/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/pdf-to-image": {
            "post": {
                "operationId": "pdfToImagePost",
                "tags": [
                    "PDF"
                ],
                "summary": "PDF to image",
                "description": "Render PDF pages as PNG, JPG or WebP images at the resolution you choose. Good for thumbnails and previews. For thumbnails, set a width such as 240 pixels and every page comes back exactly that wide. Costs 118 tokens per page. Limits: 50 pages per call. Very large pages render at a lower DPI so no side passes 10,000 pixels.",
                "x-tokens": {
                    "tokens": 118,
                    "per": "page"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "pages": {
                                        "type": "string",
                                        "default": "1",
                                        "description": "Pages to render, such as 1-3,5 or all.",
                                        "example": "1"
                                    },
                                    "dpi": {
                                        "type": "integer",
                                        "minimum": 36,
                                        "maximum": 300,
                                        "default": 150,
                                        "description": "Resolution. 72 for thumbnails, 150 for screens, 300 for print.",
                                        "example": 72
                                    },
                                    "width": {
                                        "type": "integer",
                                        "minimum": 16,
                                        "maximum": 4000,
                                        "description": "Render each page this many pixels wide instead of by DPI, keeping proportions. Handy for thumbnails."
                                    },
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "png",
                                            "jpg",
                                            "webp"
                                        ],
                                        "default": "png",
                                        "description": "Image format."
                                    },
                                    "quality": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100,
                                        "default": 85,
                                        "description": "For JPG and WebP."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The PDF, up to 50MB."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "One page: the image. Several pages: a zip of page-1.png, page-2.png and so on.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/jpeg": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/webp": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "application/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/pdf-to-text": {
            "post": {
                "operationId": "pdfToTextPost",
                "tags": [
                    "PDF"
                ],
                "summary": "PDF to text",
                "description": "Extract the text from a PDF, keeping the layout or as plain reading order, for all pages or a range. Layout mode suits tables and invoices, where columns matter. Reading order suits articles and search. Costs 16 tokens per page. Limits: 500 pages per call.",
                "x-tokens": {
                    "tokens": 16,
                    "per": "page"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "pages": {
                                        "type": "string",
                                        "default": "all",
                                        "description": "Pages to read, such as 1-3,5 or 8- (to the end).",
                                        "example": "1-3"
                                    },
                                    "layout": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Keep the physical layout (columns and tables stay lined up). Off gives plain reading order."
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "text",
                                            "json"
                                        ],
                                        "default": "text",
                                        "description": "text: one plain-text body, pages separated by form feeds. json: {\"pages\": [{\"page\": 1, \"text\": \"...\"}]}."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The PDF, up to 50MB."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "text/plain or JSON. A scanned PDF has no text layer and returns empty text (X-Text-Found: false).",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/qr-generate": {
            "get": {
                "operationId": "qrGenerateGet",
                "tags": [
                    "Codes"
                ],
                "summary": "QR code generator",
                "description": "Make a QR code from a URL or text, as PNG or SVG, in your colours, with your logo in the centre if you like. Codes are drawn on whole pixels, so they stay sharp and scan reliably. Adding a logo raises error correction automatically to keep them readable. Costs 41 tokens per call. Limits: data up to 2,000 characters.",
                "x-tokens": {
                    "tokens": 41,
                    "per": "call"
                },
                "parameters": [
                    {
                        "name": "data",
                        "in": "query",
                        "required": true,
                        "description": "What the code holds: a URL, text, a vCard, a Wi-Fi string.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "https://example.com"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "Image format.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "png",
                                "svg"
                            ],
                            "default": "png"
                        }
                    },
                    {
                        "name": "size",
                        "in": "query",
                        "required": false,
                        "description": "Width and height in pixels, including the margin.",
                        "schema": {
                            "type": "integer",
                            "minimum": 64,
                            "maximum": 2048,
                            "default": 512
                        },
                        "example": 300
                    },
                    {
                        "name": "margin",
                        "in": "query",
                        "required": false,
                        "description": "Quiet zone around the code, in modules. Scanners want 4; less works on plain backgrounds.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 10,
                            "default": 4
                        }
                    },
                    {
                        "name": "ecc",
                        "in": "query",
                        "required": false,
                        "description": "Error correction: L 7%, M 15%, Q 25%, H 30%. Higher survives damage or a logo, but makes a denser code.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "L",
                                "M",
                                "Q",
                                "H"
                            ],
                            "default": "M"
                        }
                    },
                    {
                        "name": "color",
                        "in": "query",
                        "required": false,
                        "description": "Module colour.",
                        "schema": {
                            "type": "string",
                            "default": "#000000"
                        }
                    },
                    {
                        "name": "background",
                        "in": "query",
                        "required": false,
                        "description": "Background colour, or \"transparent\".",
                        "schema": {
                            "type": "string",
                            "default": "#ffffff"
                        }
                    },
                    {
                        "name": "logo_size",
                        "in": "query",
                        "required": false,
                        "description": "Logo width as a percentage of the code. Bigger logos are harder to scan.",
                        "schema": {
                            "type": "integer",
                            "minimum": 10,
                            "maximum": 30,
                            "default": 22
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "image/png or image/svg+xml.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/svg+xml": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            },
            "post": {
                "operationId": "qrGeneratePost",
                "tags": [
                    "Codes"
                ],
                "summary": "QR code generator",
                "description": "Make a QR code from a URL or text, as PNG or SVG, in your colours, with your logo in the centre if you like. Codes are drawn on whole pixels, so they stay sharp and scan reliably. Adding a logo raises error correction automatically to keep them readable. Costs 41 tokens per call. Limits: data up to 2,000 characters.",
                "x-tokens": {
                    "tokens": 41,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "data": {
                                        "type": "string",
                                        "description": "What the code holds: a URL, text, a vCard, a Wi-Fi string.",
                                        "example": "https://example.com"
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "png",
                                            "svg"
                                        ],
                                        "default": "png",
                                        "description": "Image format."
                                    },
                                    "size": {
                                        "type": "integer",
                                        "minimum": 64,
                                        "maximum": 2048,
                                        "default": 512,
                                        "description": "Width and height in pixels, including the margin.",
                                        "example": 300
                                    },
                                    "margin": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 10,
                                        "default": 4,
                                        "description": "Quiet zone around the code, in modules. Scanners want 4; less works on plain backgrounds."
                                    },
                                    "ecc": {
                                        "type": "string",
                                        "enum": [
                                            "L",
                                            "M",
                                            "Q",
                                            "H"
                                        ],
                                        "default": "M",
                                        "description": "Error correction: L 7%, M 15%, Q 25%, H 30%. Higher survives damage or a logo, but makes a denser code."
                                    },
                                    "color": {
                                        "type": "string",
                                        "default": "#000000",
                                        "description": "Module colour."
                                    },
                                    "background": {
                                        "type": "string",
                                        "default": "#ffffff",
                                        "description": "Background colour, or \"transparent\"."
                                    },
                                    "logo_size": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 30,
                                        "default": 22,
                                        "description": "Logo width as a percentage of the code. Bigger logos are harder to scan."
                                    },
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Optional, POST only: an image to place in the centre, up to 5MB. Error correction is raised to H so the code still scans."
                                    }
                                },
                                "required": [
                                    "data"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "image/png or image/svg+xml.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "image/png": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            },
                            "image/svg+xml": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/unit-convert": {
            "get": {
                "operationId": "unitConvertGet",
                "tags": [
                    "Data"
                ],
                "summary": "Unit converter",
                "description": "Convert between 104 units of length, mass, volume, area, temperature, speed, time, data, pressure, energy, power and angle. Factors are the exact definitions where one exists: an inch is exactly 25.4 mm and a pound exactly 0.45359237 kg. Costs 12 tokens per call.",
                "x-tokens": {
                    "tokens": 12,
                    "per": "call"
                },
                "parameters": [
                    {
                        "name": "value",
                        "in": "query",
                        "required": true,
                        "description": "The amount to convert.",
                        "schema": {
                            "type": "number"
                        },
                        "example": 5
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": true,
                        "description": "The unit it is in: a symbol (kg, mph, GiB) or a name (pounds, fahrenheit).",
                        "schema": {
                            "type": "string"
                        },
                        "example": "lb"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "The unit to convert to. Leave out for every unit in the same category.",
                        "schema": {
                            "type": "string"
                        },
                        "example": "kg"
                    },
                    {
                        "name": "precision",
                        "in": "query",
                        "required": false,
                        "description": "Round results to this many decimal places. Left out, results keep 12 significant figures.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 12
                        },
                        "example": 4
                    }
                ],
                "responses": {
                    "200": {
                        "description": "JSON: {\"value\", \"from\", \"to\", \"result\", \"category\"}, or \"results\" for every unit when \"to\" is left out.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            },
            "post": {
                "operationId": "unitConvertPost",
                "tags": [
                    "Data"
                ],
                "summary": "Unit converter",
                "description": "Convert between 104 units of length, mass, volume, area, temperature, speed, time, data, pressure, energy, power and angle. Factors are the exact definitions where one exists: an inch is exactly 25.4 mm and a pound exactly 0.45359237 kg. Costs 12 tokens per call.",
                "x-tokens": {
                    "tokens": 12,
                    "per": "call"
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "value": {
                                        "type": "number",
                                        "description": "The amount to convert.",
                                        "example": 5
                                    },
                                    "from": {
                                        "type": "string",
                                        "description": "The unit it is in: a symbol (kg, mph, GiB) or a name (pounds, fahrenheit).",
                                        "example": "lb"
                                    },
                                    "to": {
                                        "type": "string",
                                        "description": "The unit to convert to. Leave out for every unit in the same category.",
                                        "example": "kg"
                                    },
                                    "precision": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 12,
                                        "description": "Round results to this many decimal places. Left out, results keep 12 significant figures.",
                                        "example": 4
                                    }
                                },
                                "required": [
                                    "value",
                                    "from"
                                ]
                            },
                            "example": {
                                "value": 5,
                                "from": "lb",
                                "to": "kg"
                            }
                        },
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "value": {
                                        "type": "number",
                                        "description": "The amount to convert.",
                                        "example": 5
                                    },
                                    "from": {
                                        "type": "string",
                                        "description": "The unit it is in: a symbol (kg, mph, GiB) or a name (pounds, fahrenheit).",
                                        "example": "lb"
                                    },
                                    "to": {
                                        "type": "string",
                                        "description": "The unit to convert to. Leave out for every unit in the same category.",
                                        "example": "kg"
                                    },
                                    "precision": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 12,
                                        "description": "Round results to this many decimal places. Left out, results keep 12 significant figures.",
                                        "example": 4
                                    }
                                },
                                "required": [
                                    "value",
                                    "from"
                                ]
                            },
                            "example": {
                                "value": 5,
                                "from": "lb",
                                "to": "kg"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON: {\"value\", \"from\", \"to\", \"result\", \"category\"}, or \"results\" for every unit when \"to\" is left out.",
                        "headers": {
                            "X-Tokens": {
                                "$ref": "#/components/headers/X-Tokens"
                            },
                            "X-Balance": {
                                "$ref": "#/components/headers/X-Balance"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error400"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "402": {
                        "$ref": "#/components/responses/Error402"
                    },
                    "413": {
                        "$ref": "#/components/responses/Error413"
                    },
                    "415": {
                        "$ref": "#/components/responses/Error415"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error422"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    },
                    "500": {
                        "$ref": "#/components/responses/Error500"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error503"
                    }
                }
            }
        },
        "/account": {
            "get": {
                "operationId": "account",
                "summary": "Your balance",
                "description": "The balance of the account the key belongs to, and the free tokens it gets each month. Costs nothing.",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "The account.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "balance": {
                                            "type": "integer",
                                            "description": "Tokens left."
                                        },
                                        "free_monthly": {
                                            "type": "integer",
                                            "description": "Free tokens added each month while the account is in use."
                                        },
                                        "dashboard": {
                                            "type": "string",
                                            "format": "uri"
                                        },
                                        "buy": {
                                            "type": "string",
                                            "format": "uri"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Error401"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error429"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "An API key from https://bloodweb.net/microservices/dashboard, starting with bw_live_."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "description": "A stable code, such as bad_param."
                            },
                            "message": {
                                "type": "string",
                                "description": "What went wrong, in plain words."
                            }
                        }
                    }
                }
            }
        },
        "responses": {
            "Error400": {
                "description": "The request is missing something or a value is wrong.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error401": {
                "description": "The API key is missing, unknown or revoked.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error402": {
                "description": "The account does not have enough tokens for this call.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error413": {
                "description": "The upload is larger than this service accepts.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error415": {
                "description": "The file is not a type this service accepts.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error422": {
                "description": "The file could not be processed, for example a damaged or password-protected PDF.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error429": {
                "description": "Too many calls. Retry-After says how many seconds to wait.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error500": {
                "description": "Something went wrong on our side.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Error503": {
                "description": "The service is busy. Try again in a few seconds.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "headers": {
            "X-Tokens": {
                "description": "Tokens this call cost.",
                "schema": {
                    "type": "integer"
                }
            },
            "X-Balance": {
                "description": "The account balance after this call.",
                "schema": {
                    "type": "integer"
                }
            },
            "X-RateLimit-Remaining": {
                "description": "Calls left for this key in the current minute.",
                "schema": {
                    "type": "integer"
                }
            }
        }
    }
}