New to the API? See use cases & pricing →
API reference
Convert Markdown to beautiful images programmatically. Get started with 50 watermarked API requests per month.
Create an API Token
Sign in and create a token from your API Tokens page
Make your first API call
curl -X POST https://markdowntoimage.com/api/v1/images/generate \
-H "Authorization: Bearer mti_your_token_here" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World\n\nThis is a test."}'All API requests (except token management and schema) require a Bearer token in the Authorization header. The /api/v1/schema endpoint is public. Get your token from the Profile > API Tokens page.
Authorization: Bearer mti_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFree requests per month
API free quota includes watermark
Credit per extra request
1 credit removes watermark
API free quota always includes a watermark unless a credit is used. Browser export welcome credits are separate: signed-in accounts receive 5 total watermark-free browser exports, then browser exports include watermark unless credits are available and removal is selected. API calls use 50 free watermarked requests per month; after that, each watermark-free API render uses 1 credit. Requests without free quota or credits are rejected (HTTP 429).
Convert Markdown content to an image. Returns either an image URL or binary data depending on the mode parameter.
markdownstringrequiredThe Markdown content to convert to an image
widthnumberdefault: 800Image width in pixels (200-2560)
formatstringdefault: pngOutput format: png, jpeg, webp, or pdf. When set to pdf, returns an A4-formatted PDF document with header/footer
qualitynumberdefault: 2.0Device scale factor for rendering (1.0-3.0)
themestringVisual theme for the rendered image
lightdarknordgithubmonokaisolarizedcodeStylestringSyntax highlighting style for code blocks
defaultgithubvsxcodeatom-one-lightgooglecodefontFamilystringFont family for the rendered content
sansintermodernarticledocsrobotomodestringdefault: urlResponse mode: 'url' returns a temporary image URL (retained for 24 hours), 'binary' returns raw image data. For permanent storage, please download the image promptly
curl -X POST https://markdowntoimage.com/api/v1/images/generate \
-H "Authorization: Bearer mti_your_token" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello\n\n- Item 1\n- Item 2",
"width": 800,
"format": "png",
"theme": "github-dark"
}'{
"success": true,
"data": {
"imageUrl": "https://markdowntoimage.com/api-temp/uuid.png",
"imageId": "550e8400-e29b-41d4-a716-446655440000",
"format": "png",
"width": 800
},
"meta": {
"quota": {
"freeRemaining": 48,
"creditBalance": 200,
"usedFreeQuota": true
}
}
}Get current monthly API usage statistics including free quota remaining and credit balance.
curl https://markdowntoimage.com/api/v1/account/usage \
-H "Authorization: Bearer mti_your_token"{
"success": true,
"data": {
"monthlyQuota": 50,
"monthlyUsed": 12,
"monthlyRemaining": 38,
"yearMonth": "2026-02",
"creditBalance": 200,
"resetDate": "2026-03-01"
}
}Get the API schema in a format compatible with MCP (Model Context Protocol) tool definitions. Useful for AI agent integration.
{
"success": true,
"data": {
"name": "markdown-to-image",
"version": "v1",
"tools": [...]
}
}| Error Code | HTTP Status | Description |
|---|---|---|
| UNAUTHORIZED | 401 | Invalid or missing API token |
| INVALID_REQUEST | 400 | Invalid request parameters |
| MARKDOWN_REQUIRED | 400 | Markdown content is required |
| QUOTA_EXCEEDED | 429 | Monthly free quota exceeded and insufficient credits |
| GENERATION_FAILED | 500 | Image generation failed |
| INTERNAL_ERROR | 500 | Internal server error |
Use this configuration in n8n's HTTP Request node:
Method: POST
URL: https://markdowntoimage.com/api/v1/images/generate
Headers:
Authorization: Bearer mti_your_token
Content-Type: application/json
Body (JSON):
{
"markdown": "{{ $json.content }}",
"format": "png",
"theme": "github-dark"
}Add as a custom tool in Dify:
Tool Schema:
{
"name": "markdown_to_image",
"description": "Convert markdown to PNG/PDF image",
"parameters": [
{
"name": "markdown",
"description": "Markdown content to convert",
"type": "string"
},
{
"name": "format",
"description": "Output format: png, jpeg, pdf",
"type": "string"
}
],
"endpoint": "https://markdowntoimage.com/api/v1/images/generate"
}Our team can help you with custom templates, higher volume integrations, or enterprise implementations.
Request Integration SupportResponse time: 1-2 business days