Free plan

Diagram

Draw a flowchart or other diagram from a few lines of text
POST
/v1/render/diagram

About this tool

This tool needs no file. You describe a diagram in a short text and it draws it. It can make flowcharts, sequence, class and state diagrams, Gantt charts, mind maps and timelines (using Mermaid), or graphs (using Graphviz). The text is the drawing recipe, so the example in the box helps.
For example, you show how an order moves through your shop.

How to use it

  1. Choose this tool. You do not need to add a file.
  2. Type or paste your diagram text, and choose its syntax if asked.
  3. Pick a theme and the picture format.
  4. Press Generate.
  5. Download the diagram.

What you get back

You get a diagram as a picture or SVG. Download it.
GOOD TO KNOW
Text in, one picture out. Rendered offline in a real browser; the diagram text cannot load anything from the network. Counts as one render.
TEST IT LIVE

Try Diagram in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Render
Plan
Free
Method
POST
Endpoint
/v1/render/diagram
Tool ID
render.diagram
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Render
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/render/diagram" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'source=graph TD
  A[Start] --> B{Ready?}
  B -->|Yes| C[Ship]' \
  -F 'syntax=auto' \
  -F 'output=png'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.render.diagram({
    "source": "graph TD\n  A[Start] --> B{Ready?}\n  B -->|Yes| C[Ship]",
    "syntax": "auto",
    "output": "png"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->render()->diagram([
    'source' => 'graph TD
  A[Start] --> B{Ready?}
  B -->|Yes| C[Ship]',
    'syntax' => 'auto',
    'output' => 'png',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Draw a diagram from a short text description: flowcharts, sequence diagrams, class and state diagrams, entity-relationship diagrams, Gantt charts, pie charts, mind maps and timelines (Mermaid), or Graphviz graphs (DOT). Returns a PNG, JPEG, WebP, AVIF or SVG picture.

Diagram works from text and settings, so no file is needed. The required inputs are source.

Diagram is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/render/diagram with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.