# Kroki: Free Open Source Unified API for All Diagram Types

Source: https://www.youtube.com/watch?v=412TSUAO5oE
Recap page: https://rapidrecap.app/video/412TSUAO5oE
Generated: 2025-12-12T08:34:02.627+00:00

---
## Quick Overview

Kroki provides a free, open-source, unified API gateway that transforms textual descriptions into over 25 different diagram types, including BlockDiag, Mermaid, and PlantUML, offering output formats like SVG, PNG, PDF, and more, which can be accessed instantly via a public API or self-hosted for integration into technical documentation, CI/CD pipelines, or any project requiring programmatic diagram generation.

**Key Points:**
- Kroki offers a unified API gateway supporting over 25 diagram types, such as BlockDiag, Mermaid, PlantUML, and Excalidraw, transforming text descriptions into visual diagrams.
- The service is available as a free public service (kroki.io) or as a self-managed instance using Docker or Podman.
- Diagrams can be generated via HTTP GET or POST requests, with content encoding required for GET requests using deflate + base64 algorithms.
- The platform supports multiple output formats including SVG (default), PNG, JPEG, PDF, TXT, and base64 encoding.
- The video demonstrates deploying Kroki on Elestio (0:55) and shows the interactive 'Try' section on the website where users can test different diagram syntaxes.
- The documentation provides examples for generating diagrams using cURL commands and shows how to encode diagrams for URL-based GET requests.
- Kroki is ideal for technical documentation, CI/CD integration, and automating diagram creation within various software projects.

![Screenshot at 0:06: The initial view of the Kroki website landing page highlights its core function: 'Creates diagrams from textual descriptions,' showcasing the online 'Try' interface with a sample BlockDiag code input and its rendered output.](https://ss.rapidrecap.app/screens/412TSUAO5oE/00-00-06.png)

**Context:** This video serves as a detailed introduction and tutorial for Kroki, an open-source tool that acts as a unified API gateway for generating various types of diagrams (like flowcharts, sequence diagrams, etc.) directly from text-based descriptions. The presenter walks through the public website, demonstrates the live editor, reviews the supported diagram types and output formats, and shows how to deploy a self-hosted instance via Elestio.

## Detailed Analysis

Kroki functions as a free, open-source, unified API for diagram generation, accepting textual descriptions and rendering them into various visual formats. The presenter begins by showing the Kroki website's 'Try' section (0:06), where users can input code for diagram types like BlockDiag and instantly see the result, including customization options for colors. The tool supports over 25 diagram types, including BlockDiag, Mermaid, PlantUML, Excalidraw, and Graphviz, with support for generating outputs in PNG, SVG, JPEG, PDF, TXT, and base64 formats, as detailed in the 'Diagram types' table (7:34). The video then transitions to demonstrating deployment using the Elestio platform (0:55), where the user selects Kroki, chooses a service plan (e.g., MEDIUM-2C-4G for $0.0219/hour), and initiates deployment (1:22). Upon successful deployment, the user receives an email with the URL and credentials for their private instance (1:24). The documentation section explains how to use the API, emphasizing that for GET requests, the diagram source must be encoded using a deflate + base64 algorithm (2:53). The presenter demonstrates using an online Encoder/Decoder tool to manually encode a simple diagram definition (3:45) and then uses the resulting URL to render the diagram in the browser (4:17). Finally, the video highlights the extensive examples available on the Kroki website, covering common graphs, UML/C4, project management, visualization (like the Vega Word Cloud example at 6:44), and more, showcasing the tool's versatility for technical documentation.

### Kroki Overview & Features

- Creates diagrams from textual descriptions
- Provides a unified API supporting BlockDiag, SeqDiag, ActDiag, PlantUML, Mermaid, and over 25 others
- Features include being ready to use, simple syntax, and being free/open source.

### Deployment on Elestio

- User selects Kroki in the 'Create Service' menu (1:02)
- Chooses a provider (Netcup) and service plan (MEDIUM-2C-4G) (1:05)
- Completes support selection (Level 1 Basic included) (1:12)
- Service deployment is initiated (1:22).

### API Usage & Encoding

- Diagrams are generated via HTTP GET/POST requests
- GET requests require diagram source to be encoded using deflate + base64 (2:53)
- Documentation provides cURL examples for POST requests (3:36) and a Python one-liner for encoding (2:47).

### Diagram Examples Showcase

- Demonstrates syntax and output for BlockDiag (4:48), Sequence diagram (SeqDiag), Activity diagram (ActDiag) (6:41), Network diagram (NwDiag) (6:42), and Vega Word Cloud (6:44).

### Diagram Type Support Matrix

- A table details which diagram types support PNG, SVG, JPEG, PDF, TXT, and base64 output formats (7:34)
- SVG is shown to be the most widely supported format.

![Screenshot at 0:00: Presenter introducing the topic of generating diagrams from textual descriptions using Kroki.](https://ss.rapidrecap.app/screens/412TSUAO5oE/00-00-00.png)
![Screenshot at 0:10: Demonstration of the Kroki 'Try' feature showing the BlockDiag text input being rendered into a flowchart visualization.](https://ss.rapidrecap.app/screens/412TSUAO5oE/00-00-10.png)
![Screenshot at 1:24: The confirmation email received after deployment, providing the specific URL and login credentials for the newly provisioned Kroki instance.](https://ss.rapidrecap.app/screens/412TSUAO5oE/00-01-24.png)
![Screenshot at 7:34: A detailed table from the documentation listing the 25+ supported diagram types and the output formats \(PNG, SVG, JPEG, PDF, TXT, base64\) compatible with each.](https://ss.rapidrecap.app/screens/412TSUAO5oE/00-07-34.png)
![Screenshot at 6:44: Example of a Vega Word Cloud generated from Vega-Lite specification code, illustrating Kroki's support for data visualization diagrams.](https://ss.rapidrecap.app/screens/412TSUAO5oE/00-06-44.png)
