{
  "openapi": "3.1.0",
  "info": {
    "title": "Shotmint API",
    "version": "1.0.0",
    "description": "Screenshot, PDF and Open Graph image rendering API. Pay as you go with prepaid credits that never expire (€5 = 2,000 renders, €19 = 10,000 renders, €59 = 50,000 renders); no subscription, no signup. 1 credit per successful render. Get a free key (100 renders) with POST /v1/keys/free. Docs: https://shotmint.creasework.com/docs",
    "contact": {
      "url": "https://shotmint.creasework.com/contact"
    },
    "termsOfService": "https://shotmint.creasework.com/terms"
  },
  "servers": [
    {
      "url": "https://shotmint.creasework.com"
    }
  ],
  "externalDocs": {
    "url": "https://shotmint.creasework.com/docs"
  },
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "Bearer": []
    },
    {
      "ApiKeyQuery": []
    }
  ],
  "paths": {
    "/v1/keys/free": {
      "post": {
        "operationId": "createFreeKey",
        "summary": "Create a free API key with 100 credits (no signup, one per IP per 24h).",
        "security": [],
        "responses": {
          "200": {
            "description": "New key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "credits": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Already created a free key from this IP in the last 24h.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/screenshot": {
      "get": {
        "operationId": "screenshot",
        "summary": "Screenshot a URL or HTML as PNG, JPEG or WebP.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Page to render (http/https; private addresses are refused). Required unless html is given.",
              "format": "uri"
            }
          },
          {
            "name": "html",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Raw HTML to render instead of a URL (max 2 MB)."
            }
          },
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Viewport width in px.",
              "minimum": 200,
              "maximum": 3840,
              "default": 1280
            }
          },
          {
            "name": "wait_until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Navigation event to wait for.",
              "enum": [
                "load",
                "domcontentloaded",
                "networkidle"
              ],
              "default": "load"
            }
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Extra wait after load, in ms.",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "hide_selectors",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Comma-separated CSS selectors to hide before rendering (cookie banners, chat widgets)."
            }
          },
          {
            "name": "dark_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Emulate prefers-color-scheme: dark."
            }
          },
          {
            "name": "block_ads",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Block common ad and tracker domains."
            }
          },
          {
            "name": "user_agent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Custom User-Agent string (max 300 chars)."
            }
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Viewport height in px.",
              "minimum": 200,
              "maximum": 4000,
              "default": 800
            }
          },
          {
            "name": "full_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Capture the whole scrollable page (up to 16,000 px tall)."
            }
          },
          {
            "name": "selector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "CSS selector: capture only this element."
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Image format.",
              "enum": [
                "png",
                "jpeg",
                "webp"
              ],
              "default": "png"
            }
          },
          {
            "name": "quality",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "JPEG/WebP quality.",
              "minimum": 10,
              "maximum": 100,
              "default": 80
            }
          },
          {
            "name": "omit_background",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Transparent background (png/webp)."
            }
          },
          {
            "name": "device_scale_factor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Pixel density (2 = retina).",
              "minimum": 1,
              "maximum": 3,
              "default": 1
            }
          },
          {
            "name": "mobile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Emulate a mobile device (isMobile + touch)."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The image.",
            "headers": {
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of credits; the body includes topup_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Render failed (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "screenshotPost",
        "summary": "Screenshot with a JSON body (use for large html).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Page to render (http/https; private addresses are refused). Required unless html is given.",
                    "format": "uri"
                  },
                  "html": {
                    "type": "string",
                    "description": "Raw HTML to render instead of a URL (max 2 MB)."
                  },
                  "width": {
                    "type": "integer",
                    "description": "Viewport width in px.",
                    "minimum": 200,
                    "maximum": 3840,
                    "default": 1280
                  },
                  "wait_until": {
                    "type": "string",
                    "description": "Navigation event to wait for.",
                    "enum": [
                      "load",
                      "domcontentloaded",
                      "networkidle"
                    ],
                    "default": "load"
                  },
                  "delay": {
                    "type": "integer",
                    "description": "Extra wait after load, in ms.",
                    "minimum": 0,
                    "maximum": 10000,
                    "default": 0
                  },
                  "hide_selectors": {
                    "type": "string",
                    "description": "Comma-separated CSS selectors to hide before rendering (cookie banners, chat widgets)."
                  },
                  "dark_mode": {
                    "type": "boolean",
                    "description": "Emulate prefers-color-scheme: dark."
                  },
                  "block_ads": {
                    "type": "boolean",
                    "description": "Block common ad and tracker domains."
                  },
                  "user_agent": {
                    "type": "string",
                    "description": "Custom User-Agent string (max 300 chars)."
                  },
                  "height": {
                    "type": "integer",
                    "description": "Viewport height in px.",
                    "minimum": 200,
                    "maximum": 4000,
                    "default": 800
                  },
                  "full_page": {
                    "type": "boolean",
                    "description": "Capture the whole scrollable page (up to 16,000 px tall)."
                  },
                  "selector": {
                    "type": "string",
                    "description": "CSS selector: capture only this element."
                  },
                  "format": {
                    "type": "string",
                    "description": "Image format.",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp"
                    ],
                    "default": "png"
                  },
                  "quality": {
                    "type": "integer",
                    "description": "JPEG/WebP quality.",
                    "minimum": 10,
                    "maximum": 100,
                    "default": 80
                  },
                  "omit_background": {
                    "type": "boolean",
                    "description": "Transparent background (png/webp)."
                  },
                  "device_scale_factor": {
                    "type": "integer",
                    "description": "Pixel density (2 = retina).",
                    "minimum": 1,
                    "maximum": 3,
                    "default": 1
                  },
                  "mobile": {
                    "type": "boolean",
                    "description": "Emulate a mobile device (isMobile + touch)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The image.",
            "headers": {
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of credits; the body includes topup_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Render failed (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pdf": {
      "get": {
        "operationId": "pdf",
        "summary": "Render a URL or HTML to PDF.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Page to render (http/https; private addresses are refused). Required unless html is given.",
              "format": "uri"
            }
          },
          {
            "name": "html",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Raw HTML to render instead of a URL (max 2 MB)."
            }
          },
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Viewport width in px.",
              "minimum": 200,
              "maximum": 3840,
              "default": 1280
            }
          },
          {
            "name": "wait_until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Navigation event to wait for.",
              "enum": [
                "load",
                "domcontentloaded",
                "networkidle"
              ],
              "default": "load"
            }
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Extra wait after load, in ms.",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "hide_selectors",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Comma-separated CSS selectors to hide before rendering (cookie banners, chat widgets)."
            }
          },
          {
            "name": "dark_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Emulate prefers-color-scheme: dark."
            }
          },
          {
            "name": "block_ads",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Block common ad and tracker domains."
            }
          },
          {
            "name": "user_agent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Custom User-Agent string (max 300 chars)."
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Paper size.",
              "enum": [
                "A3",
                "A4",
                "A5",
                "Letter",
                "Legal",
                "Tabloid"
              ],
              "default": "A4"
            }
          },
          {
            "name": "landscape",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Landscape orientation."
            }
          },
          {
            "name": "margin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Margin on all sides, e.g. 10mm, 0.5in, 20px.",
              "default": "10mm"
            }
          },
          {
            "name": "print_background",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Print background colors and images.",
              "default": true
            }
          },
          {
            "name": "scale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "Content scale.",
              "minimum": 0.1,
              "maximum": 2,
              "default": 1
            }
          },
          {
            "name": "screen_media",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Use screen CSS instead of print CSS."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF.",
            "headers": {
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of credits; the body includes topup_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Render failed (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "pdfPost",
        "summary": "Render to PDF with a JSON body (use for html such as invoices).",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Page to render (http/https; private addresses are refused). Required unless html is given.",
                    "format": "uri"
                  },
                  "html": {
                    "type": "string",
                    "description": "Raw HTML to render instead of a URL (max 2 MB)."
                  },
                  "width": {
                    "type": "integer",
                    "description": "Viewport width in px.",
                    "minimum": 200,
                    "maximum": 3840,
                    "default": 1280
                  },
                  "wait_until": {
                    "type": "string",
                    "description": "Navigation event to wait for.",
                    "enum": [
                      "load",
                      "domcontentloaded",
                      "networkidle"
                    ],
                    "default": "load"
                  },
                  "delay": {
                    "type": "integer",
                    "description": "Extra wait after load, in ms.",
                    "minimum": 0,
                    "maximum": 10000,
                    "default": 0
                  },
                  "hide_selectors": {
                    "type": "string",
                    "description": "Comma-separated CSS selectors to hide before rendering (cookie banners, chat widgets)."
                  },
                  "dark_mode": {
                    "type": "boolean",
                    "description": "Emulate prefers-color-scheme: dark."
                  },
                  "block_ads": {
                    "type": "boolean",
                    "description": "Block common ad and tracker domains."
                  },
                  "user_agent": {
                    "type": "string",
                    "description": "Custom User-Agent string (max 300 chars)."
                  },
                  "format": {
                    "type": "string",
                    "description": "Paper size.",
                    "enum": [
                      "A3",
                      "A4",
                      "A5",
                      "Letter",
                      "Legal",
                      "Tabloid"
                    ],
                    "default": "A4"
                  },
                  "landscape": {
                    "type": "boolean",
                    "description": "Landscape orientation."
                  },
                  "margin": {
                    "type": "string",
                    "description": "Margin on all sides, e.g. 10mm, 0.5in, 20px.",
                    "default": "10mm"
                  },
                  "print_background": {
                    "type": "boolean",
                    "description": "Print background colors and images.",
                    "default": true
                  },
                  "scale": {
                    "type": "number",
                    "description": "Content scale.",
                    "minimum": 0.1,
                    "maximum": 2,
                    "default": 1
                  },
                  "screen_media": {
                    "type": "boolean",
                    "description": "Use screen CSS instead of print CSS."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The PDF.",
            "headers": {
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of credits; the body includes topup_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Render failed (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/og": {
      "get": {
        "operationId": "ogImage",
        "summary": "Render a 1200x630 Open Graph card. Identical repeats within 24h are cached and free.",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Card title."
            }
          },
          {
            "name": "subtitle",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Card subtitle."
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Site name or domain shown on the card."
            }
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Color theme.",
              "enum": [
                "indigo",
                "dark",
                "light",
                "sunset",
                "mint"
              ],
              "default": "indigo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PNG card.",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Out of credits; the body includes topup_url.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Render failed (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/og/url": {
      "get": {
        "operationId": "ogSignedUrl",
        "summary": "Free: get a signed public URL for an OG card to use as og:image without exposing the key.",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Card title."
            }
          },
          {
            "name": "subtitle",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Card subtitle."
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Site name or domain shown on the card."
            }
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Color theme.",
              "enum": [
                "indigo",
                "dark",
                "light",
                "sunset",
                "mint"
              ],
              "default": "indigo"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed public URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "key_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/screenshot/url": {
      "get": {
        "operationId": "screenshotSignedUrl",
        "summary": "Free: get a signed public screenshot URL to embed in <img> (website thumbnails). 1 credit per new render; repeats cached 24h.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Page to render (http/https; private addresses are refused). Required unless html is given.",
              "format": "uri"
            }
          },
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Viewport width in px.",
              "minimum": 200,
              "maximum": 3840,
              "default": 1280
            }
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Viewport height in px.",
              "minimum": 200,
              "maximum": 4000,
              "default": 800
            }
          },
          {
            "name": "full_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Capture the whole scrollable page (up to 16,000 px tall)."
            }
          },
          {
            "name": "mobile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Emulate a mobile device (isMobile + touch)."
            }
          },
          {
            "name": "device_scale_factor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Pixel density (2 = retina).",
              "minimum": 1,
              "maximum": 3,
              "default": 1
            }
          },
          {
            "name": "block_ads",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Block common ad and tracker domains."
            }
          },
          {
            "name": "dark_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Emulate prefers-color-scheme: dark."
            }
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Extra wait after load, in ms.",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "wait_until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Navigation event to wait for.",
              "enum": [
                "load",
                "domcontentloaded",
                "networkidle"
              ],
              "default": "load"
            }
          },
          {
            "name": "hide_selectors",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Comma-separated CSS selectors to hide before rendering (cookie banners, chat widgets)."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed public URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "key_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters (no credit charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "account",
        "summary": "Remaining credits for this key.",
        "responses": {
          "200": {
            "description": "Balance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credits": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "string"
                    },
                    "key_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "Bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "access_key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "topup_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}