API rombik
Generate flowcharts from code straight from scripts, CI or your own apps — the same engine as on the site, over HTTP.
A ready-made skill for Claude Code and other agents — so they make requests or write automation themselves.
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.
curl -fsSL https://rombik.app/install.sh | shirm https://rombik.app/install.ps1 | iexOr download a binary directly:
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 mcp add rombik -- rombik mcp{
"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):
X-API-Key: rk_YOUR_KEY
Authorization: Bearer rk_YOUR_KEY2. POST /render
Code → flowchart as a file. Charges 1 credit per chart (3 charts in a file — 3 credits).
JSON with code
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.svgOr upload a file
curl -X POST https://rombik.app/api/v1/render \
-H "X-API-Key: rk_YOUR_KEY" \
-F [email protected] -F format=pdf \
-o schema.pdfOr from a URL
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.svg3. render parameters
| Field | Type | Req. | Description |
|---|---|---|---|
| code | string | ✔* | Source code (for a JSON body). Or a file via -F file=@…, or a url |
| url | string | — | Instead of code: a link to a file (raw.githubusercontent · gist · gitlab · bitbucket · codeberg; github blob → raw). Language — by extension |
| lang | string | ✔ | python · cpp · c · java · csharp · pascal. For a file — by extension |
| format | string | — | docx (Word, native shapes) · typst · excalidraw · svg (default) · png · pdf · json |
| fn | string | — | Render only the function with this name |
| scale | int | — | PNG: scale (zoom), default 3 |
| fragment | bool | — | Typst: a CeTZ fragment without the document preamble |
| split | bool | — | page splitting with А/Б connectors; default true for docx/pdf/typst document, explicit true also enables svg/png/excalidraw (false — continuous) |
| font | string | — | SVG font (from an allowlist; otherwise the default Times) |
| json | bool | — | ?json=1 or {"json":true} — JSON response instead of a file |
| options | object | — | Engine 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
| Field | Type | Description |
|---|---|---|
| locale | string | "uk" (default) · "en" — language of chart inserts (step/Exception…) |
| forFormat | string | comma · range · verbose — look of the counting for |
| singleEnd | bool | A single “End” instead of one per exit |
| mainOnlyTerminators | bool | Start/End only for main; subprograms use Entry/Exit |
| callAsProcess | bool | A function call as a “Process”, not a “Subprogram” |
| stripTypes | bool | Strip types from declarations |
| returnAsIO | bool | return as an output block |
| yes / no | string | Branch labels (Yes/No) |
| inWord / outWord | string | Input/output words (Input/Output) |
| startText / endText | string | main terminators (Start/End) |
| entryText / exitText | string | subprogram terminators (Entry/Exit) |
| returnWord | string | Word before return (Return) |
| forEachWord | string | foreach separator (∈) |
| capWord | string | Caption word (Figure) |
| capFormat | string | Caption template: {word} {num} — {text} |
| figStart | int | Which 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/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):
{
"format": "svg",
"lang": "python",
"filename": "rombik.svg",
"encoding": "utf-8", // or "base64" for png/pdf
"content": "<svg …>…</svg>",
"creditsLeft": 41
}format / lang— what was renderedfilename— suggested file nameencoding—utf-8(svg/typst/excalidraw/json) orbase64(docx/png/pdf)content— the result itself (string or base64)creditsLeft— how 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.
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.
curl https://rombik.app/api/v1/me \
-H "X-API-Key: rk_YOUR_KEY"Response:
{
"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.
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 /render — no limit (credits bound it). Free ones (/me) — 60 requests/min per key (above → 429). Errors: {"error":"…"}.
| Code | Meaning |
|---|---|
| 200 | OK — a file (or JSON if json=1) |
| 400 | Bad request — unknown language/format, broken JSON or unreachable url (bad_source) |
| 401 | Unknown or missing API key |
| 402 | No credits (no_credits) or Pro-only options without active Pro (pro_required) |
| 429 | Free-request limit (only /me): 60/min per key |
| 500 | Render 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.
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.
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.pdf12. 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)
[{ "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
| kind | Shape | Description |
|---|---|---|
| process | rectangle | action; text required |
| io | parallelogram | input/output; start text with «Ввід»/«Вивід» so locale/Pro words apply |
| call | subprogram | call; text required |
| terminal | terminator | standalone; Start/End around the function are added automatically |
| if | diamond | cond + then/else (blocks) |
| for | hexagon | spec goes in the cond field (e.g. «i := 1, n») + body |
| while / dowhile | loop diamond | cond + body (pre-/post-condition) |
| infloop | loop | infinite; body |
| break / continue | — | only inside a loop |
| connector | circle | text — 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
[
{ "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")
rombik render schema.json --lang rombik -f pdf -o out.pdfReady to start?