{"openapi":"3.1.0","info":{"title":"Kitbag API","version":"0.1.0","description":"Small, fast utilities for people and agents. Keyless; rate-limited per IP."},"servers":[{"url":"https://kitbag.cleartrust.cc"}],"paths":{"/api/password":{"get":{"operationId":"generatePassword","summary":"Generate random passwords","parameters":[{"name":"length","in":"query","required":false,"schema":{"type":"integer","minimum":8,"maximum":128,"default":20},"description":"Characters per password"},{"name":"count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":1},"description":"How many"},{"name":"lower","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Include lower"},{"name":"upper","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Include upper"},{"name":"digits","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Include digits"},{"name":"symbols","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Include symbols"},{"name":"exclude_ambiguous","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Leave out look-alike characters"}],"responses":{"200":{"description":"Passwords with entropy","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/key":{"get":{"operationId":"generateKey","summary":"Generate secrets, JWT keys, API keys, AES keys, TOTP secrets, UUIDs and key pairs","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["secret","jwt","api_key","aes","totp","uuid","rsa","ec","ed25519"],"default":"secret"},"description":"What to generate"},{"name":"count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":20,"default":1},"description":"For secrets and ids"},{"name":"bytes","in":"query","required":false,"schema":{"type":"integer","minimum":16,"maximum":128,"default":32},"description":"secret: size"},{"name":"encoding","in":"query","required":false,"schema":{"type":"string","enum":["hex","base64","base64url"]},"description":"secret, aes"},{"name":"alg","in":"query","required":false,"schema":{"type":"string","enum":["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","EdDSA"]},"description":"jwt"},{"name":"bits","in":"query","required":false,"schema":{"type":"integer"},"description":"aes: 128|192|256, rsa: 2048|3072|4096"},{"name":"curve","in":"query","required":false,"schema":{"type":"string","enum":["P-256","P-384","P-521"]},"description":"ec"},{"name":"version","in":"query","required":false,"schema":{"type":"integer","enum":[4,7]},"description":"uuid"},{"name":"prefix","in":"query","required":false,"schema":{"type":"string"},"description":"api_key prefix"},{"name":"length","in":"query","required":false,"schema":{"type":"integer","minimum":24,"maximum":96},"description":"api_key length"}],"responses":{"200":{"description":"keys[] for secrets and ids; PEM and JWK for key pairs","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/hash":{"post":{"operationId":"hash_text","summary":"Hash text with MD5, SHA-1, SHA-256, SHA-384 or SHA-512, or compute an HMAC when hmac_key is given. algorithm \"all\" returns every digest.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"algorithm":{"type":"string","enum":["md5","sha1","sha256","sha384","sha512","all"],"default":"sha256"},"hmac_key":{"type":"string"},"encoding":{"type":"string","enum":["hex","base64"],"default":"hex"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/bcrypt":{"post":{"operationId":"bcrypt","summary":"Create a bcrypt hash of a password (rounds 4-12, default 10), or check a password against an existing hash by passing hash.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"type":"string"},"rounds":{"type":"integer","minimum":4,"maximum":12,"default":10},"hash":{"type":"string","description":"Existing bcrypt hash to verify against."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/encode":{"post":{"operationId":"encode_decode","summary":"Encode or decode text as Base64, Base64URL, URL (percent) encoding, HTML entities, hex, or a JSON string literal (json: escape text into a quoted JSON string, or unescape one).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","format"],"properties":{"text":{"type":"string"},"format":{"type":"string","enum":["base64","base64url","url","html","hex","json"]},"action":{"type":"string","enum":["encode","decode"],"default":"encode"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/data":{"post":{"operationId":"convert_data","summary":"Validate, format or convert structured data between JSON, YAML and CSV. Same from and to formats and validates; indent 0 minifies JSON.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"},"from":{"type":"string","enum":["json","yaml","csv"],"default":"json"},"to":{"type":"string","enum":["json","yaml","csv"],"default":"json"},"indent":{"type":["integer","string"],"default":2,"description":"0-8 spaces, or \"tab\". JSON output only."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/jwt":{"post":{"operationId":"decode_jwt","summary":"Decode a JWT into header and payload with readable issue and expiry times. Pass key (HMAC secret, PEM public key or public JWK) to also verify the signature.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"key":{"type":"string","description":"Optional. Secret for HS*, PEM public key or JWK for RS*/PS*/ES*/EdDSA."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/regex":{"post":{"operationId":"test_regex","summary":"Run a JavaScript regular expression against text. Returns every match with index and capture groups, and the replaced text when replacement is given.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pattern","text"],"properties":{"pattern":{"type":"string"},"flags":{"type":"string","description":"Any of d g i m s u v y. g is always applied."},"text":{"type":"string"},"replacement":{"type":"string","description":"Optional. Supports $1, $<name>."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/cron":{"post":{"operationId":"explain_cron","summary":"Explain a five-field cron expression (or @daily style macro) in plain English and list its next run times in UTC.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expression"],"properties":{"expression":{"type":"string"},"count":{"type":"integer","minimum":1,"maximum":50,"default":5}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/timestamp":{"post":{"operationId":"convert_timestamp","summary":"Convert a Unix timestamp (seconds, milliseconds, microseconds or nanoseconds) or a date string into Unix, ISO 8601 and RFC 2822 forms. Empty value means now.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","description":"Timestamp or date. Omit for the current time."},"timezone":{"type":"string","description":"Optional IANA zone, e.g. Asia/Kolkata."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/diff":{"post":{"operationId":"diff_text","summary":"Compare two texts line by line. Returns a unified diff with counts of added and removed lines.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","description":"Original text."},"b":{"type":"string","description":"Changed text."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/markdown":{"post":{"operationId":"url_to_markdown","summary":"Fetch a public web page and return its main content as clean Markdown (or plain text), with title, byline and word count. Does not run JavaScript.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"},"format":{"type":"string","enum":["markdown","text"],"default":"markdown"},"mode":{"type":"string","enum":["article","full"],"default":"article","description":"article extracts the main content; full converts the whole body."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/screenshot":{"post":{"operationId":"screenshot_url","summary":"Take a screenshot of a public web page in a real browser. Returns a download link to a PNG or JPEG valid for 15 minutes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"},"width":{"type":"integer","minimum":320,"maximum":1920,"default":1280},"height":{"type":"integer","minimum":200,"maximum":2000,"default":800},"full_page":{"type":"boolean","default":false},"format":{"type":"string","enum":["png","jpeg"],"default":"png"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/dns":{"post":{"operationId":"dns_lookup","summary":"Look up DNS records for a domain: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA, or one type.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"type":{"type":"string","enum":["ALL","A","AAAA","CNAME","MX","NS","TXT","SOA","CAA"],"default":"ALL"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/whois":{"post":{"operationId":"whois_lookup","summary":"Domain registration details: registrar, creation and expiry dates, status, nameservers and DNSSEC, from RDAP with WHOIS as fallback.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/ssl":{"post":{"operationId":"ssl_certificate","summary":"Inspect the TLS certificate a host serves: trust, expiry and days remaining, issuer, covered names, protocol, cipher and chain.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["host"],"properties":{"host":{"type":"string"},"port":{"type":"integer","enum":[443,465,636,853,993,995,8443],"default":443}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/headers":{"post":{"operationId":"http_headers","summary":"Follow a URL through its redirect chain and return each hop with status and timing, the final response headers and a security-header check.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/meta":{"post":{"operationId":"inspect_meta","summary":"Inspect a page's title, meta description, canonical, robots, Open Graph and Twitter tags, hreflang and JSON-LD structured data, with a list of what to fix.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/robots":{"post":{"operationId":"check_robots_txt","summary":"Fetch and validate a site's robots.txt: groups, sitemaps, syntax errors, and whether search and AI crawlers (Googlebot, GPTBot, ClaudeBot, PerplexityBot…) are allowed. Optionally test one path for one user agent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"path":{"type":"string","description":"Optional path to test, e.g. /private/page."},"user_agent":{"type":"string","description":"Crawler to test the path for. Default Googlebot."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/adstxt":{"post":{"operationId":"check_ads_txt","summary":"Fetch and validate a publisher's ads.txt or app-ads.txt against the IAB spec: record counts, DIRECT vs RESELLER, ad systems, invalid lines, duplicates and OWNERDOMAIN/MANAGERDOMAIN.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"type":{"type":"string","enum":["ads","app-ads"],"default":"ads"}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/sitemap":{"post":{"operationId":"check_sitemap","summary":"Validate an XML sitemap or sitemap index: entry count, size limits, URL and lastmod format, duplicates. Give a sitemap URL, or a domain to find it via robots.txt.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Sitemap URL or a domain."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/email-auth":{"post":{"operationId":"check_email_dns","summary":"Check a domain's email authentication: MX, SPF (syntax, DNS-lookup count, all qualifier), DKIM (given selector or common ones) and DMARC policy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string"},"selector":{"type":"string","description":"DKIM selector to check. Omit to try common selectors."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/links":{"post":{"operationId":"check_links","summary":"Find broken links on a web page: checks up to 100 links and reports broken ones, redirects and links that refuse automated checks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":100,"default":50}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/convert":{"post":{"operationId":"convertDocument","summary":"Convert a document to PDF, or a PDF to DOCX","parameters":[{"name":"to","in":"query","required":true,"schema":{"type":"string","enum":["pdf","docx"]},"description":"Target format"},{"name":"name","in":"query","required":false,"schema":{"type":"string"},"description":"Source file name with extension (when sending a body)"},{"name":"url","in":"query","required":false,"schema":{"type":"string"},"description":"Public URL of the source file (instead of a body)"},{"name":"link","in":"query","required":false,"schema":{"type":"string","enum":["1"]},"description":"Return JSON with a download link instead of the file"}],"requestBody":{"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The converted file, or JSON when link=1"}}}},"/api/pagespeed":{"get":{"operationId":"checkPageSpeed","summary":"Full Lighthouse audit of a public URL","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"},"description":"Page to test"},{"name":"strategy","in":"query","required":false,"schema":{"type":"string","enum":["mobile","desktop"],"default":"mobile"},"description":"Device profile"},{"name":"screenshots","in":"query","required":false,"schema":{"type":"string","enum":["1"]},"description":"Include screenshot and filmstrip as data URIs"}],"responses":{"200":{"description":"Scores, metrics, page weight and failed audits","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}