{
  "openapi": "3.1.0",
  "info": {
    "title": "Shotmint (GPT Action)",
    "version": "1.0.0",
    "description": "Screenshots and page content for custom GPTs. Full API: https://shotmint.creasework.com/openapi.json. Setup guide: https://shotmint.creasework.com/guides/chatgpt-custom-gpt-action."
  },
  "servers": [
    {
      "url": "https://shotmint.creasework.com"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    }
  ],
  "paths": {
    "/v1/content": {
      "get": {
        "operationId": "content",
        "summary": "Read a web page (rendered in Chromium, JavaScript works) and return its main content as Markdown, with title, author and date. PDF URLs work too. Check status: 404 and bot-wall pages still return 200 here. Always send max_chars (50000 or less). 1 credit.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Page to render (http/https; private addresses are refused). A data:text/html,<html> URL (plain or ;base64) is rendered as html. Required unless html is given.",
              "format": "uri"
            }
          },
          {
            "name": "wait_until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Navigation event to wait for. If unset, screenshots wait for load and then up to 2.5 s for the network to go quiet; set load for the fastest capture.",
              "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": "block_ads",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Block common ad, tracker and consent-manager domains and hide cookie-consent banners, including in-house consent overlays. In PDFs it also hides small fixed popups and bars, which Chrome would otherwise print on every page."
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Output format of content.",
              "enum": [
                "markdown",
                "text",
                "html"
              ],
              "default": "markdown"
            }
          },
          {
            "name": "main_content",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Extract only the main article (Mozilla Readability). false, or no article found, returns the whole page body.",
              "default": true
            }
          },
          {
            "name": "links",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Markdown only: false keeps link text but drops link URLs and images (fewer tokens for LLM input).",
              "default": true
            }
          },
          {
            "name": "max_chars",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Cut content to at most this many characters (truncated is then true). Use it when your client limits response size, e.g. ChatGPT Actions (~100,000).",
              "minimum": 1000,
              "maximum": 1000000,
              "default": 50000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page content and metadata.",
            "headers": {
              "X-Credits-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "byline": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "site_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "published_time": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lang": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "main_content": {
                      "type": "boolean"
                    },
                    "format": {
                      "type": "string"
                    },
                    "words": {
                      "type": "integer"
                    },
                    "content": {
                      "type": "string",
                      "description": "Markdown, text or HTML (capped at 1,000,000 characters)."
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "HTTP status of the page itself (null for html input). Check it: a 404 page still returns 200 from the API."
                    },
                    "final_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "URL after redirects."
                    }
                  }
                }
              }
            }
          },
          "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/screenshot/url": {
      "get": {
        "operationId": "screenshotSignedUrl",
        "summary": "Get a screenshot of a web page as a public image URL. Show it to the user with Markdown: ![screenshot](url). The image renders when first loaded (1 credit, repeats free for cache_ttl, 24h by default).",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Page to render (http/https; private addresses are refused). A data:text/html,<html> URL (plain or ;base64) is rendered as html. 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). With html and no height, the image is cropped to the content height."
            }
          },
          {
            "name": "mobile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Emulate a mobile device (isMobile + touch). Without width, the viewport defaults to 390px wide (phone) instead of 1280."
            }
          },
          {
            "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, tracker and consent-manager domains and hide cookie-consent banners, including in-house consent overlays. In PDFs it also hides small fixed popups and bars, which Chrome would otherwise print on every page."
            }
          },
          {
            "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. If unset, screenshots wait for load and then up to 2.5 s for the network to go quiet; set load for the fastest capture.",
              "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)."
            }
          },
          {
            "name": "thumb_width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Scale the output image down to this width in px (keeps the aspect ratio; layout still uses width). For thumbnails: width=1280&thumb_width=320 gives a 320x200 image about 9x smaller than the full 1280x800 PNG.",
              "minimum": 50,
              "maximum": 3840
            }
          },
          {
            "name": "cache_ttl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Signed: how long one render serves this image URL, in seconds. Views within the window are free. 86400 = daily (default), 604800 = weekly, 2592000 = monthly.",
              "minimum": 3600,
              "maximum": 2592000,
              "default": 86400
            }
          }
        ],
        "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/check": {
      "get": {
        "operationId": "checkSite",
        "summary": "Free (0 credits, 500 a day per key): check a site without rendering it. type=up: is it up or down (verdict up, down, error_page or walled, status, total_ms, reason). type=ssl: certificate expiry, days_left, issuer, chain and hostname match. type=redirects: every hop with status and timing. type=headers: security-header grade A+ to F with fixes. type=llms: the site's llms.txt checked against format v2, a sample of its links tested, robots.txt access per AI crawler. type=links: broken links and images on one page (up to 150, internal first; bot walls are reported as blocked, not broken). type=tech: which CMS, framework, hosting/CDN, web server and analytics the site uses, each with the evidence found. type=dns: the domain's DNS records (A, AAAA, CNAME, MX, NS, TXT, CAA, SOA) plus email checks: SPF lookup count (limit 10), DMARC policy, DKIM under common selectors, and an issues list.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Which check to run.",
              "enum": [
                "up",
                "ssl",
                "redirects",
                "headers",
                "links",
                "tech",
                "dns",
                "llms"
              ]
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Site or page to check. A bare domain such as example.com gets https:// prepended. For ssl only the host (and port, 443 or 8443) is used."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Check result. Fields depend on type: up has verdict (up, down, error_page, walled), status, total_ms, summary, reason; ssl has valid_to, days_left, issuer, ok, issues; redirects has hops, redirects, final_url, total_ms, issues; headers has grade, checks and hops; links has total, checked, counts {ok, broken, timeout, blocked, redirect} and links [{url, status, verdict, text}]; llms has verdict (valid, warnings, problems, missing, soft_404, walled, server_error), llms_url, title, summary, sections, links_checked, crawlers, issues [{level, text}].",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "credits_used": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "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"
                }
              }
            }
          },
          "422": {
            "description": "The site could not be reached (DNS, TLS or connection error).",
            "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"
                    },
                    "low": {
                      "type": "boolean",
                      "description": "True when 20 or fewer credits remain."
                    },
                    "topup_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Pricing page with this key prefilled for a top-up."
                    },
                    "created": {
                      "type": "string"
                    },
                    "key_id": {
                      "type": "string"
                    },
                    "monthly_free": {
                      "type": "string"
                    },
                    "next": {
                      "type": "object",
                      "description": "Ready-to-call example URLs (add your key) and links to the docs and spec.",
                      "additionalProperties": {
                        "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"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "topup_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}