← Home

API rombik

Generate flowcharts from code straight from scripts, CI or your own apps — the same engine as on the site, over HTTP.

Base: https://rombik.app/api/v1 OpenAPI specification ↗
For AI agents

A ready-made skill for Claude Code and other agents — so they make requests or write automation themselves.

rombik CLI

Work with the API straight from your terminal — render, batch, balance, top-up. “rombik auth” logs you in via the browser. The key is stored locally, never passed into a prompt.

macOS · Linux
sh
curl -fsSL https://rombik.app/install.sh | sh
Windows (PowerShell)
powershell
irm https://rombik.app/install.ps1 | iex

Or download a binary directly:

MCP server

For AI clients without a handy terminal (Claude Desktop, Cursor, Cline…). “rombik mcp” (same program) runs an MCP server over stdio — the agent gets render_flowchart (the chart comes back as an image right in the chat), balance, products, topup_link and gift_credits. Same login: “rombik auth” once.

Install the CLI (above), run “rombik auth”, then connect it in your client (the method depends on the client):

Claude Code
sh
claude mcp add rombik -- rombik mcp
Claude Desktop · Cursor · Cline · Windsurf (config JSON)
json
{
  "mcpServers": {
    "rombik": { "command": "rombik", "args": ["mcp"] }
  }
}

1. Authorization

Every request is signed with an API key (rk_…). Create one in your account — it is shown once, then only the prefix. Header (either of the two):

headers
X-API-Key: rk_YOUR_KEY
Authorization: Bearer rk_YOUR_KEY

2. POST /render

Code → flowchart as a file. Charges 1 credit per chart (3 charts in a file — 3 credits).

JSON with code

bash
curl -X POST https://rombik.app/api/v1/render \
  -H "X-API-Key: rk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"def f(a):\n    return a*2","lang":"python","format":"svg"}' \
  -o schema.svg

Or upload a file

bash
curl -X POST https://rombik.app/api/v1/render \
  -H "X-API-Key: rk_YOUR_KEY" \
  -F [email protected] -F format=pdf \
  -o schema.pdf

Or from a URL

bash
curl -X POST https://rombik.app/api/v1/render \
  -H "X-API-Key: rk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://raw.githubusercontent.com/user/repo/main/app.py","format":"svg"}' \
  -o schema.svg

3. render parameters

FieldTypeReq.Description
codestring✔*Source code (for a JSON body). Or a file via -F file=@…, or a url
urlstringInstead of code: a link to a file (raw.githubusercontent · gist · gitlab · bitbucket · codeberg; github blob → raw). Language — by extension
langstringpython · cpp · c · java · csharp · pascal. For a file — by extension
formatstringdocx (Word, native shapes) · typst · excalidraw · svg (default) · png · pdf · json
fnstringRender only the function with this name
scaleintPNG: scale (zoom), default 3
fragmentboolTypst: a CeTZ fragment without the document preamble
splitboolpage splitting with А/Б connectors; default true for docx/pdf/typst document, explicit true also enables svg/png/excalidraw (false — continuous)
fontstringSVG font (from an allowlist; otherwise the default Times)
jsonbool?json=1 or {"json":true} — JSON response instead of a file
optionsobjectEngine options (see below) — chart words, for format, caption, etc.

* code is required for a JSON body; when uploading a file use file.

Fields of options

FieldTypeDescription
localestring"uk" (default) · "en" — language of chart inserts (step/Exception…)
forFormatstringcomma · range · verbose — look of the counting for
singleEndboolA single “End” instead of one per exit
mainOnlyTerminatorsboolStart/End only for main; subprograms use Entry/Exit
callAsProcessboolA function call as a “Process”, not a “Subprogram”
stripTypesboolStrip types from declarations
returnAsIOboolreturn as an output block
yes / nostringBranch labels (Yes/No)
inWord / outWordstringInput/output words (Input/Output)
startText / endTextstringmain terminators (Start/End)
entryText / exitTextstringsubprogram terminators (Entry/Exit)
returnWordstringWord before return (Return)
forEachWordstringforeach separator (∈)
capWordstringCaption word (Figure)
capFormatstringCaption template: {word} {num} — {text}
figStartintWhich number to start numbering charts from

Custom values (your own branch/IO words, terminators, returnWord, forEachWord, capWord, capFormat, forFormat) require active Pro on the account — otherwise 402 pro_required (the proFeatures field lists which). Toggles, locale, font, scale, figStart are free.

4. render response

By default — a file (byte stream + Content-Disposition):

http
HTTP/1.1 200 OK
Content-Type: image/svg+xml
Content-Disposition: attachment; filename=rombik.svg

<svg xmlns="http://www.w3.org/2000/svg" …>…</svg>

?json=1 — JSON (fields below):

json
{
  "format": "svg",
  "lang": "python",
  "filename": "rombik.svg",
  "encoding": "utf-8",        // or "base64" for png/pdf
  "content": "<svg …>…</svg>",
  "creditsLeft": 41
}
  • format / langwhat was rendered
  • filenamesuggested file name
  • encodingutf-8 (svg/typst/excalidraw/json) or base64 (docx/png/pdf)
  • contentthe result itself (string or base64)
  • creditsLefthow many credits are left

5. JSON mode

Handy for pipelines — not a file but JSON with content. Binary formats (docx/png/pdf) come as base64.

bash
curl -X POST "https://rombik.app/api/v1/render?json=1" \
  -H "X-API-Key: rk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"...","lang":"cpp","format":"png","scale":3}'

6. GET /me

Credit balance and Pro status by key — no browser needed.

bash
curl https://rombik.app/api/v1/me \
  -H "X-API-Key: rk_YOUR_KEY"

Response:

json
{
  "email": "[email protected]",
  "name": "You",
  "credits": 42,
  "pro": true,
  "proUntil": "2026-07-01T00:00:00Z"   // "" if no Pro
}

7. Top-up

POST /topup

Hit “no credits”? Get a payment link right from a script — jarUrl already has the amount and code. Per unit (credits_unit + qty), as a pack (credits + id) or Pro (pro + id); id comes from the catalog on the site.

bash
curl -X POST https://rombik.app/api/v1/topup \
  -H "X-API-Key: rk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"credits_unit","qty":10}'
# → {"jarUrl":"https://send.monobank.ua/jar/…?a=30&t=rk_cr_…","amountUah":30,…}

8. Formats & credits

Formats: docx · typst · excalidraw · svg · png · pdf · json.

Each /render call = 1 credit per chart (the server renders it, so no exceptions for PNG). Top up in your account.

9. Limits & errors

Paid /renderno limit (credits bound it). Free ones (/me) — 60 requests/min per key (above → 429). Errors: {"error":"…"}.

CodeMeaning
200OK — a file (or JSON if json=1)
400Bad request — unknown language/format, broken JSON or unreachable url (bad_source)
401Unknown or missing API key
402No credits (no_credits) or Pro-only options without active Pro (pro_required)
429Free-request limit (only /me): 60/min per key
500Render error on the server

10. Gift credits

POST /gift

Gift export credits to a friend right from a script — give their email and a quantity. It’s deducted from your balance and added to theirs (an account is created by email if needed). They get an email and an in-account notification.

bash
curl -X POST https://rombik.app/api/v1/gift \
  -H "X-API-Key: rk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","qty":5}'
# → {"ok":true,"credits":37}

11. POST /render/batch

POST /render/batch

Many sources in one call — each item is code or url. Charges 1 credit per chart among successful items (balance must be ≥ the item count at least). format:"pdf" → a single multi-page PDF (one page per item); other formats → a zip with one file per item. Up to 100 items. With ?json=1 — a per-item report.

bash
curl -X POST https://rombik.app/api/v1/render/batch \
  -H "X-API-Key: rk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format":"pdf","items":[
    {"url":"https://raw.githubusercontent.com/user/repo/main/a.py"},
    {"code":"def f(x):\n    return x*2","lang":"python","name":"double"}
  ]}' \
  -o project.pdf

12. rombik native format

For languages rombik does not parse (assembler, pseudocode…), or when the chart does not correspond to any code — set lang:"rombik" and put a flowchart tree into code as astJSON. The parser is skipped, but layout still adds ДСТУ shapes, the Start/End terminators, Yes/No labels and numbering. This is full manual control of the chart — Pro only (otherwise 402 pro_required). All export formats and options work as usual.

Structure: an array of functions (each → its own chart)

json
[{ "name": "grade", "main": true, "block": { "kind": "block", "stmts": [
  { "kind": "io", "text": "Ввід s" },
  { "kind": "if", "cond": "s >= 60",
    "then": { "stmts": [ { "kind": "io", "text": "Вивід: Залік" } ] },
    "else": { "stmts": [ { "kind": "io", "text": "Вивід: Незалік" } ] } },
  { "kind": "for", "cond": "i := 1, n",
    "body": { "stmts": [ { "kind": "call", "text": "обробити(i)" } ] } }
] }}]

Node kinds

kindShapeDescription
processrectangleaction; text required
ioparallelograminput/output; start text with «Ввід»/«Вивід» so locale/Pro words apply
callsubprogramcall; text required
terminalterminatorstandalone; Start/End around the function are added automatically
ifdiamondcond + then/else (blocks)
forhexagonspec goes in the cond field (e.g. «i := 1, n») + body
while / dowhileloop diamondcond + body (pre-/post-condition)
inflooploopinfinite; body
break / continueonly inside a loop
connectorcircletext — label; jump:true — a goto jump

Node fields: { kind, text?, cond?, then?, else?, body?, stmts?, jump? }. then/else/body are block nodes {"stmts":[…]} (kind may be omitted), an empty branch is {"stmts":[]}. In for the spec goes in the cond field (not text), format «var := start, end[, step]», e.g. «i := 1, n». Do not draw Start/End/Yes/No by hand — layout adds them. Validation errors come back as text (fix and retry): unknown kind, if/while/for without cond, process/io/call without text, break outside a loop, limits (≤2000 nodes, depth ≤100).

Full example — find the maximum in an array

json
[
  { "name": "findMax", "main": true, "block": { "kind": "block", "stmts": [
    { "kind": "io", "text": "Ввід a, n" },
    { "kind": "process", "text": "m := a[0]" },
    { "kind": "for", "cond": "i := 1, n-1", "body": { "stmts": [
      { "kind": "if", "cond": "a[i] > m",
        "then": { "stmts": [ { "kind": "process", "text": "m := a[i]" } ] },
        "else": { "stmts": [] } }
    ] } },
    { "kind": "io", "text": "Вивід m" },
    { "kind": "terminal", "text": "Повернути m" }
  ] } }
]

Call (CLI or MCP render_flowchart with lang:"rombik")

bash
rombik render schema.json --lang rombik -f pdf -o out.pdf

Ready to start?