Kroki API

⭐ Beginner's Pick Development / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

Kroki is a free, open-source API that converts plain-text diagram descriptions into images (SVG, PNG, PDF) supporting over 20 diagram types including Mermaid, PlantUML, Graphviz, and more. No authentication is required, just send your diagram code and receive a rendered image. It is ideal for generating architecture diagrams, flowcharts, and sequence diagrams programmatically.

💡

Beginner Tip

Start with simple Mermaid or PlantUML diagrams since they have the most readable syntax. The easiest way to use Kroki is to POST your diagram text directly to the endpoint and receive an SVG in the response body.

Available Data

Kroki data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Kroki",
    "description": "Creates diagrams from textual descriptions",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

(binary image data) The response body is the rendered diagram in the requested format: SVG as text, PNG or PDF as binary data

Implementation Example

const url = "https://kroki.io/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

400 Bad Request with syntax error message The diagram definition contains syntax errors for the chosen diagram type
Validate your diagram code at https://kroki.io in the interactive editor before using the API; each diagram type has its own syntax rules
Garbled or missing output image The diagram text was not correctly encoded when using GET requests
Use Base64 URL-safe encoding (replace + with - and / with _) for the diagram definition in the URL path
Timeout on large or complex diagrams Diagrams with hundreds of nodes can exceed render time limits on the public instance
Simplify the diagram or self-host Kroki (it is open source) for heavy workloads without timeout restrictions

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 334ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Development
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →