Turn diagram-as-code into SVG, PNG, PDF, JPEG, WebP or a JSON PNG data URI.
Choose mermaid, graphviz, d2 or vegalite; syntax failures return a
structured error with the source line (and column when the engine reports it).
SVG is the fastest vector output and has no pixel ceiling. Raster and PDF
outputs are bounded by the published size limits. Vega-Lite data must be
inline, and remote/file-reading features are blocked.
Output format. `json` returns a PNG data URI plus metadata and is the default; `svg`/`png`/`pdf`/`jpeg`/`webp` return the bytes.
default "json"
scalenumber
Zoom the output 0.5–4×. Ignored when `width` is set. Raster and PDF output is capped at 8192×8192 px on the hosted plans (WebP 4096×4096); SVG has no ceiling.
default 1min 0.5max 4
widthinteger
Target width in pixels (16–4096); height follows the aspect ratio and must stay within the same pixel ceiling. Overrides `scale`.
min 16max 4096
backgroundstring
Background colour as `#rrggbb`/`#rgb`, a CSS name, or `transparent` for none.
enginemermaid · graphviz · d2 · vegaliteREQUIRED
Diagram engine: `mermaid`, `graphviz`, `d2` or `vegalite` (Vega-Lite JSON spec).
sourcestringREQUIRED
Diagram source: Mermaid text, DOT, D2 or a Vega-Lite JSON spec. ≤ 64 KiB via POST, ≤ 8 KiB via GET. Vega-Lite specs must inline their data (`url` is refused); Graphviz attributes that read local files (`image=`, `shapefile=`, …) are refused.
max length 65536
themestring
Engine-specific theme. Mermaid: `default|base|dark|forest|neutral`. D2: a numeric theme id — `0` (neutral default), `1`, `3`, `4`, `5`, `8`, `101`, `200` (dark), `300`, `301`. Vega-Lite: `default|dark`. Graphviz ignores it.
layoutstring
Graphviz layout (`dot|neato|fdp|sfdp|circo|twopi`) or D2 layout (`dagre|elk`). Mermaid and Vega-Lite ignore it.
Render TeX with MathJax to vector paths, so the result needs no fonts on the caller. Choose display or inline style, colour, font size and output format.
Output format. `json` returns a PNG data URI plus metadata and is the default; `svg`/`png`/`pdf`/`jpeg`/`webp` return the bytes.
default "json"
scalenumber
Zoom the output 0.5–4×. Ignored when `width` is set. Raster and PDF output is capped at 8192×8192 px on the hosted plans (WebP 4096×4096); SVG has no ceiling.
default 1min 0.5max 4
widthinteger
Target width in pixels (16–4096); height follows the aspect ratio and must stay within the same pixel ceiling. Overrides `scale`.
min 16max 4096
backgroundstring
Background colour as `#rrggbb`/`#rgb`, a CSS name, or `transparent` for none.
texstringREQUIRED
TeX source, e.g. `\frac{a}{b}` or `\int_0^\infty e^{-x}\,dx`. ≤ 64 KiB via POST, ≤ 8 KiB via GET.
Turn source code into a syntax-highlighted image with Pygments. Auto-detect the language or provide it, choose a theme, and add line numbers, window chrome and a filename. SVG is recommended for long listings.
Output format. `json` returns a PNG data URI plus metadata and is the default; `svg`/`png`/`pdf`/`jpeg`/`webp` return the bytes.
default "json"
scalenumber
Zoom the output 0.5–4×. Ignored when `width` is set. Raster and PDF output is capped at 8192×8192 px on the hosted plans (WebP 4096×4096); SVG has no ceiling.
default 1min 0.5max 4
widthinteger
Target width in pixels (16–4096); height follows the aspect ratio and must stay within the same pixel ceiling. Overrides `scale`.
min 16max 4096
backgroundstring
Background colour as `#rrggbb`/`#rgb`, a CSS name, or `transparent` for none.
sourcestringREQUIRED
Source code. ≤ 64 KiB via POST, ≤ 8 KiB via GET, ≤ 2000 lines. Long listings fit as `format=svg` (no pixel ceiling); raster output is limited to 8192×8192 px (~380 lines at 1×).
max length 65536
languagestring
Pygments language name, e.g. `python`; auto-detected when omitted.
max length 64
themestring
Pygments style name. Curated: `default`, `friendly`, `monokai`, `dracula`, `github-dark`, `solarized-dark`, `solarized-light`, `nord`, `one-dark`, `gruvbox-dark`; any other Pygments style name is accepted too.
default "default"
line_numbersboolean
Print a line-number gutter.
default false
windowboolean
Draw a macOS-style window title bar.
default false
titlestring
Filename shown in the window bar (implies `window`).