{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"TeX402","version":"1.0.0","summary":"Deterministic, container-isolated LaTeX-to-PDF compilation, 150-DPI PNG page previews, and sub-300ms ChkTeX + draftmode linting gated by the x402 v2 HTTP payment protocol.","description":"## Overview\n**TeX402** is an agent-native, x402-monetized LaTeX compilation and static/dynamic diagnostics microservice.\nEvery compilation or lint job executes inside an ephemeral, pre-warmed, networkless Docker container (`tex402-worker:latest`) running as `65534:65534` (`nobody:nogroup`) with a read-only root filesystem, an isolated `tmpfs` `/work` scratchpad (`rw,noexec,nosuid,size=128m`), paranoid Kpathsea policy (`shell_escape = f`, `openin_any = p`, `openout_any = p`, `parse_first_line = f`), neutralized LuaTeX binaries (`chmod 000`), and a hard 15-second kill timeout.\n\n## x402 v2 Payment Flow & Pricing\n| Endpoint | Method | Price (USDC) | Atomic Units (6 decimals) | Description |\n| --- | --- | --- | --- | --- |\n| `/v1/compile` | `POST` | **$0.008** | `8000` | Full multi-pass `pdflatex` / `xelatex` compilation with `biber` / `bibtex`, base64 PDF, optional 150-DPI PNG previews, and structured diagnostics |\n| `/v1/lint` | `POST` | **$0.002** | `2000` | Concurrent `chktex` static linting + single-pass `-draftmode` validation in `<300ms` |\n| `/` | `GET` | Free | `0` | Developer landing page, live environment badge, endpoint pricing, and MCP / SDK quickstarts |\n| `/skill.md` | `GET` | Free | `0` | Ready-to-install Agent Skill file (`SKILL.md` with YAML frontmatter) for Claude Code, Cursor, Antigravity, Windsurf & AgentCash |\n| `/llms.txt` | `GET` | Free | `0` | Concise `llms.txt` Markdown discovery index for AI coding agents |\n| `/llms-full.txt` | `GET` | Free | `0` | Complete single-file LLM integration guide (schemas, `@x402/fetch` client, `tex402-mcp` config) |\n| `/.well-known/mcp.json` | `GET` | Free | `0` | Model Context Protocol (MCP) Server Card for `npx -y tex402-mcp` |\n| `/.well-known/api-catalog` | `GET` | Free | `0` | RFC 9727 / RFC 9264 `application/linkset+json` API catalog |\n| `/health` | `GET` | Free | `0` | Liveness, x402 mode/network/recipient, and Docker worker pool readiness & queue telemetry |\n| `/.well-known/x402` | `GET` | Free | `0` | x402 v2 Bazaar discovery metadata & MCP tool definitions |\n| `/openapi.json` | `GET` | Free | `0` | OpenAPI 3.1.0 machine-readable specification |\n| `/docs` | `GET` | Free | `0` | Interactive Swagger UI documentation explorer |\n\n### Authentication / Payment Modes\n1. **Production / Testnet x402 Payment (`PAYMENT-SIGNATURE` header)**:\n   - Send an unpaid request first; TeX402 returns `HTTP 402 Payment Required` with a base64-encoded JSON `PAYMENT-REQUIRED` header advertising the `exact` EVM scheme (`eip155:84532` Base Sepolia or `eip155:8453` Base Mainnet), `payTo` address, atomic USDC `amount`, and `@x402/extensions/bazaar` input/output schemas.\n   - Sign an EIP-3009 `TransferWithAuthorization` payload via `@x402/fetch` (`wrapFetchWithPayment`) and retry with the base64-encoded `PAYMENT-SIGNATURE` header. On settlement, TeX402 returns `HTTP 200` along with the `PAYMENT-RESPONSE` header containing the on-chain transaction hash.\n2. **Loopback Development Bypass (`X-Dev-Bypass-Token` header)**:\n   - When `ENABLE_DEV_BYPASS=true` in `/opt/tex402/.env`, requests originating strictly from loopback (`127.0.0.1` / `::1`) with no proxy forwarding headers (`X-Forwarded-For` / `X-Real-IP`) may pass `X-Dev-Bypass-Token: <token>` using constant-time verification (`crypto.timingSafeEqual`).","contact":{"name":"TeX402","url":"https://tex.x.gl","email":"p@x.gl"},"license":{"name":"MIT","identifier":"MIT"}},"servers":[{"url":"https://tex.x.gl","description":"Active TeX402 Server (mainnet — eip155:8453, payTo=0x5e18Dfb04F64e1D0d3593178a004A251506c2e16)"},{"url":"http://127.0.0.1:4020","description":"Stage-1 Local / SSH Tunnel Loopback Endpoint (ssh -L 4020:127.0.0.1:4020 dev)"}],"tags":[{"name":"Compilation & Linting (x402 Paid)","description":"Metered LaTeX-to-PDF compilation (`$0.008` USDC) and sub-300ms static/dynamic linting (`$0.002` USDC) inside hardened TeX Live containers."},{"name":"Discovery & Operations (Unmetered)","description":"Free health checks, `.well-known/x402` Bazaar/MCP discovery metadata, and OpenAPI 3.1.0 / Swagger UI endpoints."}],"paths":{"/":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getLandingPage","summary":"Developer landing page with live x402 pricing, environment badge, OpenGraph/JSON-LD, and MCP / SDK quickstarts","description":"Serves a self-contained, responsive HTML5 developer landing page displaying the active x402 network/recipient badge, `/v1/compile` (`$0.008` USDC) and `/v1/lint` (`$0.002` USDC) endpoint cards, Schema.org `WebAPI` JSON-LD metadata, and copy-pasteable quickstarts for `tex402-mcp`, `@x402/fetch`, and `curl`.","responses":{"200":{"description":"Self-contained HTML5 developer landing page.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"text/html":{"schema":{"type":"string"}}}}}}},"/v1/compile":{"post":{"tags":["Compilation & Linting (x402 Paid)"],"operationId":"compileLatexDocument","summary":"Compile LaTeX (.tex) resumes, CVs, arXiv papers, Beamer slides, reports, invoices & TikZ to PDF ($0.008 USDC)","description":"Compile LaTeX (.tex) documents — resumes, CVs, arXiv papers, Beamer slide decks, technical reports, invoices, and TikZ diagrams — inside a hardened networkless TeX Live container, returning base64 PDF, 150-DPI PNG page previews, and structured diagnostics. Supports optional auxiliary `files` map (`.tex` subfiles, `.bib` bibliographies, `.sty`/`.cls` packages, or `base64:...` binary images) and automatically detects and runs multi-pass `biber`, `bibtex`, `\\tableofcontents`, Beamer overlays, and `longtable` reruns.","x-tags":["latex","pdf","compiler","resume","cv","arxiv","academic-paper","beamer","slides","report","invoice","tikz","typeset","diagnostics","x402"],"security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.008"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileRequest"},"examples":{"minimal_quickstart":{"summary":"1. Minimal Quickstart (Single-File Article)","description":"Minimal single-file LaTeX article compiled with pdflatex.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\begin{document}\n\\section{Hello TeX402}\nDeterministic, sandboxed LaTeX compilation over the x402 v2 payment protocol.\n\\end{document}"}},"stem_academic_math":{"summary":"2. Heavy STEM & Academic Math (amsmath, mathtools, siunitx, tikz-cd)","description":"Separable Hilbert spaces, multi-line align/cases/pmatrix equations, SI units (siunitx), theorem/proof environments (amsthm), and commutative diagrams (tikz-cd).","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage{amsmath,amssymb,amsthm,mathtools,bm}\n\\usepackage{siunitx}\n\\usepackage{tikz-cd}\n\\newtheorem{theorem}{Theorem}[section]\n\\newtheorem{lemma}[theorem]{Lemma}\n\\begin{document}\n\\section{Functional Analysis and Commutative Diagrams}\n\\begin{theorem}[Spectral Convergence]\\label{thm:spectral}\nLet $\\bm{\\mathcal{H}}$ be a separable Hilbert space with gravitational acceleration \\SI{9.80665}{\\meter\\per\\second\\squared}.\n\\end{theorem}\n\\begin{align}\n  \\mathcal{I}(\\alpha) &\\coloneqq \\int_{-\\infty}^{\\infty} e^{-\\alpha x^2} \\, dx = \\sqrt{\\frac{\\pi}{\\alpha}}, \\\\\n  f(x) &= \\begin{cases} x^2 \\sin(1/x), & x \\neq 0, \\\\ 0, & x = 0, \\end{cases} \\\\\n  \\bm{M} &= \\begin{pmatrix} \\lambda_1 & \\eta \\\\ 0 & \\lambda_2 \\end{pmatrix}.\n\\end{align}\n\\begin{proof}\nBy Cauchy--Schwarz and Boltzmann constant \\SI{1.380649e-23}{\\joule\\per\\kelvin}, the diagram commutes:\n\\begin{center}\n\\begin{tikzcd}\n  H^k(X; \\mathbb{Z}) \\arrow[r, \"\\phi^*\"] \\arrow[d, \"\\pi_X\"'] & H^k(Y; \\mathbb{Z}) \\arrow[d, \"\\pi_Y\"] \\\\\n  H^k(X; \\mathbb{R}) \\arrow[r, \"\\psi^*\"'] & H^k(Y; \\mathbb{R})\n\\end{tikzcd}\n\\end{center}\n\\end{proof}\n\\end{document}"}},"vector_graphics_plots_circuits":{"summary":"3. Vector Graphics, Plots & Schematics (TikZ, pgfplots, circuitikz, mhchem)","description":"State-machine graph in TikZ, damped oscillation 2D function plot in pgfplots, RC schematic in circuitikz, chemical reactions in mhchem, and 150-DPI PNG page preview generation.","value":{"engine":"pdflatex","include_page_previews":true,"main_tex":"\\documentclass[11pt]{article}\n\\usepackage{tikz}\n\\usetikzlibrary{arrows.meta,positioning}\n\\usepackage{pgfplots}\n\\pgfplotsset{compat=1.18}\n\\usepackage{circuitikz}\n\\usepackage[version=4]{mhchem}\n\\begin{document}\n\\section{Schematics, Plots, and Stoichiometry}\nChemical reaction: \\ce{2H2 + O2 -> 2H2O} and \\ce{SO4^2- + Ba^2+ -> BaSO4 v}.\n\\begin{center}\n\\begin{tikzpicture}[node distance=2.5cm]\n  \\node[circle,draw,thick] (init) {Init};\n  \\node[circle,draw,thick,right=of init] (run) {Compile};\n  \\node[circle,draw,thick,right=of run] (done) {Done};\n  \\draw[-Stealth,thick] (init) -- node[above]{x402} (run);\n  \\draw[-Stealth,thick] (run) -- node[above]{PDF} (done);\n\\end{tikzpicture}\n\\end{center}\n\\begin{center}\n\\begin{tikzpicture}\n  \\begin{axis}[width=7cm,height=4.5cm,xlabel={$t$},ylabel={$V(t)$},title={Damped Oscillation}]\n    \\addplot[blue,thick,domain=0:4,samples=30] {exp(-0.5*x)*cos(deg(3*x))};\n  \\end{axis}\n\\end{tikzpicture}\n\\end{center}\n\\begin{center}\n\\begin{circuitikz}\n  \\draw (0,0) to[battery1, l=$V_s$] (0,2) to[R, l=$R_1$] (3,2) to[C, l=$C_1$] (3,0) -- (0,0);\n\\end{circuitikz}\n\\end{center}\n\\end{document}"}},"cs_algorithms_code_trees":{"summary":"4. Computer Science — Algorithms (algorithm2e), Code (listings) & AST Trees (forest)","description":"Formal pseudocode with algorithm2e, syntax-highlighted C++ and Python source blocks with listings, and abstract syntax trees with forest.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage[ruled,vlined,linesnumbered]{algorithm2e}\n\\usepackage{listings}\n\\usepackage{xcolor}\n\\usepackage{forest}\n\\lstset{basicstyle=\\ttfamily\\small,frame=single,columns=fullflexible}\n\\begin{document}\n\\section{Algorithms, Code Listings, and Syntax Trees}\n\\begin{algorithm}[H]\n  \\DontPrintSemicolon\n  \\KwIn{Sorted array $A[1..n]$, target key $x$}\n  \\KwOut{Index $k$ with $A[k]=x$ or $-1$}\n  $low \\leftarrow 1$, $high \\leftarrow n$\\;\n  \\While{$low \\le high$}{\n    $mid \\leftarrow \\lfloor(low + high)/2\\rfloor$\\;\n    \\If{$A[mid] = x$}{\\Return $mid$\\;}\n    \\lIf{$A[mid] < x$}{$low \\leftarrow mid + 1$}\\lElse{$high \\leftarrow mid - 1$}\n  }\n  \\Return $-1$\\;\n  \\caption{BinarySearchVerification}\n\\end{algorithm}\n\\begin{lstlisting}[language=C++]\nint verify_sandbox(int uid) { return uid == 65534 ? 0 : -1; }\n\\end{lstlisting}\n\\begin{lstlisting}[language=Python]\ndef run_tex402_worker(engine: str) -> bool:\n    return engine in ('pdflatex', 'xelatex')\n\\end{lstlisting}\n\\begin{center}\n\\begin{forest}\n  [Program [FuncDecl [Ident [compileTeX]]] [Block [Return [StatusOK]]]]\n\\end{forest}\n\\end{center}\n\\end{document}"}},"xelatex_multilingual_cjk":{"summary":"5. XeLaTeX Multilingual Unicode & CJK (Liberation Serif + Noto Serif CJK SC)","description":"Native UTF-8 compilation using engine: 'xelatex', fontspec, and xeCJK mixing English, Simplified Chinese (简体中文), Japanese (日本語), and equations.","value":{"engine":"xelatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage{fontspec}\n\\usepackage{xeCJK}\n\\usepackage{amsmath,amssymb,booktabs}\n\\setmainfont{Liberation Serif}\n\\setCJKmainfont{Noto Serif CJK SC}\n\\begin{document}\n\\section{Multilingual Unicode and CJK Verification}\nEnglish: TeX402 compiles native UTF-8 documents with XeLaTeX.\n\nSimplified Chinese: 简体中文测试：基于容器沙箱的高性能编译与诊断服务。\n\nJapanese: 日本語テスト：暗号決済プロトコルと組版エンジンの統合。\n\\begin{equation}\n  \\Phi(\\omega) = \\sum_{k=1}^{N} e^{-i k \\omega} = \\frac{1 - e^{-i N \\omega}}{1 - e^{-i \\omega}}\n\\end{equation}\n\\begin{center}\n\\begin{tabular}{lll}\n\\toprule\nLanguage & Script Sample & Engine \\\\\n\\midrule\nEnglish & Latin Alphabet & XeLaTeX \\\\\nChinese & 简体中文数学排版 & XeLaTeX \\\\\nJapanese & 日本語ドキュメント & XeLaTeX \\\\\n\\bottomrule\n\\end{tabular}\n\\end{center}\n\\end{document}"}},"beamer_presentation_deck":{"summary":"6. Beamer Presentation Deck (Madrid Theme, Overlays & Slide PNG Previews)","description":"Multi-slide Beamer presentation using the Madrid theme, \\pause incremental overlays, block/alertblock/exampleblock callouts, and 150-DPI PNG previews per slide.","value":{"engine":"pdflatex","include_page_previews":true,"main_tex":"\\documentclass{beamer}\n\\usetheme{Madrid}\n\\usepackage{amsmath,amssymb}\n\\title{TeX402 Autonomous Compilation}\n\\author{Verification Suite}\n\\date{2026}\n\\begin{document}\n\\begin{frame}\n  \\titlepage\n\\end{frame}\n\\begin{frame}{Incremental Overlay Verification}\n  \\begin{itemize}\n    \\item First overlay item visible on slide 2\n    \\pause\n    \\item Second overlay item revealed on slide 3\n  \\end{itemize}\n\\end{frame}\n\\begin{frame}{Structured Beamer Blocks}\n  \\begin{block}{Standard Block}\n    Deterministic container isolation with read-only rootfs.\n  \\end{block}\n  \\begin{alertblock}{Security Boundary}\n    Kpathsea paranoid lockdown blocks shell-escape and path traversal.\n  \\end{alertblock}\n  \\begin{exampleblock}{Performance Metric}\n    Pre-warmed worker pool keeps latency low.\n  \\end{exampleblock}\n\\end{frame}\n\\begin{frame}{Spectral Identity}\n  \\begin{equation}\n    \\det(A - \\lambda I) = 0\n  \\end{equation}\n\\end{frame}\n\\end{document}"}},"multifile_biber_project":{"summary":"7. Multi-File Project with Subdirectories, Embedded PNG & BibLaTeX/Biber","description":"Multi-file project containing subdirectory .tex inputs (sections/intro.tex, sections/results.tex), a custom .sty package (styles/custom.sty), a base64-encoded PNG image (images/dot.png), BibLaTeX + Biber bibliography resolution, and Table of Contents.","value":{"engine":"pdflatex","bibliography":true,"include_page_previews":true,"main_tex":"\\documentclass[11pt]{article}\n\\usepackage{graphicx}\n\\usepackage{styles/custom}\n\\usepackage[backend=biber,style=numeric]{biblatex}\n\\addbibresource{refs.bib}\n\\begin{document}\n\\tableofcontents\n\\input{sections/intro.tex}\n\\input{sections/results.tex}\n\\printbibliography\n\\end{document}","files":{"styles/custom.sty":"\\ProvidesPackage{styles/custom}[2026/11/13 Custom Subdir Style]\n\\newcommand{\\subdirstamp}[1]{\\textbf{[SUBDIR-STYLE: #1]}}\n\\endinput","sections/intro.tex":"\\section{IntroductionSubdirSection}\\label{sec:intro}\nWelcome to the multi-file project using \\subdirstamp{ACTIVE} and citing Knuth~\\cite{knuth1984}.","sections/results.tex":"\\section{ResultsSubdirSection}\\label{sec:results}\nAs established in Section~\\ref{sec:intro}, we embed a PNG image below and cite Lamport~\\cite{lamport1994}:\n\\begin{center}\n  \\includegraphics[width=1.5cm]{images/dot.png}\n\\end{center}","images/dot.png":"base64:iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==","refs.bib":"@article{knuth1984,\n  author = {Donald E. Knuth},\n  title = {Literate Programming},\n  journaltitle = {The Computer Journal},\n  year = {1984}\n}\n@book{lamport1994,\n  author = {Leslie Lamport},\n  title = {LaTeX: A Document Preparation System},\n  publisher = {Addison-Wesley},\n  year = {1994}\n}"}}},"classic_bibtex_paper":{"summary":"8. Classic BibTeX Multi-Pass Paper (\\bibliographystyle{plain}\\bibliography{refs})","description":"Academic paper using traditional BibTeX (pdflatex -> bibtex -> pdflatex -> pdflatex) with bibliography: true.","value":{"engine":"pdflatex","bibliography":true,"main_tex":"\\documentclass[11pt]{article}\n\\begin{document}\n\\section{Classic BibTeX Verification}\nFoundational computer science citations: Dijkstra~\\cite{dijkstra1968}, Hoare~\\cite{hoare1969}, and Turing~\\cite{turing1936}.\n\\bibliographystyle{plain}\n\\bibliography{refs}\n\\end{document}","files":{"refs.bib":"@article{dijkstra1968,\n  author = {Edsger W. Dijkstra},\n  title = {Go To Statement Considered Harmful},\n  journal = {Communications of the ACM},\n  year = {1968}\n}\n@article{hoare1969,\n  author = {C. A. R. Hoare},\n  title = {An Axiomatic Basis for Computer Programming},\n  journal = {Communications of the ACM},\n  year = {1969}\n}\n@article{turing1936,\n  author = {Alan M. Turing},\n  title = {On Computable Numbers, with an Application to the Entscheidungsproblem},\n  journal = {Proceedings of the London Mathematical Society},\n  year = {1936}\n}"}}},"complex_multipage_tables":{"summary":"9. Complex Multi-Page Layout & Longtables (geometry, fancyhdr, hyperref, longtable)","description":"Multi-page document layout with custom headers/footers (fancyhdr), hyperlinked sections (hyperref), multirow/tabularx summary tables, and zebra-striped longtable spanning multiple pages.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage[margin=1in]{geometry}\n\\usepackage{fancyhdr}\n\\usepackage[table]{xcolor}\n\\usepackage{booktabs,multirow,tabularx,longtable}\n\\usepackage[hidelinks]{hyperref}\n\\pagestyle{fancy}\n\\fancyhf{}\n\\fancyhead[L]{TeX402 Multi-Page Layout}\n\\fancyhead[R]{\\thepage}\n\\begin{document}\n\\section{Summary Tabularx and Multirow}\n\\begin{tabularx}{\\textwidth}{lXrr}\n\\toprule\nGroup & Description & Count & Status \\\\\n\\midrule\n\\multirow{2}{*}{Sandbox} & Read-only rootfs container & 1 & OK \\\\\n & Paranoid Kpathsea policy & 2 & OK \\\\\n\\bottomrule\n\\end{tabularx}\n\\section{Multi-Page Longtable Benchmark}\n\\rowcolors{2}{gray!10}{white}\n\\begin{longtable}{llll}\n\\toprule\nID & Metric & Hex Code & Result \\\\\n\\midrule\n\\endfirsthead\n\\toprule\nID & Metric & Hex Code & Result (Continued) \\\\\n\\midrule\n\\endhead\n\\bottomrule\n\\endfoot\nRow-1 & Metric-1 & \\texttt{0x192} & Verified \\\\\nRow-2 & Metric-2 & \\texttt{0x324} & Verified \\\\\nRow-3 & Metric-3 & \\texttt{0x4b6} & Verified \\\\\nRow-4 & Metric-4 & \\texttt{0x648} & Verified \\\\\nRow-5 & Metric-5 & \\texttt{0x7da} & Verified \\\\\nRow-6 & Metric-6 & \\texttt{0x96c} & Verified \\\\\nRow-7 & Metric-7 & \\texttt{0xafe} & Verified \\\\\nRow-8 & Metric-8 & \\texttt{0xc90} & Verified \\\\\nRow-9 & Metric-9 & \\texttt{0xe22} & Verified \\\\\nRow-10 & Metric-10 & \\texttt{0xfb4} & Verified \\\\\nRow-11 & Metric-11 & \\texttt{0x1146} & Verified \\\\\nRow-12 & Metric-12 & \\texttt{0x12d8} & Verified \\\\\nRow-13 & Metric-13 & \\texttt{0x146a} & Verified \\\\\nRow-14 & Metric-14 & \\texttt{0x15fc} & Verified \\\\\nRow-15 & Metric-15 & \\texttt{0x178e} & Verified \\\\\nRow-16 & Metric-16 & \\texttt{0x1920} & Verified \\\\\nRow-17 & Metric-17 & \\texttt{0x1ab2} & Verified \\\\\nRow-18 & Metric-18 & \\texttt{0x1c44} & Verified \\\\\nRow-19 & Metric-19 & \\texttt{0x1dd6} & Verified \\\\\nRow-20 & Metric-20 & \\texttt{0x1f68} & Verified \\\\\nRow-21 & Metric-21 & \\texttt{0x20fa} & Verified \\\\\nRow-22 & Metric-22 & \\texttt{0x228c} & Verified \\\\\nRow-23 & Metric-23 & \\texttt{0x241e} & Verified \\\\\nRow-24 & Metric-24 & \\texttt{0x25b0} & Verified \\\\\nRow-25 & Metric-25 & \\texttt{0x2742} & Verified \\\\\nRow-26 & Metric-26 & \\texttt{0x28d4} & Verified \\\\\nRow-27 & Metric-27 & \\texttt{0x2a66} & Verified \\\\\nRow-28 & Metric-28 & \\texttt{0x2bf8} & Verified \\\\\nRow-29 & Metric-29 & \\texttt{0x2d8a} & Verified \\\\\nRow-30 & Metric-30 & \\texttt{0x2f1c} & Verified \\\\\nRow-31 & Metric-31 & \\texttt{0x30ae} & Verified \\\\\nRow-32 & Metric-32 & \\texttt{0x3240} & Verified \\\\\nRow-33 & Metric-33 & \\texttt{0x33d2} & Verified \\\\\nRow-34 & Metric-34 & \\texttt{0x3564} & Verified \\\\\nRow-35 & Metric-35 & \\texttt{0x36f6} & Verified \\\\\nRow-36 & Metric-36 & \\texttt{0x3888} & Verified \\\\\nRow-37 & Metric-37 & \\texttt{0x3a1a} & Verified \\\\\nRow-38 & Metric-38 & \\texttt{0x3bac} & Verified \\\\\nRow-39 & Metric-39 & \\texttt{0x3d3e} & Verified \\\\\nRow-40 & Metric-40 & \\texttt{0x3ed0} & Verified \\\\\nRow-41 & Metric-41 & \\texttt{0x4062} & Verified \\\\\nRow-42 & Metric-42 & \\texttt{0x41f4} & Verified \\\\\nRow-43 & Metric-43 & \\texttt{0x4386} & Verified \\\\\nRow-44 & Metric-44 & \\texttt{0x4518} & Verified \\\\\nRow-45 & Metric-45 & \\texttt{0x46aa} & Verified \\\\\nRow-46 & Metric-46 & \\texttt{0x483c} & Verified \\\\\nRow-47 & Metric-47 & \\texttt{0x49ce} & Verified \\\\\nRow-48 & Metric-48 & \\texttt{0x4b60} & Verified \\\\\nRow-49 & Metric-49 & \\texttt{0x4cf2} & Verified \\\\\nRow-50 & Metric-50 & \\texttt{0x4e84} & Verified \\\\\nRow-51 & Metric-51 & \\texttt{0x5016} & Verified \\\\\nRow-52 & Metric-52 & \\texttt{0x51a8} & Verified \\\\\nRow-53 & Metric-53 & \\texttt{0x533a} & Verified \\\\\nRow-54 & Metric-54 & \\texttt{0x54cc} & Verified \\\\\nRow-55 & Metric-55 & \\texttt{0x565e} & Verified \\\\\nRow-56 & Metric-56 & \\texttt{0x57f0} & Verified \\\\\nRow-57 & Metric-57 & \\texttt{0x5982} & Verified \\\\\nRow-58 & Metric-58 & \\texttt{0x5b14} & Verified \\\\\nRow-59 & Metric-59 & \\texttt{0x5ca6} & Verified \\\\\nRow-60 & Metric-60 & \\texttt{0x5e38} & Verified \\\\\n\\end{longtable}\n\\end{document}"}},"diagnostics_and_linting":{"summary":"10. Structured Subfile Error Diagnostics & Actionable Suggested Fixes","description":"Demonstrates TeX402's structured diagnostic parser pinpointing an undefined macro inside an included subfile (sections/broken.tex line 5) with context_snippet and suggested_fix.","value":{"engine":"pdflatex","main_tex":"\\documentclass{article}\n\\begin{document}\n\\section{Main File}\n\\input{sections/broken.tex}\n\\end{document}","files":{"sections/broken.tex":"% Subfile line 1\nSubfile line 2 valid text.\nSubfile line 3 valid text.\nSubfile line 4 valid text.\nSubfile line 5 has \\brokenSubfileMacroHere{boom}."}}}}}}},"responses":{"200":{"description":"Compilation executed (either succeeded with `pdf_base64` or failed with structured LaTeX/sandbox `diagnostics`).","headers":{"PAYMENT-RESPONSE":{"$ref":"#/components/headers/PAYMENT-RESPONSE"},"X-TeX402-Bypass":{"description":"Present (`loopback-dev-token`) only when authenticated via loopback `X-Dev-Bypass-Token`.","schema":{"type":"string","example":"loopback-dev-token"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileResponse"},"examples":{"compiled_pdf_with_preview":{"summary":"Successful Compilation with PDF & 150-DPI PNG Preview","value":{"success":true,"pdf_base64":"JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+Pg0KZW5kb2Jq...","page_count":1,"page_previews_base64":["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="],"compile_time_ms":640,"diagnostics":[],"sandbox_metadata":{"isolated":true,"timed_out":false,"files_in_workspace":["main.aux","main.log","main.pdf","main.tex","page_preview-1.png"]}}},"compilation_error_diagnostics":{"summary":"Failed Compilation with Structured Subfile Line Diagnostics & Suggested Fix","value":{"success":false,"pdf_base64":null,"page_count":0,"page_previews_base64":[],"compile_time_ms":215,"diagnostics":[{"file":"sections/broken.tex","line":5,"severity":"error","message":"Undefined control sequence.","context_snippet":"Subfile line 5 has \\brokenSubfileMacroHere{boom}.","suggested_fix":"Check the spelling of '\\brokenSubfileMacroHere' or include the required '\\usepackage{...}' in your preamble."}],"sandbox_metadata":{"isolated":true,"timed_out":false,"files_in_workspace":["main.aux","main.log","main.tex","sections"]}}}}}}},"400":{"description":"Missing or empty `main_tex` field in request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileResponse"}}}},"402":{"description":"x402 Payment Required ($0.008 USDC / 8000 atomic units). Inspect the base64-encoded `PAYMENT-REQUIRED` header for payment requirements and Bazaar discovery schema.","headers":{"PAYMENT-REQUIRED":{"$ref":"#/components/headers/PAYMENT-REQUIRED"},"EXTENSION-RESPONSES":{"$ref":"#/components/headers/EXTENSION-RESPONSES"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredResponse"},"examples":{"compile_402_challenge":{"summary":"HTTP 402 Payment Required ($0.008 USDC / 8000 atomic units)","value":{"x402Version":2,"error":"Payment required","resource":{"url":"https://tex.x.gl/v1/compile","description":"Compile LaTeX (.tex) documents — resumes, CVs, arXiv papers, Beamer slide decks, technical reports, invoices, and TikZ diagrams — inside a hardened networkless TeX Live container, returning base64 PDF, 150-DPI PNG page previews, and structured diagnostics.","mimeType":"application/json","serviceName":"TeX402","tags":["latex","pdf","compiler","resume","cv","arxiv","academic-paper","beamer","slides","report","invoice","tikz","typeset","diagnostics","x402"]},"accepts":[{"scheme":"exact","network":"eip155:8453","amount":"8000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x5e18Dfb04F64e1D0d3593178a004A251506c2e16","maxTimeoutSeconds":300,"extra":{"name":"USDC","version":"2"}}]}}}}}},"429":{"description":"Too Many Requests — pre-settlement per-IP rate limit exceeded (`RATE_LIMIT_RPM`, default 30 req/min). Rejected before x402 payment verification or settlement; inspect `Retry-After`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitErrorResponse"},"example":{"error":"rate_limit_exceeded","message":"Rate limit exceeded on /v1/* endpoints. Please retry after the indicated interval.","retry_after_seconds":12}}}},"500":{"description":"Unexpected internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileResponse"}}}},"503":{"description":"Service Unavailable — pre-settlement bounded worker queue is full (`MAX_CONCURRENT_WORKERS + MAX_QUEUE_DEPTH`). Rejected before x402 payment verification or settlement so callers are never charged during a traffic spike; inspect `Retry-After`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueSaturatedErrorResponse"},"example":{"error":"queue_saturated","message":"Worker queue is temporarily saturated. No x402 payment was settled; retry shortly.","retry_after_seconds":5}}}}}}},"/v1/lint":{"post":{"tags":["Compilation & Linting (x402 Paid)"],"operationId":"lintLatexDocument","summary":"Validate LaTeX (.tex) syntax and ChkTeX rules in sub-300ms (-draftmode) before PDF compilation ($0.002 USDC)","description":"Validate LaTeX (.tex) syntax and ChkTeX rules in sub-300ms (-draftmode) before PDF compilation — ideal for fast iterative drafting of papers, resumes, slides, and math. Executes `chktex` static linting concurrently with `pdflatex -draftmode` or `xelatex -draftmode` inside a pre-warmed container without rendering a PDF at one-quarter the cost of full compilation.","x-tags":["latex","linter","syntax-check","diagnostics","chktex","pdflatex","xelatex","arxiv","resume","x402"],"security":[],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.002"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LintRequest"},"examples":{"minimal_quickstart":{"summary":"1. Minimal Quickstart Lint (<300ms)","description":"Fast ChkTeX + pdflatex -draftmode check on a minimal article.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\begin{document}\n\\section{Hello TeX402}\nDeterministic, sandboxed LaTeX compilation over the x402 v2 payment protocol.\n\\end{document}"}},"stem_academic_math":{"summary":"2. Heavy STEM & Academic Math Lint","description":"Validate complex amsmath, siunitx, and tikz-cd syntax without PDF rendering overhead.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage{amsmath,amssymb,amsthm,mathtools,bm}\n\\usepackage{siunitx}\n\\usepackage{tikz-cd}\n\\newtheorem{theorem}{Theorem}[section]\n\\newtheorem{lemma}[theorem]{Lemma}\n\\begin{document}\n\\section{Functional Analysis and Commutative Diagrams}\n\\begin{theorem}[Spectral Convergence]\\label{thm:spectral}\nLet $\\bm{\\mathcal{H}}$ be a separable Hilbert space with gravitational acceleration \\SI{9.80665}{\\meter\\per\\second\\squared}.\n\\end{theorem}\n\\begin{align}\n  \\mathcal{I}(\\alpha) &\\coloneqq \\int_{-\\infty}^{\\infty} e^{-\\alpha x^2} \\, dx = \\sqrt{\\frac{\\pi}{\\alpha}}, \\\\\n  f(x) &= \\begin{cases} x^2 \\sin(1/x), & x \\neq 0, \\\\ 0, & x = 0, \\end{cases} \\\\\n  \\bm{M} &= \\begin{pmatrix} \\lambda_1 & \\eta \\\\ 0 & \\lambda_2 \\end{pmatrix}.\n\\end{align}\n\\begin{proof}\nBy Cauchy--Schwarz and Boltzmann constant \\SI{1.380649e-23}{\\joule\\per\\kelvin}, the diagram commutes:\n\\begin{center}\n\\begin{tikzcd}\n  H^k(X; \\mathbb{Z}) \\arrow[r, \"\\phi^*\"] \\arrow[d, \"\\pi_X\"'] & H^k(Y; \\mathbb{Z}) \\arrow[d, \"\\pi_Y\"] \\\\\n  H^k(X; \\mathbb{R}) \\arrow[r, \"\\psi^*\"'] & H^k(Y; \\mathbb{R})\n\\end{tikzcd}\n\\end{center}\n\\end{proof}\n\\end{document}"}},"vector_graphics_plots_circuits":{"summary":"3. Vector Graphics, Plots & Schematics Lint","description":"Validate TikZ, pgfplots, circuitikz, and mhchem syntax in draftmode.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage{tikz}\n\\usetikzlibrary{arrows.meta,positioning}\n\\usepackage{pgfplots}\n\\pgfplotsset{compat=1.18}\n\\usepackage{circuitikz}\n\\usepackage[version=4]{mhchem}\n\\begin{document}\n\\section{Schematics, Plots, and Stoichiometry}\nChemical reaction: \\ce{2H2 + O2 -> 2H2O} and \\ce{SO4^2- + Ba^2+ -> BaSO4 v}.\n\\begin{center}\n\\begin{tikzpicture}[node distance=2.5cm]\n  \\node[circle,draw,thick] (init) {Init};\n  \\node[circle,draw,thick,right=of init] (run) {Compile};\n  \\node[circle,draw,thick,right=of run] (done) {Done};\n  \\draw[-Stealth,thick] (init) -- node[above]{x402} (run);\n  \\draw[-Stealth,thick] (run) -- node[above]{PDF} (done);\n\\end{tikzpicture}\n\\end{center}\n\\begin{center}\n\\begin{tikzpicture}\n  \\begin{axis}[width=7cm,height=4.5cm,xlabel={$t$},ylabel={$V(t)$},title={Damped Oscillation}]\n    \\addplot[blue,thick,domain=0:4,samples=30] {exp(-0.5*x)*cos(deg(3*x))};\n  \\end{axis}\n\\end{tikzpicture}\n\\end{center}\n\\begin{center}\n\\begin{circuitikz}\n  \\draw (0,0) to[battery1, l=$V_s$] (0,2) to[R, l=$R_1$] (3,2) to[C, l=$C_1$] (3,0) -- (0,0);\n\\end{circuitikz}\n\\end{center}\n\\end{document}"}},"cs_algorithms_code_trees":{"summary":"4. CS Algorithms, Code Listings & Forest AST Lint","description":"Validate algorithm2e, listings, and forest syntax in draftmode.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage[ruled,vlined,linesnumbered]{algorithm2e}\n\\usepackage{listings}\n\\usepackage{xcolor}\n\\usepackage{forest}\n\\lstset{basicstyle=\\ttfamily\\small,frame=single,columns=fullflexible}\n\\begin{document}\n\\section{Algorithms, Code Listings, and Syntax Trees}\n\\begin{algorithm}[H]\n  \\DontPrintSemicolon\n  \\KwIn{Sorted array $A[1..n]$, target key $x$}\n  \\KwOut{Index $k$ with $A[k]=x$ or $-1$}\n  $low \\leftarrow 1$, $high \\leftarrow n$\\;\n  \\While{$low \\le high$}{\n    $mid \\leftarrow \\lfloor(low + high)/2\\rfloor$\\;\n    \\If{$A[mid] = x$}{\\Return $mid$\\;}\n    \\lIf{$A[mid] < x$}{$low \\leftarrow mid + 1$}\\lElse{$high \\leftarrow mid - 1$}\n  }\n  \\Return $-1$\\;\n  \\caption{BinarySearchVerification}\n\\end{algorithm}\n\\begin{lstlisting}[language=C++]\nint verify_sandbox(int uid) { return uid == 65534 ? 0 : -1; }\n\\end{lstlisting}\n\\begin{lstlisting}[language=Python]\ndef run_tex402_worker(engine: str) -> bool:\n    return engine in ('pdflatex', 'xelatex')\n\\end{lstlisting}\n\\begin{center}\n\\begin{forest}\n  [Program [FuncDecl [Ident [compileTeX]]] [Block [Return [StatusOK]]]]\n\\end{forest}\n\\end{center}\n\\end{document}"}},"xelatex_multilingual_cjk":{"summary":"5. XeLaTeX Multilingual Unicode & CJK Lint","description":"Validate XeLaTeX fontspec + xeCJK preamble and UTF-8 CJK source.","value":{"engine":"xelatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage{fontspec}\n\\usepackage{xeCJK}\n\\usepackage{amsmath,amssymb,booktabs}\n\\setmainfont{Liberation Serif}\n\\setCJKmainfont{Noto Serif CJK SC}\n\\begin{document}\n\\section{Multilingual Unicode and CJK Verification}\nEnglish: TeX402 compiles native UTF-8 documents with XeLaTeX.\n\nSimplified Chinese: 简体中文测试：基于容器沙箱的高性能编译与诊断服务。\n\nJapanese: 日本語テスト：暗号決済プロトコルと組版エンジンの統合。\n\\begin{equation}\n  \\Phi(\\omega) = \\sum_{k=1}^{N} e^{-i k \\omega} = \\frac{1 - e^{-i N \\omega}}{1 - e^{-i \\omega}}\n\\end{equation}\n\\begin{center}\n\\begin{tabular}{lll}\n\\toprule\nLanguage & Script Sample & Engine \\\\\n\\midrule\nEnglish & Latin Alphabet & XeLaTeX \\\\\nChinese & 简体中文数学排版 & XeLaTeX \\\\\nJapanese & 日本語ドキュメント & XeLaTeX \\\\\n\\bottomrule\n\\end{tabular}\n\\end{center}\n\\end{document}"}},"beamer_presentation_deck":{"summary":"6. Beamer Presentation Deck Lint","description":"Validate Beamer frames, overlays, and blocks in single-pass draftmode.","value":{"engine":"pdflatex","main_tex":"\\documentclass{beamer}\n\\usetheme{Madrid}\n\\usepackage{amsmath,amssymb}\n\\title{TeX402 Autonomous Compilation}\n\\author{Verification Suite}\n\\date{2026}\n\\begin{document}\n\\begin{frame}\n  \\titlepage\n\\end{frame}\n\\begin{frame}{Incremental Overlay Verification}\n  \\begin{itemize}\n    \\item First overlay item visible on slide 2\n    \\pause\n    \\item Second overlay item revealed on slide 3\n  \\end{itemize}\n\\end{frame}\n\\begin{frame}{Structured Beamer Blocks}\n  \\begin{block}{Standard Block}\n    Deterministic container isolation with read-only rootfs.\n  \\end{block}\n  \\begin{alertblock}{Security Boundary}\n    Kpathsea paranoid lockdown blocks shell-escape and path traversal.\n  \\end{alertblock}\n  \\begin{exampleblock}{Performance Metric}\n    Pre-warmed worker pool keeps latency low.\n  \\end{exampleblock}\n\\end{frame}\n\\begin{frame}{Spectral Identity}\n  \\begin{equation}\n    \\det(A - \\lambda I) = 0\n  \\end{equation}\n\\end{frame}\n\\end{document}"}},"multifile_biber_project":{"summary":"7. Multi-File Subdirectory Project Lint","description":"Validate multi-file input inclusion and custom .sty package syntax.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage{graphicx}\n\\usepackage{styles/custom}\n\\usepackage[backend=biber,style=numeric]{biblatex}\n\\addbibresource{refs.bib}\n\\begin{document}\n\\tableofcontents\n\\input{sections/intro.tex}\n\\input{sections/results.tex}\n\\printbibliography\n\\end{document}","files":{"styles/custom.sty":"\\ProvidesPackage{styles/custom}[2026/11/13 Custom Subdir Style]\n\\newcommand{\\subdirstamp}[1]{\\textbf{[SUBDIR-STYLE: #1]}}\n\\endinput","sections/intro.tex":"\\section{IntroductionSubdirSection}\\label{sec:intro}\nWelcome to the multi-file project using \\subdirstamp{ACTIVE} and citing Knuth~\\cite{knuth1984}.","sections/results.tex":"\\section{ResultsSubdirSection}\\label{sec:results}\nAs established in Section~\\ref{sec:intro}, we embed a PNG image below and cite Lamport~\\cite{lamport1994}:\n\\begin{center}\n  \\includegraphics[width=1.5cm]{images/dot.png}\n\\end{center}","images/dot.png":"base64:iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==","refs.bib":"@article{knuth1984,\n  author = {Donald E. Knuth},\n  title = {Literate Programming},\n  journaltitle = {The Computer Journal},\n  year = {1984}\n}\n@book{lamport1994,\n  author = {Leslie Lamport},\n  title = {LaTeX: A Document Preparation System},\n  publisher = {Addison-Wesley},\n  year = {1994}\n}"}}},"classic_bibtex_paper":{"summary":"8. Classic BibTeX Paper Lint","description":"Validate BibTeX citation syntax and document structure.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\begin{document}\n\\section{Classic BibTeX Verification}\nFoundational computer science citations: Dijkstra~\\cite{dijkstra1968}, Hoare~\\cite{hoare1969}, and Turing~\\cite{turing1936}.\n\\bibliographystyle{plain}\n\\bibliography{refs}\n\\end{document}","files":{"refs.bib":"@article{dijkstra1968,\n  author = {Edsger W. Dijkstra},\n  title = {Go To Statement Considered Harmful},\n  journal = {Communications of the ACM},\n  year = {1968}\n}\n@article{hoare1969,\n  author = {C. A. R. Hoare},\n  title = {An Axiomatic Basis for Computer Programming},\n  journal = {Communications of the ACM},\n  year = {1969}\n}\n@article{turing1936,\n  author = {Alan M. Turing},\n  title = {On Computable Numbers, with an Application to the Entscheidungsproblem},\n  journal = {Proceedings of the London Mathematical Society},\n  year = {1936}\n}"}}},"complex_multipage_tables":{"summary":"9. Complex Multi-Page Layout & Longtables Lint","description":"Validate tabularx, multirow, and longtable alignment in draftmode.","value":{"engine":"pdflatex","main_tex":"\\documentclass[11pt]{article}\n\\usepackage[margin=1in]{geometry}\n\\usepackage{fancyhdr}\n\\usepackage[table]{xcolor}\n\\usepackage{booktabs,multirow,tabularx,longtable}\n\\usepackage[hidelinks]{hyperref}\n\\pagestyle{fancy}\n\\fancyhf{}\n\\fancyhead[L]{TeX402 Multi-Page Layout}\n\\fancyhead[R]{\\thepage}\n\\begin{document}\n\\section{Summary Tabularx and Multirow}\n\\begin{tabularx}{\\textwidth}{lXrr}\n\\toprule\nGroup & Description & Count & Status \\\\\n\\midrule\n\\multirow{2}{*}{Sandbox} & Read-only rootfs container & 1 & OK \\\\\n & Paranoid Kpathsea policy & 2 & OK \\\\\n\\bottomrule\n\\end{tabularx}\n\\section{Multi-Page Longtable Benchmark}\n\\rowcolors{2}{gray!10}{white}\n\\begin{longtable}{llll}\n\\toprule\nID & Metric & Hex Code & Result \\\\\n\\midrule\n\\endfirsthead\n\\toprule\nID & Metric & Hex Code & Result (Continued) \\\\\n\\midrule\n\\endhead\n\\bottomrule\n\\endfoot\nRow-1 & Metric-1 & \\texttt{0x192} & Verified \\\\\nRow-2 & Metric-2 & \\texttt{0x324} & Verified \\\\\nRow-3 & Metric-3 & \\texttt{0x4b6} & Verified \\\\\nRow-4 & Metric-4 & \\texttt{0x648} & Verified \\\\\nRow-5 & Metric-5 & \\texttt{0x7da} & Verified \\\\\nRow-6 & Metric-6 & \\texttt{0x96c} & Verified \\\\\nRow-7 & Metric-7 & \\texttt{0xafe} & Verified \\\\\nRow-8 & Metric-8 & \\texttt{0xc90} & Verified \\\\\nRow-9 & Metric-9 & \\texttt{0xe22} & Verified \\\\\nRow-10 & Metric-10 & \\texttt{0xfb4} & Verified \\\\\nRow-11 & Metric-11 & \\texttt{0x1146} & Verified \\\\\nRow-12 & Metric-12 & \\texttt{0x12d8} & Verified \\\\\nRow-13 & Metric-13 & \\texttt{0x146a} & Verified \\\\\nRow-14 & Metric-14 & \\texttt{0x15fc} & Verified \\\\\nRow-15 & Metric-15 & \\texttt{0x178e} & Verified \\\\\nRow-16 & Metric-16 & \\texttt{0x1920} & Verified \\\\\nRow-17 & Metric-17 & \\texttt{0x1ab2} & Verified \\\\\nRow-18 & Metric-18 & \\texttt{0x1c44} & Verified \\\\\nRow-19 & Metric-19 & \\texttt{0x1dd6} & Verified \\\\\nRow-20 & Metric-20 & \\texttt{0x1f68} & Verified \\\\\nRow-21 & Metric-21 & \\texttt{0x20fa} & Verified \\\\\nRow-22 & Metric-22 & \\texttt{0x228c} & Verified \\\\\nRow-23 & Metric-23 & \\texttt{0x241e} & Verified \\\\\nRow-24 & Metric-24 & \\texttt{0x25b0} & Verified \\\\\nRow-25 & Metric-25 & \\texttt{0x2742} & Verified \\\\\nRow-26 & Metric-26 & \\texttt{0x28d4} & Verified \\\\\nRow-27 & Metric-27 & \\texttt{0x2a66} & Verified \\\\\nRow-28 & Metric-28 & \\texttt{0x2bf8} & Verified \\\\\nRow-29 & Metric-29 & \\texttt{0x2d8a} & Verified \\\\\nRow-30 & Metric-30 & \\texttt{0x2f1c} & Verified \\\\\nRow-31 & Metric-31 & \\texttt{0x30ae} & Verified \\\\\nRow-32 & Metric-32 & \\texttt{0x3240} & Verified \\\\\nRow-33 & Metric-33 & \\texttt{0x33d2} & Verified \\\\\nRow-34 & Metric-34 & \\texttt{0x3564} & Verified \\\\\nRow-35 & Metric-35 & \\texttt{0x36f6} & Verified \\\\\nRow-36 & Metric-36 & \\texttt{0x3888} & Verified \\\\\nRow-37 & Metric-37 & \\texttt{0x3a1a} & Verified \\\\\nRow-38 & Metric-38 & \\texttt{0x3bac} & Verified \\\\\nRow-39 & Metric-39 & \\texttt{0x3d3e} & Verified \\\\\nRow-40 & Metric-40 & \\texttt{0x3ed0} & Verified \\\\\nRow-41 & Metric-41 & \\texttt{0x4062} & Verified \\\\\nRow-42 & Metric-42 & \\texttt{0x41f4} & Verified \\\\\nRow-43 & Metric-43 & \\texttt{0x4386} & Verified \\\\\nRow-44 & Metric-44 & \\texttt{0x4518} & Verified \\\\\nRow-45 & Metric-45 & \\texttt{0x46aa} & Verified \\\\\nRow-46 & Metric-46 & \\texttt{0x483c} & Verified \\\\\nRow-47 & Metric-47 & \\texttt{0x49ce} & Verified \\\\\nRow-48 & Metric-48 & \\texttt{0x4b60} & Verified \\\\\nRow-49 & Metric-49 & \\texttt{0x4cf2} & Verified \\\\\nRow-50 & Metric-50 & \\texttt{0x4e84} & Verified \\\\\nRow-51 & Metric-51 & \\texttt{0x5016} & Verified \\\\\nRow-52 & Metric-52 & \\texttt{0x51a8} & Verified \\\\\nRow-53 & Metric-53 & \\texttt{0x533a} & Verified \\\\\nRow-54 & Metric-54 & \\texttt{0x54cc} & Verified \\\\\nRow-55 & Metric-55 & \\texttt{0x565e} & Verified \\\\\nRow-56 & Metric-56 & \\texttt{0x57f0} & Verified \\\\\nRow-57 & Metric-57 & \\texttt{0x5982} & Verified \\\\\nRow-58 & Metric-58 & \\texttt{0x5b14} & Verified \\\\\nRow-59 & Metric-59 & \\texttt{0x5ca6} & Verified \\\\\nRow-60 & Metric-60 & \\texttt{0x5e38} & Verified \\\\\n\\end{longtable}\n\\end{document}"}},"diagnostics_and_linting":{"summary":"10. ChkTeX Warnings + Draftmode Error Detection (<300ms)","description":"Demonstrates concurrent ChkTeX static analysis (catching '...' ellipsis warning) and pdflatex -draftmode validation (catching undefined control sequence on line 4) in <300ms.","value":{"engine":"pdflatex","main_tex":"\\documentclass{article}\n\\begin{document}\nEllipsis should use ldots instead of three dots...\nUndefined macro in lint mode: \\lintDraftModeUndefinedMacro{now}.\n\\end{document}"}}}}}},"responses":{"200":{"description":"Linting completed with `valid` boolean status and combined ChkTeX + TeX diagnostics.","headers":{"PAYMENT-RESPONSE":{"$ref":"#/components/headers/PAYMENT-RESPONSE"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LintResponse"},"examples":{"clean_lint_result":{"summary":"Clean Lint Result (<300ms, valid: true)","value":{"success":true,"valid":true,"compile_time_ms":210,"diagnostics":[]}},"chktex_and_draftmode_diagnostics":{"summary":"Lint Catching ChkTeX Warning + Draftmode Error (<300ms)","value":{"success":true,"valid":false,"compile_time_ms":214,"diagnostics":[{"file":"main.tex","line":4,"severity":"error","message":"Undefined control sequence.","context_snippet":"Undefined macro in lint mode: \\lintDraftModeUndefinedMacro{now}.","suggested_fix":"Check the spelling of '\\lintDraftModeUndefinedMacro' or include the required '\\usepackage{...}' in your preamble."},{"file":"main.tex","line":3,"severity":"warning","message":"[ChkTeX #11] You should use \\ldots to achieve an ellipsis.","context_snippet":"Ellipsis should use ldots instead of three dots...","suggested_fix":"Replace '...' with '\\ldots' or '\\dots' for proper LaTeX spacing."}]}}}}}},"400":{"description":"Missing or empty `main_tex` field in request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LintResponse"}}}},"402":{"description":"x402 Payment Required ($0.002 USDC / 2000 atomic units). Inspect the base64-encoded `PAYMENT-REQUIRED` header.","headers":{"PAYMENT-REQUIRED":{"$ref":"#/components/headers/PAYMENT-REQUIRED"},"EXTENSION-RESPONSES":{"$ref":"#/components/headers/EXTENSION-RESPONSES"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredResponse"},"examples":{"lint_402_challenge":{"summary":"HTTP 402 Payment Required ($0.002 USDC / 2000 atomic units)","value":{"x402Version":2,"error":"Payment required","resource":{"url":"https://tex.x.gl/v1/lint","description":"Validate LaTeX (.tex) syntax and ChkTeX rules in sub-300ms (-draftmode) before PDF compilation — ideal for fast iterative drafting of papers, resumes, slides, and math.","mimeType":"application/json","serviceName":"TeX402","tags":["latex","linter","syntax-check","diagnostics","chktex","pdflatex","xelatex","arxiv","resume","x402"]},"accepts":[{"scheme":"exact","network":"eip155:8453","amount":"2000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x5e18Dfb04F64e1D0d3593178a004A251506c2e16","maxTimeoutSeconds":300,"extra":{"name":"USDC","version":"2"}}]}}}}}},"429":{"description":"Too Many Requests — pre-settlement per-IP rate limit exceeded (`RATE_LIMIT_RPM`, default 30 req/min). Rejected before x402 payment verification or settlement; inspect `Retry-After`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitErrorResponse"},"example":{"error":"rate_limit_exceeded","message":"Rate limit exceeded on /v1/* endpoints. Please retry after the indicated interval.","retry_after_seconds":12}}}},"500":{"description":"Unexpected internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LintResponse"}}}},"503":{"description":"Service Unavailable — pre-settlement bounded worker queue is full (`MAX_CONCURRENT_WORKERS + MAX_QUEUE_DEPTH`). Rejected before x402 payment verification or settlement so callers are never charged during a traffic spike; inspect `Retry-After`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueSaturatedErrorResponse"},"example":{"error":"queue_saturated","message":"Worker queue is temporarily saturated. No x402 payment was settled; retry shortly.","retry_after_seconds":5}}}}}}},"/health":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getHealth","summary":"Check service health, active x402 network, Docker worker readiness, and bounded queue telemetry","description":"Unmetered operational health check verifying that the `tex402-worker:latest` Docker image is available, the pre-warmed container pool is ready, and reporting active worker and bounded queue concurrency metrics.","responses":{"200":{"description":"Service and worker pool status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"},"example":{"status":"ok","mode":"mainnet","network":"eip155:8453","pay_to":"0x5e18Dfb04F64e1D0d3593178a004A251506c2e16","tex_worker_ready":true,"active_workers":0,"max_concurrent_workers":2,"queued_jobs":0,"max_queue_depth":6}}}}}}},"/.well-known/x402":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getWellKnownX402","summary":"Retrieve x402 v2 service discovery metadata, Bazaar schemas, and MCP tool definitions","description":"Unmetered discovery endpoint returning the service metadata (including `llmsTxtUrl`, `llmsFullTxtUrl`, and `mcpDiscoveryUrl`), metered endpoint pricing (`$0.008` and `$0.002` USDC), `@x402/extensions/bazaar` schemas, and ready-to-register Model Context Protocol (`mcpTools`) definitions.","responses":{"200":{"description":"x402 v2 service and MCP discovery document.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WellKnownX402Response"}}}}}}},"/.well-known/mcp.json":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getMcpDiscoveryCard","summary":"Retrieve the Model Context Protocol (MCP) Server Card for tex402-mcp","description":"Unmetered MCP discovery endpoint describing the `tex402-mcp@1.0.0` npm package (`npx -y tex402-mcp`), required/optional environment variables (`TEX402_BASE_URL`, `TEX402_PRIVATE_KEY`), x402 settlement metadata, and the 3 MCP tools (`tex402_status`, `tex402_lint`, `tex402_compile`).","responses":{"200":{"description":"MCP Server Card JSON document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpDiscoveryResponse"}}}}}}},"/.well-known/api-catalog":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getApiCatalog","summary":"Retrieve the RFC 9727 / RFC 9264 API catalog linkset","description":"Unmetered machine-discoverable API catalog serialized as `application/linkset+json` (RFC 9264 / RFC 9727) linking the service anchor to `service-desc` (`/openapi.json`), `service-doc` (`/docs`), `describedby` (`/llms.txt`, `/llms-full.txt`, `/.well-known/mcp.json`), `status` (`/health`), and `payment` (`/.well-known/x402`).","responses":{"200":{"description":"RFC 9264 `application/linkset+json` API catalog.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/linkset+json":{"schema":{"$ref":"#/components/schemas/ApiCatalogResponse"}}}}}}},"/skill.md":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getAgentSkillMd","summary":"Retrieve installable Agent Skill Markdown file (SKILL.md with YAML frontmatter)","description":"Unmetered Agent Skill specification (`text/markdown; charset=utf-8`) with YAML frontmatter (`name: tex402`) teaching Claude Code, Cursor, Antigravity, Windsurf, and AgentCash how to connect via `npx -y tex402-mcp`, `@x402/fetch`, or `npx agentcash` and execute the **Author -> Lint ($0.002) -> Compile (`include_page_previews: true`, $0.008) -> Visually Inspect 150-DPI PNGs** loop.","responses":{"200":{"description":"Agent Skill Markdown document with YAML frontmatter (`text/markdown`).","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/llms.txt":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getLlmsTxt","summary":"Retrieve concise llms.txt Markdown index for LLM agents","description":"Unmetered `llms.txt` standard Markdown summary providing AI agents with key documentation URLs (`/llms-full.txt`, `/openapi.json`, `/.well-known/x402`, `/.well-known/mcp.json`), Base USDC pricing, and quick pointers for `npx -y tex402-mcp` and `@x402/fetch`.","responses":{"200":{"description":"Concise Markdown discovery index (`text/plain`).","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/llms-full.txt":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getLlmsFullTxt","summary":"Retrieve complete single-file LLM integration guide (llms-full.txt)","description":"Unmetered comprehensive single-file Markdown guide covering exact `POST /v1/compile` and `POST /v1/lint` JSON request/response schemas, `files` (`base64:` binary encoding), engines (`pdflatex`, `xelatex`), bibliography (`biber`/`bibtex`), 150-DPI PNG page previews, pre-settlement status codes (`400`, `402`, `429`, `503` + `Retry-After`), copy-paste `@x402/fetch` TypeScript client code, and `npx -y tex402-mcp` configuration.","responses":{"200":{"description":"Complete LLM integration guide in Markdown (`text/plain`).","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/openapi.json":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getOpenApiSpec","summary":"Retrieve the OpenAPI 3.1.0 JSON specification","description":"Returns this full OpenAPI 3.1.0 specification document in JSON format.","responses":{"200":{"description":"OpenAPI 3.1.0 JSON specification.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/docs":{"get":{"tags":["Discovery & Operations (Unmetered)"],"operationId":"getSwaggerDocs","summary":"Interactive Swagger UI API documentation page","description":"Serves an interactive Swagger UI HTML page preloaded with `/openapi.json`.","responses":{"200":{"description":"Swagger UI HTML page.","content":{"text/html":{"schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"X402PaymentSignature":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"Base64-encoded x402 v2 payment payload containing an EIP-3009 `TransferWithAuthorization` signature for USDC on `eip155:84532` (Base Sepolia) or `eip155:8453` (Base Mainnet). Automatically generated by `@x402/fetch` (`wrapFetchWithPayment`)."},"DevBypassToken":{"type":"apiKey","in":"header","name":"X-Dev-Bypass-Token","description":"Strictly loopback-only (`127.0.0.1` / `::1`, no `X-Forwarded-For` or `X-Real-IP` headers) development bypass token when `ENABLE_DEV_BYPASS=true`."}},"headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded JSON `PaymentRequiredResponse` returned on `HTTP 402` responses, specifying `x402Version: 2`, `resource`, `accepts` payment schemes (`amount`, `asset`, `payTo`, `network`), and `extensions.bazaar` discovery schemas.","schema":{"type":"string"}},"PAYMENT-RESPONSE":{"description":"Base64-encoded JSON `PaymentSettlementReceipt` returned on paid `HTTP 200` responses after facilitator verification and on-chain USDC settlement (`{ success, payer, transaction, network }`).","schema":{"type":"string"}},"EXTENSION-RESPONSES":{"description":"Optional base64-encoded x402 extension metadata header exposed via CORS.","schema":{"type":"string"}},"Retry-After":{"description":"Number of seconds to wait before retrying a request rejected pre-settlement with `HTTP 429` (rate limit) or `HTTP 503` (bounded worker queue full).","schema":{"type":"integer","minimum":1,"example":5}},"Link":{"description":"RFC 8288 Web Linking header pointing autonomous HTTP clients to `service-desc` (`/openapi.json`), `service-doc` (`/docs`), `agent-skill` (`/skill.md`), `payment` (`/.well-known/x402`), `mcp-server` (`/.well-known/mcp.json`), and `describedby` (`/llms.txt`).","schema":{"type":"string"}}},"schemas":{"CompileRequest":{"type":"object","required":["main_tex"],"additionalProperties":false,"properties":{"main_tex":{"type":"string","minLength":1,"description":"Root LaTeX document source code (`main.tex`)."},"files":{"type":"object","description":"Optional map of safe relative paths (e.g. `refs.bib`, `styles/custom.sty`, `sections/intro.tex`, `images/dot.png`) to UTF-8 text or `base64:...` binary payloads. Absolute paths (`/...`), parent traversal (`..`), hidden dotfiles (`.env`), and overriding `main.tex` are strictly rejected.","additionalProperties":{"type":"string"}},"engine":{"type":"string","enum":["pdflatex","xelatex"],"default":"pdflatex","description":"LaTeX engine used for compilation (`pdflatex` for standard documents, `xelatex` for native Unicode/CJK/OpenType `fontspec` documents). Note: `luatex`/`lualatex` are disabled (`chmod 000`) for security."},"bibliography":{"type":"boolean","default":false,"description":"When `true`, runs multi-pass bibliography compilation (`biber` when `main.bcf` is generated by `biblatex`, or `bibtex` when `\\citation`/`\\bibdata` is present in `main.aux`)."},"include_page_previews":{"type":"boolean","default":false,"description":"When `true`, renders every page of the compiled PDF into a 150-DPI PNG image (`pdftoppm -png -r 150`) and returns them as base64 strings in `page_previews_base64`."}}},"CompileResponse":{"type":"object","required":["success","pdf_base64","page_count","page_previews_base64","compile_time_ms","diagnostics"],"properties":{"success":{"type":"boolean","description":"`true` if the LaTeX engine exited with code 0 and produced a non-empty PDF."},"pdf_base64":{"type":["string","null"],"description":"Base64-encoded PDF binary (`%PDF-1.x`), or `null` if compilation failed."},"page_count":{"type":"integer","minimum":0,"description":"Total number of pages in the rendered PDF (`0` on failure)."},"page_previews_base64":{"type":"array","items":{"type":"string"},"description":"Array of base64-encoded 150-DPI PNG images (one per page) when `include_page_previews: true`."},"compile_time_ms":{"type":"number","minimum":0,"description":"Execution duration inside the pre-warmed sandbox container in milliseconds."},"diagnostics":{"type":"array","items":{"$ref":"#/components/schemas/TeXDiagnostic"},"description":"Deduplicated list of structured errors, warnings, and security policy notifications."},"sandbox_metadata":{"$ref":"#/components/schemas/SandboxMetadata"}}},"LintRequest":{"type":"object","required":["main_tex"],"additionalProperties":false,"properties":{"main_tex":{"type":"string","minLength":1,"description":"Root LaTeX document source code (`main.tex`) to lint and validate."},"files":{"type":"object","description":"Optional map of safe relative paths to UTF-8 text or `base64:...` contents.","additionalProperties":{"type":"string"}},"engine":{"type":"string","enum":["pdflatex","xelatex"],"default":"pdflatex","description":"LaTeX engine used for `-draftmode` validation (`pdflatex` or `xelatex`)."}}},"LintResponse":{"type":"object","required":["success","valid","compile_time_ms","diagnostics"],"properties":{"success":{"type":"boolean","description":"`true` if the lint runner completed execution without timing out."},"valid":{"type":"boolean","description":"`true` if `-draftmode` exited with code 0 and no `error`-severity diagnostics occurred."},"compile_time_ms":{"type":"number","minimum":0,"description":"Concurrent `chktex` + `-draftmode` execution time in milliseconds (`<300ms` typical)."},"diagnostics":{"type":"array","items":{"$ref":"#/components/schemas/TeXDiagnostic"},"description":"Combined, deduplicated TeX engine errors/warnings and `[ChkTeX #N]` lint diagnostics."}}},"TeXDiagnostic":{"type":"object","required":["file","line","severity","message","context_snippet","suggested_fix"],"properties":{"file":{"type":"string","description":"Relative file path in the workspace (e.g. `main.tex` or `sections/broken.tex`)."},"line":{"type":["integer","null"],"description":"1-based line number in `file` where the diagnostic occurred, or `null` if file-wide."},"severity":{"type":"string","enum":["error","warning","info"],"description":"Diagnostic severity level."},"message":{"type":"string","description":"Normalized error or warning message from TeX, Kpathsea, or ChkTeX."},"context_snippet":{"type":"string","description":"Exact source line or log snippet surrounding the issue."},"suggested_fix":{"type":"string","description":"Actionable remediation guidance tailored for autonomous LLM agents and human authors."}}},"SandboxMetadata":{"type":"object","required":["isolated","timed_out","files_in_workspace"],"properties":{"isolated":{"type":"boolean","description":"Always `true` (`--network=none --read-only --user 65534:65534`)."},"timed_out":{"type":"boolean","description":"`true` if compilation exceeded the 15,000ms timeout and the container was terminated."},"files_in_workspace":{"type":"array","items":{"type":"string"},"description":"Top-level files present in `/work` after execution."}}},"PaymentRequiredResponse":{"type":"object","required":["x402Version","resource","accepts"],"properties":{"x402Version":{"type":"integer","const":2,"description":"x402 protocol version (`2`)."},"error":{"type":"string","description":"Human-readable payment challenge reason."},"resource":{"type":"object","required":["url","description","mimeType"],"properties":{"url":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"serviceName":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"accepts":{"type":"array","items":{"type":"object","required":["scheme","network","amount","asset","payTo","maxTimeoutSeconds"],"properties":{"scheme":{"type":"string","example":"exact"},"network":{"type":"string","example":"eip155:8453"},"amount":{"type":"string","example":"8000"},"asset":{"type":"string","example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"payTo":{"type":"string","example":"0x5e18Dfb04F64e1D0d3593178a004A251506c2e16"},"maxTimeoutSeconds":{"type":"integer","example":300},"extra":{"type":"object","properties":{"name":{"type":"string","example":"USDC"},"version":{"type":"string","example":"2"}}}}}},"extensions":{"type":"object","description":"Contains the `bazaar` discovery extension input/output examples and JSON schemas."}}},"PaymentSettlementReceipt":{"type":"object","required":["success","payer","transaction","network"],"properties":{"success":{"type":"boolean","example":true},"payer":{"type":"string","description":"EVM wallet address of the buyer that signed the EIP-3009 authorization.","example":"0xF206a1eCA977A6FD579322E5c24Abe3112FA7cBE"},"transaction":{"type":"string","description":"On-chain settlement transaction hash on Base Sepolia or Base Mainnet.","example":"0xfa96d312ffa5f15ffcfad697dbae91a5dec53d84c6726991e3e000d4ab977d69"},"network":{"type":"string","description":"CAIP-2 network identifier (`eip155:84532` or `eip155:8453`).","example":"eip155:8453"}}},"RateLimitErrorResponse":{"type":"object","required":["error","message","retry_after_seconds"],"properties":{"error":{"type":"string","example":"rate_limit_exceeded","description":"Machine-readable pre-settlement rate-limit error code."},"message":{"type":"string","description":"Human-readable explanation of the rate limit."},"retry_after_seconds":{"type":"integer","minimum":1,"example":12,"description":"Seconds until the current IP rate-limit window resets (matches `Retry-After` header)."}}},"QueueSaturatedErrorResponse":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","example":"queue_saturated","description":"Machine-readable pre-settlement worker queue saturation code."},"message":{"type":"string","description":"Human-readable explanation confirming no x402 payment was settled."},"retry_after_seconds":{"type":"integer","minimum":1,"example":5,"description":"Recommended backoff interval in seconds (matches `Retry-After` header)."},"active_workers":{"type":"integer","minimum":0,"description":"Number of currently executing TeX worker containers."},"max_concurrent_workers":{"type":"integer","minimum":1,"description":"Maximum concurrent TeX worker containers."},"queued_jobs":{"type":"integer","minimum":0,"description":"Number of admitted jobs waiting for a worker container."},"max_queue_depth":{"type":"integer","minimum":0,"description":"Maximum bounded queue depth before pre-settlement `HTTP 503` rejection."}}},"HealthResponse":{"type":"object","required":["status","mode","network","pay_to","tex_worker_ready"],"properties":{"status":{"type":"string","enum":["ok"]},"mode":{"type":"string","enum":["testnet","mainnet"]},"network":{"type":"string","example":"eip155:8453"},"pay_to":{"type":"string","example":"0x5e18Dfb04F64e1D0d3593178a004A251506c2e16"},"tex_worker_ready":{"type":"boolean","example":true},"active_workers":{"type":"integer","minimum":0,"example":0,"description":"Currently executing TeX compilation/lint jobs."},"max_concurrent_workers":{"type":"integer","minimum":1,"example":2,"description":"Maximum concurrent worker containers permitted by the worker semaphore."},"queued_jobs":{"type":"integer","minimum":0,"example":0,"description":"Admitted jobs currently queued awaiting a worker slot."},"max_queue_depth":{"type":"integer","minimum":0,"example":6,"description":"Maximum bounded queue depth (`MAX_QUEUE_DEPTH`) before `HTTP 503` pre-settlement shedding."}}},"WellKnownX402Response":{"type":"object","required":["x402Version","service","endpoints","mcpTools"],"properties":{"x402Version":{"type":"integer","const":2},"service":{"type":"object","required":["name","version","description","mode","network","payTo","baseUrl","facilitator"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"mode":{"type":"string"},"network":{"type":"string"},"payTo":{"type":"string"},"baseUrl":{"type":"string"},"facilitator":{"type":"string"},"openapiUrl":{"type":"string"},"docsUrl":{"type":"string"},"skillUrl":{"type":"string"},"llmsTxtUrl":{"type":"string"},"llmsFullTxtUrl":{"type":"string"},"mcpDiscoveryUrl":{"type":"string"}}},"endpoints":{"type":"array","items":{"type":"object"}},"mcpTools":{"type":"array","items":{"type":"object"}}}},"McpDiscoveryResponse":{"type":"object","required":["name","version","description","homepage","package","environmentVariables","tools"],"properties":{"name":{"type":"string","const":"tex402-mcp"},"version":{"type":"string","example":"1.0.0"},"description":{"type":"string"},"homepage":{"type":"string","example":"https://tex.x.gl"},"documentationUrl":{"type":"string","example":"https://tex.x.gl/llms-full.txt"},"transport":{"type":"object","properties":{"type":{"type":"string","example":"stdio"}}},"package":{"type":"object","required":["registry","name","version","runtime","command","args"],"properties":{"registry":{"type":"string","const":"npm"},"name":{"type":"string","const":"tex402-mcp"},"version":{"type":"string","example":"1.0.0"},"runtime":{"type":"string","example":"npx"},"command":{"type":"string","example":"npx"},"args":{"type":"array","items":{"type":"string"},"example":["-y","tex402-mcp"]}}},"environmentVariables":{"type":"array","items":{"type":"object","required":["name","description","required","isSecret"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"isSecret":{"type":"boolean"},"default":{"type":"string"}}}},"x402":{"type":"object"},"tools":{"type":"array","items":{"type":"object","required":["name","description","inputSchema"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"endpoint":{"type":"string"},"method":{"type":"string"},"priceUsd":{"type":"string"},"inputSchema":{"type":"object"}}}}}},"ApiCatalogResponse":{"type":"object","required":["linkset"],"properties":{"linkset":{"type":"array","items":{"type":"object","required":["anchor","service-desc","service-doc","describedby","status","payment"],"properties":{"anchor":{"type":"string","example":"https://tex.x.gl"},"service-desc":{"type":"array","items":{"type":"object"}},"service-doc":{"type":"array","items":{"type":"object"}},"describedby":{"type":"array","items":{"type":"object"}},"status":{"type":"array","items":{"type":"object"}},"payment":{"type":"array","items":{"type":"object"}}}}}}}}}}