Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Mermaid API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fmermaidchart.com%2Fmermaidchart" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fmermaidchart.com%2Fmermaidchart" | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with Mermaid API.
Validate Mermaid diagram code and get back whether it is valid, the diagramType, and the reason it fails
Render diagram code to svg, png, or pdf by setting the required format field
Control PNG output with scale and background, or set pdf fit to size the page to the diagram
Skip the shared render cache for a single call by sending cache false
Check the key owner's API credit balance and the per-endpoint cost before a batch of renders
GET STARTED
Patterns agents use Mermaid API for, with concrete tasks.
★ Agent self-checks the diagrams it writes, through Jentic
LLMs often write Mermaid code that almost parses. An agent connected through Jentic sends its draft to the validate operation, reads the error message when the code is invalid, fixes it, and only then calls render to produce the final SVG or PNG. Your Mermaid key stays on your own Jentic One instance, and your rules decide whether the agent may call render as well as validate.
POST /v1/validate with code 'flowchart TD\n A[Start] --> B[Done]'; if valid is false, correct the code from the returned message and validate again, then POST /v1/render with format 'svg'
Diagrams in CI pipelines and docs builds
A docs build can render every Mermaid block to static images instead of shipping a client-side renderer. The render operation takes code and format, returns the image bytes with the matching content type, or a JSON envelope when the request accepts application/json. A failed parse returns ERR_DIAGRAM_INVALID so the pipeline can stop on a broken diagram.
POST /v1/render with code from docs/architecture.mmd, format 'png', and png { scale: 2, background: 'white' }, then save the bytes as architecture.png
PDF exports of diagrams
Product teams that let users download diagrams can render to PDF. With pdf fit set to true the page is the size of the diagram; with fit false the diagram is scaled onto one A4 page, which suits printable reports.
POST /v1/render with the diagram code, format 'pdf', and pdf { fit: false } to produce a one-page A4 PDF
Credit-aware batch rendering
Each keyed call spends API credits from the key owner's balance. Before a large batch, an agent calls the balance operation, which costs no credits, to see the remaining balance and every endpoint's cost, and stops before the allowance runs out.
GET /v1/balance, compare the remaining credits with the number of diagrams queued, and render only as many as the balance covers
8 endpoints — the mermaid api validates and renders mermaid diagram code for programs such as agents, llm tool calls, and ci pipelines.
METHOD
PATH
DESCRIPTION
/v1/validate
Validate diagram code
/v1/render
Render diagram code to svg, png, or pdf
/v1/balance
Get the credit balance and endpoint costs
/v1/errors.json
Get the error reference
/health
Check liveness and deployed build
/v1/validate
Validate diagram code
/v1/render
Render diagram code to svg, png, or pdf
/v1/balance
Get the credit balance and endpoint costs
/v1/errors.json
Get the error reference
/health
Check liveness and deployed build
What agents get from Jentic-routed access to this vendor.
Setup
Wiring the Mermaid API by hand means handling its bearer key, choosing bytes or JSON-envelope responses per content type, and tracking credit spend. Through Jentic you install once, import the Mermaid API from the API Directory, store the key once, and your agent calls it.
Permission scoping
The Mermaid API carries the diagram and output format inside the request body, so rules bound which operations your agent may call, not which diagrams. Limit the agent to the operations it needs, such as validation, so credit-spending renders are not included unless you add them.
Credential isolation
Your Mermaid API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'render a Mermaid diagram to PNG' or 'check if Mermaid code is valid', and Jentic returns the matching Mermaid operation with its input schema so the agent calls the right endpoint without browsing the reference docs.
Alternatives and complements available in the Jentic catalogue.
Specific to using Mermaid API through Jentic.
What authentication does the Mermaid API use?
Per its OpenAPI spec, the Mermaid API uses a bearer API key (the apiKey scheme) sent as `Authorization: Bearer <key>` on validate, render, and balance. The health, openapi.json, docs, errors.json, and llms.txt reference endpoints need no auth. Through Jentic the key is stored encrypted by your own Jentic One instance and injected when the agent calls.
Can I render Mermaid diagrams to PNG with a transparent background?
Yes. Send POST /v1/render with code, format set to png, and a png object whose background is a CSS colour or transparent. The png scale option sets device pixels per CSS pixel and is lowered automatically when the image would exceed the service ceiling.
How do I validate a diagram through Jentic?
Install Jentic One with `curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh`, import the Mermaid API from the directory, and store your key. Your agent searches 'validate Mermaid diagram code', gets POST /v1/validate with its schema, and sends the code field. To run it on your own infrastructure, install Jentic One from its GitHub repo.
Can I limit what my agent is allowed to do with the Mermaid API?
Yes. For example, write a rule that allows only POST /v1/validate, so the agent can check diagram code as often as it likes but cannot spend credits on renders. Add POST /v1/render when you want it to produce images, and every call it makes is logged.
Is there a Mermaid MCP server?
You don't need an MCP server to give your agent the Mermaid API. Jentic connects it directly from the API Directory: import it, store your credential once, and your agent calls it.
What are the rate limits for the Mermaid API?
The spec describes a burst limit reported per key in the ratelimit-policy and ratelimit response headers, with retry-after on a 429. Keyed calls also spend API credits: validate and render cost 1 credit each and balance costs 0. The allowance and burst defaults are service configuration, so check the API reference at https://api.mermaid.ai/v1/docs for current values.
Is the Mermaid API stable?
No, it is in beta. The spec states that request and response fields, defaults, and limits may change and the Mermaid version can bump without notice, while the /v1 prefix, the error structure, and bearer authentication stay fixed. Every response carries the x-mermaid-api-phase header with the value beta.
For Agents
Validate Mermaid diagram code and render it to SVG, PNG, or PDF so an agent can check and ship the diagrams it writes.
Use for: Check whether this Mermaid flowchart code is valid before I commit it, Render a sequence diagram to PNG with a transparent background, I want to turn Mermaid code from my README into an SVG, Export an architecture diagram as a PDF sized to the diagram
Not supported: Does not store diagrams, host a diagram editor, or render other diagram languages such as PlantUML. Use for validating and rendering Mermaid code only.
The Mermaid API validates and renders Mermaid diagram code for programs such as agents, LLM tool calls, and CI pipelines. The validate operation reports whether diagram code parses and, if not, why, along with the detected diagramType. The render operation turns the same code into SVG, PNG, or PDF, with PNG options for scale and background and a PDF fit option, using the latest Mermaid release. A balance operation shows the key owner's remaining API credits and what each endpoint costs.
This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.
Base layer of spec validity and structural soundness.
Aggregated quality score from linter diagnostics, weighted by severity.
Percentage of `$ref` references that resolve successfully.
Checks whether the API description parses successfully and conforms to its declared specification (e.g., OpenAPI).
Structural correctness score based on schema issues using logarithmic dampening.
Clarity, completeness, and ingestion readiness for developers and tooling.
How richly the API is illustrated with examples.
Percentage of examples that conform to their schemas.
Percentage of operations with complete response definitions (success, client error, server error).
Health of API ingestion, bundling, and resolution within Jentic pipelines.
Semantic breadth, depth, and agent comprehension for AI systems.
Coverage of descriptions across API elements.
Coverage of RFC 9457 Problem Details for error responses.
Coverage, uniqueness, and casing consistency of operationIds for AI inference.
Coverage of summaries across operations/tags/info.
Functional utility, complexity comfort, and AI orchestration readiness.
Agent comfort level based on API operational and structural complexity.
Trust, risk posture, and security compliance.
Average quality of security schemes based on authentication method strength (weakest link for OAuth2).
Findability, semantic richness, and reasoning readiness.
Clarity and depth of descriptions across API elements.
Score it yourself
Every API in the directory is allowlisted, so you can re-score it with no key required.
npx @jentic/api-scorecard-cli score <openapi-url>