Public API is available. Convert Markdown to images with 50 watermarked requests/month.

Automation

Add a Markdown-to-image tool to Dify

Import one OpenAPI schema and your Dify agents and workflows can render Markdown into images on their own — no code node, no external service to host.

Why

What people build with it

01

Let an agent turn its own Markdown answer into a shareable card without a separate manual step.

02

In a workflow, render retrieved documents as images for a report-style or slide-style output.

03

Give a knowledge-base bot the ability to return formatted tables and diagrams as pictures instead of raw Markdown text.

Setup

Connecting Dify

  1. 01

    Create an API token under Profile → API tokens. It starts with mti_ and is shown only once.

  2. 02

    In Dify, open Tools → Custom → Create Custom Tool.

  3. 03

    In the schema field, switch to importing from a URL and paste this. Dify fetches the OpenAPI document and lists generate_image automatically.

    https://markdowntoimage.com/api/v1/openapi.json
  4. 04

    Set the authentication method to API Key, choose Bearer as the type, and paste your mti_ token as the value.

  5. 05

    Save the tool. generate_image is now available to any agent, chatflow, or workflow node in that workspace.

Every parameter — themes, fonts, code styles, page size for PDF — is listed in the API reference.

Troubleshooting

Support
Q1

Why can't I import the /api/v1/schema URL directly?

That endpoint returns a compact tool descriptor, not an OpenAPI document, and Dify's importer expects OpenAPI 3.x. Use /api/v1/openapi.json instead — same endpoint, described in the format Dify parses.
Q2

Which parts of Dify can use this tool?

Anything that can call a custom tool: agents, chatflows, and the tool node in workflows. Once saved it appears in the tool picker for the whole workspace.
Q3

Can the agent choose the output format itself?

Yes. The schema exposes format as an enum of png, jpeg, webp, and pdf, so the model can pick one based on what the user asked for. Leave it out and it defaults to png.
Q4

Where does the generated file live?

The response returns a hosted URL. If you need the file in your own storage, either download it in the following step of your workflow, or set "mode" to "binary" to get the bytes back directly and write them wherever you want.
Markdown to Image in Dify | Custom Tool Setup | MarkdownToImage