API Documentation

Transform Markdown content into beautifully formatted HTML, optimized for Gmail, Google Docs, and web platforms.

API Overview

Base URL

https://mythictext-api.vercel.app

Authentication

API Key via X-API-Key header

Rate Limits

60 requests/minute per IP
1000 requests per API key

🚀 Beta Program

Limited to 500 users during beta. Join our Discord community for early access and support.

Quick Start

1. Get Your API Key

Sign up for free beta access and generate your API key:

Get Free API Key

2. Make Your First Request

Convert Markdown to HTML with a simple POST request:

curl -X POST https://mythictext-api.vercel.app/convert \
  -H "X-API-Key: sk_your_api_key_here" \
  -H "Content-Type: text/plain" \
  -H "X-Output-Target: gmail" \
  -d "# Hello World
This is **bold** text with a [link](https://example.com)."

3. Get Formatted HTML

Receive optimized HTML for your target platform:

{
  "html": "<h1>Hello World</h1><p>This is <strong>bold</strong> text with a <a href=\"https://example.com\">link</a>.</p>",
  "model": "gpt-4o-mini",
  "processing_time_ms": 1250
}

API Reference

POST /convert

Primary endpoint for Markdown conversion

Headers

  • X-API-Key: Your API key (required)
  • Content-Type: text/plain or application/json
  • X-Output-Target: gmail, googledocs, or markdown (optional)

Request Body

// Text/Plain
# Your Markdown Content
This is **bold** text.

// JSON
{
  "markdown": "# Your Markdown Content\nThis is **bold** text.",
  "target": "gmail",
  "stream": false
}

Output Targets

gmail
Optimized for Gmail with inline styles
googledocs
Google Docs compatible formatting
markdown
Enhanced Markdown processing

POST /claim-key

Generate API key (alternative to dashboard)
curl -X POST https://mythictext-api.vercel.app/claim-key \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com"}'

Rate Limited: 5 requests per minute per IP

GET /

API health check
{
  "message": "MythicText API is running. Visit /docs for API documentation."
}

Code Examples

JavaScript

const response = await fetch('https://mythictext-api.vercel.app/convert', {
  method: 'POST',
  headers: {
    'X-API-Key': 'sk_your_api_key_here',
    'Content-Type': 'application/json',
    'X-Output-Target': 'gmail'
  },
  body: JSON.stringify({
    markdown: '# Hello World\nThis is **bold** text.'
  })
});

const result = await response.json();
console.log(result.html);

Python

import requests

response = requests.post(
    'https://mythictext-api.vercel.app/convert',
    headers={
        'X-API-Key': 'sk_your_api_key_here',
        'Content-Type': 'application/json',
        'X-Output-Target': 'gmail'
    },
    json={
        'markdown': '# Hello World\nThis is **bold** text.'
    }
)

result = response.json()
print(result['html'])

Error Handling

HTTP Status Codes

401 Unauthorized
Invalid or inactive API key
429 Too Many Requests
Rate limit exceeded or usage limit reached

Error Response Format

{
  "detail": "Invalid API key provided",
  "status_code": 401
}

Authentication & Security

API Key Format

API keys use the format: sk_ prefix followed by 48 secure random characters.

Rate Limits

  • Per IP: 60 requests per minute
  • Per API Key: 1000 total requests (beta limit)
  • Key Generation: 5 requests per minute per IP

Response Headers

X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1642680000
Content-Type: application/json

Need Help?

Ready to get started?

Join our beta program and start transforming your Markdown content today.

Get Your Free API Key