Diagrams libraries are written in a variety of languages: Haskell, Python, JavaScript, Go, PHP, Java... some also have C bindings.
Trust us, you have better things to do than install all the requirements to use them. Get started in no time!
Simple
Kroki provides a unified API for all the diagram libraries. Learn once use diagrams anywhere!
Free & Open source
All the code is available on GitHub and our goal is to provide Kroki as a free service.
Fast
Built using a modern architecture, Kroki offers great performance.
Thanks to Exoscale, which has kindly offered two servers,
we can provide Kroki as a free service!
However, some parts of the infrastructure are still host on other providers, so we are still looking for sponsors to cover all the
expenses.
Kroki provides an HTTP API to create diagrams from textual descriptions.
Kroki handles both GET and POST requests.
When using GET requests, your diagram must be encoded in the URL using a deflate + base64 algorithm.
But don't worry, if you're not familiar with deflate or base64 (or if you don't want to use them),
you can also send your diagram as plain text using POST requests (see below).
Let's take an example with a GraphViz "Hello World":
hello.dot
digraph G {Hello->World}
Here, we are using a Python one-liner to encode our diagram using deflate + base64:
{
"diagram_source": "digraph G {Hello->World}",
"diagram_type": "graphviz",
"output_format": "svg"
}
In this case, you don't need to encode your diagram.
It's also possible to send your diagram as plain text using the Content-Type header.
The output format will be specified using the Accept header and the diagram source will be sent as the request body:
POST /graphviz
Accept: image/svg+xml
Content-Type: text/plain
digraph G {
Hello->World
}
You can also define the output format in the URL if you don't want to add an Accept header:
POST /graphviz/svg
Content-Type: text/plain
digraph G {
Hello->World
}
The same concept applies when sending the diagram as JSON:
POST /graphviz/svg
{
"diagram_source": "digraph G {Hello->World}"
}
Please note that you can interact with the API using any HTTP client.
If you want to learn more, head to our documentation.
In particular, check out the Usage section to find out how
to send requests to the Kroki API using:
Sponsors play a critical role, without them, we won't be able to provide Kroki as a free service.
To make Kroki sustainable, we need your support.
If you want to become a sponsor, please 👋 contact us.
Kroki is a free service built and maintained by Yuzu tech and supported by Exoscale.
Kroki is an open source project licensed under the MIT license.
This means that Kroki is never going away; anyone can host this service with minimal resource requirements.