Public API
Generate AI Visio diagrams from text and convert draw.io or diagram JSON into vsdx, png, svg and drawio files. Same credits and engine as the web app.
Replace vsdx_YOUR_KEY with a key from Settings → API keys. Send Authorization: Bearer vsdx_… or x-api-key.
curl -X POST https://vsdx.ai/api/v1/generate \
-H 'Authorization: Bearer vsdx_YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Cloud migration swimlane for finance and engineering",
"diagramType": "swimlane",
"formats": ["vsdx", "png", "drawio"]
}'curl -X POST https://vsdx.ai/api/v1/convert \
-H 'Authorization: Bearer vsdx_YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{
"drawio": "<mxfile>...</mxfile>",
"formats": ["vsdx", "png"]
}'curl https://vsdx.ai/api/v1/credits \ -H 'Authorization: Bearer vsdx_YOUR_KEY'
| Method | Path | Credits | Description |
|---|---|---|---|
| POST | /api/v1/generate | 10 | Prompt → editable diagram files (sync, up to a few minutes). |
| POST | /api/v1/convert | 5 | draw.io XML or diagram IR → chosen formats. |
| GET | /api/v1/credits | Free | Remaining credit balance for the key owner. |
| GET | /api/v1/openapi.json | Free | Machine-readable OpenAPI 3.1 document. |
| code | Meaning |
|---|---|
| unauthorized | Missing or invalid API key. |
| insufficient_credits | Not enough credits for the operation. |
| invalid_request | Body failed validation. |
| payload_too_large | drawio field exceeds 2 MB. |
| rate_limited | Too many requests (120/minute per key). |
| upstream_failed | Render or AI engine could not finish. |
| internal | Unexpected server error. |