{
  "openapi": "3.0.1",
  "info": {
    "title": "Mermaid, Graphviz & Chart to PNG, SVG or PDF",
    "description": "Render Mermaid, Graphviz DOT, Vega-Lite, Vega, Chart.js or SVG code to a PNG, SVG or PDF link for AI agents and MCP. Bad code returns the exact error with line number so the agent can fix and retry. $0.003 per diagram, errors free.",
    "version": "0.1",
    "x-build-id": "dkoUhM1ijIp2NeOnp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fluidfaith~mermaid-chart-renderer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fluidfaith-mermaid-chart-renderer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/fluidfaith~mermaid-chart-renderer/runs": {
      "post": {
        "operationId": "runs-sync-fluidfaith-mermaid-chart-renderer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/fluidfaith~mermaid-chart-renderer/run-sync": {
      "post": {
        "operationId": "run-sync-fluidfaith-mermaid-chart-renderer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "code": {
            "title": "Diagram code",
            "type": "string",
            "description": "The code of one diagram: Mermaid (flowchart, sequence, class, ER, gantt, pie, mindmap, timeline and more), Graphviz DOT, a Vega-Lite or Vega JSON spec, a Chart.js JSON config, or an <svg> element. Up to 200,000 characters."
          },
          "type": {
            "title": "Type",
            "enum": [
              "mermaid",
              "graphviz",
              "vegalite",
              "vega",
              "chartjs",
              "svg"
            ],
            "type": "string",
            "description": "What the code is. Leave empty to detect it: <svg> is SVG, digraph/graph is Graphviz, JSON with a vega-lite $schema is Vega-Lite, JSON with type+data.datasets is Chart.js, anything else is Mermaid."
          },
          "diagrams": {
            "title": "Many diagrams (optional)",
            "type": "array",
            "description": "List of {\"code\": \"...\", \"type\": optional, \"name\": optional, \"format\": optional, \"theme\": optional, \"sourceUrl\": optional}. Up to 100 per run; each one is billed only if it renders. \"sourceUrl\" fetches the code from a public link (raw file, GitHub blob or gist link) instead of \"code\"."
          },
          "sourceUrl": {
            "title": "Code from a link (optional)",
            "type": "string",
            "description": "Fetch the diagram code from a public link (a raw .mmd, .dot or .json file, a GitHub file page or a gist) instead of pasting it. Up to 1 MB. Private and internal addresses are refused."
          },
          "name": {
            "title": "Name (optional)",
            "type": "string",
            "description": "Label for the single diagram; also used in the file name."
          },
          "format": {
            "title": "Output format",
            "enum": [
              "png",
              "svg",
              "pdf"
            ],
            "type": "string",
            "description": "PNG for chat, Slack, email and docs; SVG for a scalable vector (the markup is also returned inline when under 100 KB); PDF for print. Chart.js gives PNG or PDF.",
            "default": "png"
          },
          "theme": {
            "title": "Theme",
            "enum": [
              "default",
              "dark",
              "neutral",
              "forest"
            ],
            "type": "string",
            "description": "Mermaid theme. \"dark\" also gives Vega-Lite and Chart.js light text on a dark background.",
            "default": "default"
          },
          "background": {
            "title": "Background color",
            "type": "string",
            "description": "CSS color, for example white (the default), transparent, #0f172a. Dark theme defaults to #1e1e1e."
          },
          "scale": {
            "title": "PNG scale",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Pixel density of PNG output: 2 gives sharp images on phones and retina screens.",
            "default": 2
          },
          "width": {
            "title": "Chart.js width (px)",
            "minimum": 100,
            "maximum": 4000,
            "type": "integer",
            "description": "Canvas width for Chart.js charts (other types size themselves).",
            "default": 800
          },
          "height": {
            "title": "Chart.js height (px)",
            "minimum": 100,
            "maximum": 4000,
            "type": "integer",
            "description": "Canvas height for Chart.js charts.",
            "default": 500
          },
          "graphvizEngine": {
            "title": "Graphviz layout engine",
            "enum": [
              "dot",
              "neato",
              "fdp",
              "sfdp",
              "circo",
              "twopi",
              "osage",
              "patchwork"
            ],
            "type": "string",
            "description": "dot for hierarchies and flows, neato or fdp for networks, circo for circles.",
            "default": "dot"
          },
          "includeSvgText": {
            "title": "Return SVG markup inline",
            "type": "boolean",
            "description": "With SVG output, also put the SVG markup in the result row (when under 100 KB), so an agent can embed it without a second download.",
            "default": true
          },
          "timeoutSecsPerDiagram": {
            "title": "Time limit per diagram (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "A diagram that takes longer becomes an ERROR row and is not charged.",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Parallel renders",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "How many diagrams render at the same time.",
            "default": 2
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}