Skip to content

Diagram Rendering

Render any diagram-as-code to SVG or PNG with one HTTP call. Backed by a local Kroki engine — no auth, rate-limited to 30 req/min per IP.

Base URL: https://archlint.dev

Quick start

curl -s https://archlint.dev/api/sandbox/render \
  -H 'Content-Type: application/json' \
  -d '{"type":"plantuml","source":"@startuml\nAlice -> Bob : hello\n@enduml"}'

→ 200 with Content-Type: image/svg+xml. Add "format":"png" for a PNG.

The request body is always the same three fields:

Field Type Description
type string One of the diagram types below (e.g. plantuml)
source string The diagram source text
format string svg (default) or png

Endpoints

Endpoint Use
POST /api/sandbox/render Render from JSON {type, source, format} — the main one
GET /api/render/:type/:format?source=<base64> Render for embedding in <img> tags
POST /api/render/:type/:format Same, but the body is the raw source
POST /api/render/auto/:format Auto-detect the type from the source
GET /api/render/health Renderer status + supported file extensions

Embedding in a page

GET /api/render/:type/:format?source=BASE64 returns the raw image — ideal for docs and <img> tags:

<img src="https://archlint.dev/api/render/plantuml/svg?source=QHN0YXJ0dW1sCkFsaWNlIC0+IEJvYiA6IGhlbGxvCkBlbmR1bWw=">

(source is the diagram, base64-encoded.)

Text → diagram

plantuml

UML — sequence, class, component, activity, state, use-case.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"plantuml","source":"@startuml\nAlice -> Bob : hello\nBob --> Alice : hi\n@enduml"}'

c4plantuml

C4 architecture (context → container → component → deployment) via PlantUML.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"c4plantuml","source":"@startuml\n!include <C4/C4_Context>\nPerson(user, \"User\")\nSystem(sys, \"System\")\nRel(user, sys, \"Uses\")\n@enduml"}'

d2

Modern declarative diagrams.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"d2","source":"client -> api: request\napi -> db: query"}'

mermaid

Flowchart, sequence, ER. Note: intermittently unavailable in the deployed Kroki (returns 400/503) — prefer plantuml or d2 for sequence/flow.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"mermaid","source":"graph TD\nA[Client] --> B[API] --> C[DB]"}'

graphviz

DOT / Graphviz.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"graphviz","source":"digraph G { A -> B; B -> C; }"}'

structurizr

C4 via the Structurizr DSL. Avoid user/system as identifiers — they're reserved.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"structurizr","source":"workspace {\n  model {\n    u = person \"User\"\n    s = softwareSystem \"System\"\n    u -> s \"Uses\"\n  }\n  views {\n    systemContext s { include * }\n  }\n}"}'

nomnoml

Lightweight UML-style sketches.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"nomnoml","source":"[Client] -> [Server]\n[Server] -> [Database]"}'

erd

Entity-relationship (crow's foot).

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"erd","source":"[Person]\n*name\n[Order]\n*id\nPerson 1--* Order"}'

dbml

Database Markup Language.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"dbml","source":"Table users {\n  id int [pk]\n  name varchar\n}\nTable posts {\n  id int [pk]\n  user_id int\n}"}'

blockdiag

Block diagram.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"blockdiag","source":"blockdiag {\n  A -> B -> C;\n}"}'

seqdiag

Sequence diagram.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"seqdiag","source":"seqdiag {\n  A -> B [label = \"request\"];\n  B --> A [label = \"response\"];\n}"}'

actdiag

Activity diagram.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"actdiag","source":"actdiag {\n  A -> B -> C;\n}"}'

nwdiag

Network topology.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"nwdiag","source":"nwdiag {\n  network dmz {\n    web [address = \"172.16.0.1\"];\n  }\n  network internal {\n    db [address = \"10.0.0.1\"];\n  }\n}"}'

rackdiag

Rack / server layout.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"rackdiag","source":"rackdiag {\n  12U;\n  1: server [2U];\n  3: switch [1U];\n}"}'

packetdiag

Packet layout.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"packetdiag","source":"packetdiag {\n  0-15: \"Header\";\n  16-31: \"Payload\";\n}"}'

wavedrom

Digital timing diagrams.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"wavedrom","source":"{ signal: [{ name: \"clk\", wave: \"p...\" }, { name: \"data\", wave: \"x3x4x\" }] }"}'

pikchr

SQLite's diagram language.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"pikchr","source":"box \"hello\"\narrow\nbox \"world\""}'

ditaa

ASCII-art diagrams.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"ditaa","source":"+--------+   +--------+\n| Client |-->| Server |\n+--------+   +--------+"}'

svgbob

ASCII-art, SVG-native.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"svgbob","source":".------.       .------.\n| Client | ----> | Server |\n`------`       `------`"}'

JSON & structured

vega

Vega declarative charts (JSON).

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"vega","source":"{\"$schema\":\"https://vega.github.io/schema/vega/v5.json\",\"data\":{\"values\":[{\"a\":\"A\",\"b\":28},{\"a\":\"B\",\"b\":55}]},\"mark\":\"bar\",\"encoding\":{\"x\":{\"field\":\"a\"},\"y\":{\"field\":\"b\",\"type\":\"quantitative\"}}}"}'

vegalite

Vega-Lite — a simpler, higher-level chart grammar.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"vegalite","source":"{\"data\":{\"values\":[{\"a\":\"A\",\"b\":28},{\"a\":\"B\",\"b\":55}]},\"mark\":\"bar\",\"encoding\":{\"x\":{\"field\":\"a\",\"type\":\"nominal\"},\"y\":{\"field\":\"b\",\"type\":\"quantitative\"}}}"}'

excalidraw

Hand-drawn style — send an Excalidraw .excalidraw scene JSON object.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"excalidraw","source":"{\"type\":\"excalidraw\",\"version\":2,\"elements\":[{\"type\":\"rectangle\",\"x\":100,\"y\":100,\"width\":200,\"height\":100}]}"}'

diagramsnet

draw.io / mxGraph XML — send the diagram XML.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"diagramsnet","source":"<mxGraphModel><root><mxCell id=\"0\"/><mxCell id=\"1\" parent=\"0\"/><mxCell id=\"2\" value=\"Hello\" vertex=\"1\" parent=\"1\"><mxGeometry x=\"20\" y=\"20\" width=\"120\" height=\"60\" as=\"geometry\"/></mxCell></root></mxGraphModel>"}'

Specialised

bpmn

Business Process Model and Notation (XML).

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"bpmn","source":"<?xml version=\"1.0\"?><bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\"><bpmn:process id=\"p1\"><bpmn:startEvent id=\"start\"/><bpmn:endEvent id=\"end\"/></bpmn:process></bpmn:definitions>"}'

umlet

UMLet — send a .uxf XML document.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"umlet","source":"<diagram program=\"umlet\" version=\"14.2\"><zoom_level>10</zoom_level><element><type>com.umlet.element.base.Text</type><coordinates><x>10</x><y>10</y><w>100</w><h>40</h></coordinates><panel_attributes>Hello</panel_attributes></element></diagram>"}'

wireviz

Cable / wiring-harness diagrams (YAML).

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"wireviz","source":"connectors:\n  X1: [DSub, 9, female]\ncables:\n  W1:\n    wirecount: 3\n    colors: [RD, BK, GN]\n    connections:\n      - [X1, [1,2,3]]"}'

symbolator

HDL symbols — send VHDL/Verilog source; it renders the entity/module as a symbol.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"symbolator","source":"entity foo is\n  port (\n    a : in std_logic;\n    b : out std_logic\n  );\nend foo;"}'

bytefield

Register / packet layout. Send a bytefield definition.

curl -s https://archlint.dev/api/sandbox/render -H 'Content-Type: application/json' \
  -d '{"type":"bytefield","source":"(defattrs :plain {:font-family \"monospace\"})\n(row (cell \"Header\") (cell \"Payload\"))"}'

Notes & errors

  • Max source size: 250 KB.
  • Response: SVG is image/svg+xml, PNG is image/png. Both cache for 120s.
  • Errors:
  • 400 — unknown type, empty source, or invalid syntax
  • 413 — source too large
  • 429 — rate limit (30 req/min), with Retry-After
  • 503 — renderer busy (30 concurrent renders max)