v1StableMCP Ready

BlazeDocs API

Convert PDFs to clean Markdown for AI agents and RAG pipelines. One API call. Sub-5-second latency. MCP server included.

$ curl -X POST https://blazedocs.io/api/v1/convert \
-H "Authorization: Bearer bd_live_..." \
-F "file=@paper.pdf"

⚡ Quick Start — 30 Seconds to First Conversion

1. Get your API key from the dashboard
2. Pick your language below
3. Convert your first PDF

cURL

bash
curl -X POST https://blazedocs.io/api/v1/convert \
  -H "Authorization: Bearer bd_live_YOUR_KEY" \
  -F "file=@document.pdf"

# Response:
# {
#   "success": true,
#   "data": {
#     "markdown": "# Your Document\n\nConverted content...",
#     "page_count": 5,
#     "token_count": 4820,
#     "processing_time_ms": 3200
#   }
# }

Python

python
import requests

resp = requests.post(
    "https://blazedocs.io/api/v1/convert",
    headers={"Authorization": "Bearer bd_live_YOUR_KEY"},
    files={"file": open("document.pdf", "rb")},
)
md = resp.json()["data"]["markdown"]
print(md)

Node.js

javascript
const form = new FormData();
form.append("file", await fs.openAsBlob("document.pdf"));

const res = await fetch("https://blazedocs.io/api/v1/convert", {
  method: "POST",
  headers: { Authorization: "Bearer bd_live_YOUR_KEY" },
  body: form,
});
const { data } = await res.json();
console.log(data.markdown);

🔑 Authentication

All requests require an API key. Generate one from your Dashboard → API Keys.

Pass your key via either header:

http
Authorization: Bearer bd_live_xxxxxxxxxx
# or
x-api-key: bd_live_xxxxxxxxxx

🔒 Security

Keys start with bd_live_. Never commit keys to source control. Use environment variables in production.

📄 Convert PDF → Markdown

POSThttps://blazedocs.io/api/v1/convert

Option A: Multipart Upload

Send the PDF as a file field.

bash
curl -X POST https://blazedocs.io/api/v1/convert \
  -H "Authorization: Bearer bd_live_YOUR_KEY" \
  -F "file=@document.pdf"

Option B: Base64 JSON

Send the PDF as a base64-encoded string in JSON body.

bash
curl -X POST https://blazedocs.io/api/v1/convert \
  -H "Authorization: Bearer bd_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_base64": "<base64-encoded-pdf>",
    "file_name": "document.pdf"
  }'

Request Parameters

fileFilerequired
The PDF file to convert (multipart upload)
file_base64stringrequired
Base64-encoded PDF content (JSON body alternative)
file_namestring
Original filename. Defaults to "document.pdf"

Response

json
{
  "success": true,
  "data": {
    "markdown": "# Document Title\n\nExtracted content with formatting...",
    "page_count": 5,
    "token_count": 4820,
    "processing_time_ms": 3200,
    "file_name": "document.pdf"
  },
  "usage": {
    "pages_used": 45,
    "pages_limit": 500,
    "pages_remaining": 455
  }
}

Response Fields

data.markdownstring
The converted Markdown content
data.page_countnumber
Number of pages processed
data.token_countnumber
Approximate token count of the output
data.processing_time_msnumber
Processing time in milliseconds
usage.pages_usednumber
Total pages used this billing period
usage.pages_remainingnumber
Pages remaining in your plan

📊 Check Usage

GEThttps://blazedocs.io/api/v1/convert

Returns your current tier, usage, and limits without performing a conversion.

bash
curl https://blazedocs.io/api/v1/convert \
  -H "Authorization: Bearer bd_live_YOUR_KEY"
json
{
  "tier": "starter",
  "usage": {
    "monthlyConversions": 12,
    "monthlyPages": 45,
    "monthlyTokens": 52000
  },
  "limits": {
    "conversions": 50,
    "pages": 500,
    "tokens": 500000,
    "fileSize": 20971520
  }
}

🔐 Key Management

POSThttps://blazedocs.io/api/v1/keys

Programmatically create and manage API keys. Requires authentication via Clerk session.

bash
curl -X POST https://blazedocs.io/api/v1/keys \
  -H "Content-Type: application/json" \
  -H "Cookie: __session=YOUR_CLERK_SESSION" \
  -d '{"name": "production-key"}'
json
{
  "success": true,
  "key": {
    "id": "key_abc123",
    "name": "production-key",
    "key": "bd_live_xxxxxxxxxxxxxxxx",
    "created_at": "2025-01-15T10:30:00Z"
  }
}
🔗One-Click Connect

BlazeDocs Connect

The fastest way to get agents started with BlazeDocs. No dashboard signup, no manual API key generation — just one approval click.

How It Works

  1. Agent initiates — The SDK or CLI calls POST /api/connect/session
  2. Browser opens — User sees the approval page and clicks Approve
  3. Key is minted — A standard BlazeDocs API key is created and returned automatically
  4. Agent is ready — The SDK stores the key and can start converting PDFs immediately

Node.js / JavaScript

javascriptconnect.mjs
const blazedocs = require("blazedocs");

// 1. Create session
const { sessionId, approvalUrl } = await blazedocs.connect.createSession({
  provider: "openclaw",
});
console.log("Open this link:", approvalUrl);

// 2. After user approves in browser...
const { apiKey } = await blazedocs.connect.exchange(sessionId);

// 3. Use the key
const client = new blazedocs.BlazeDocs({ apiKey });
const result = await client.convert({ file: "document.pdf" });
console.log(result.markdown);

Python

pythonconnect_demo.py
from blazedocs import Client

client = Client()  # temporarily unauthenticated

# 1. Create session
session = client.create_connect_session(provider="openclaw")
print("Open this link:", session["approval_url"])

# 2. After user approves...
result = client.exchange_connect_session(session["session_id"])
api_key = result["api_key"]

# 3. Create a new authenticated client
client = Client(api_key=api_key)
conversion = client.convert("document.pdf")
print(conversion.markdown)

CLI

bash
# One command: creates session, opens browser, stores key
npx blazedocs login --connect --provider openclaw

â„šī¸ Why Connect?

Classic API keys require dashboard navigation: sign up → go to dashboard → create key → copy key → paste into your tool. Connect reduces this to one approval click. Under the hood, it mints a standard API key — same quota, same billing, less friction.

🤖Differentiator

Agent Integrations

BlazeDocs is built for AI-first workflows. Give any AI agent the ability to read PDFs — MCP, LangChain, Vercel AI SDK, OpenAI, CrewAI.

MCP Server — Claude, Cursor, Windsurf & more

Add BlazeDocs as an MCP tool so Claude, Cursor, or any MCP-compatible client can convert PDFs on the fly.

bash
npm install -g @blazedocs/mcp-server

Add to your MCP config (claude_desktop_config.json or .cursor/mcp.json):

jsonclaude_desktop_config.json
{
  "mcpServers": {
    "blazedocs": {
      "command": "npx",
      "args": ["-y", "@blazedocs/mcp-server"],
      "env": {
        "BLAZEDOCS_API_KEY": "bd_live_YOUR_KEY"
      }
    }
  }
}

Now Claude can convert PDFs inline: "Convert this PDF and summarize it".

LangChain — Document Loader

Use BlazeDocs as a LangChain document loader for RAG pipelines.

python
from langchain.schema import Document
import requests

class BlazeDocsLoader:
    """LangChain document loader for BlazeDocs PDF conversion."""

    def __init__(self, api_key: str):
        self.api_key = api_key
        self.url = "https://blazedocs.io/api/v1/convert"

    def load(self, file_path: str) -> list[Document]:
        with open(file_path, "rb") as f:
            resp = requests.post(
                self.url,
                headers={"Authorization": f"Bearer {self.api_key}"},
                files={"file": (file_path, f, "application/pdf")},
            )
        data = resp.json()["data"]
        return [Document(
            page_content=data["markdown"],
            metadata={
                "source": file_path,
                "page_count": data["page_count"],
                "token_count": data["token_count"],
            },
        )]

# Usage with RAG pipeline
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain.text_splitter import RecursiveCharacterTextSplitter

loader = BlazeDocsLoader(api_key="bd_live_YOUR_KEY")
docs = loader.load("research_paper.pdf")

splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
chunks = splitter.split_documents(docs)

vectorstore = FAISS.from_documents(chunks, OpenAIEmbeddings())
retriever = vectorstore.as_retriever()

Vercel AI SDK — Tool Calling

Give your AI chatbot the ability to convert PDFs using Vercel AI SDK tool calling.

typescript
import { openai } from "@ai-sdk/openai";
import { generateText, tool } from "ai";
import { z } from "zod";

const result = await generateText({
  model: openai("gpt-4o"),
  tools: {
    convertPdf: tool({
      description: "Convert a PDF file to Markdown using BlazeDocs",
      parameters: z.object({
        fileBase64: z.string().describe("Base64-encoded PDF"),
        fileName: z.string().describe("Original filename"),
      }),
      execute: async ({ fileBase64, fileName }) => {
        const res = await fetch("https://blazedocs.io/api/v1/convert", {
          method: "POST",
          headers: {
            Authorization: `Bearer ${process.env.BLAZEDOCS_API_KEY}`,
            "Content-Type": "application/json",
          },
          body: JSON.stringify({
            file_base64: fileBase64,
            file_name: fileName,
          }),
        });
        return res.json();
      },
    }),
  },
  prompt: "Convert the uploaded PDF and summarize its key findings.",
});

OpenAI Function Calling

Register BlazeDocs as an OpenAI function so GPT can convert PDFs during conversations.

python
import openai, requests, json, base64

tools = [{
    "type": "function",
    "function": {
        "name": "convert_pdf_to_markdown",
        "description": "Convert a PDF document to Markdown text using BlazeDocs OCR",
        "parameters": {
            "type": "object",
            "properties": {
                "file_base64": {
                    "type": "string",
                    "description": "Base64-encoded PDF file content"
                },
                "file_name": {
                    "type": "string",
                    "description": "Name of the PDF file"
                }
            },
            "required": ["file_base64", "file_name"]
        }
    }
}]

def handle_tool_call(call):
    if call.function.name == "convert_pdf_to_markdown":
        args = json.loads(call.function.arguments)
        resp = requests.post(
            "https://blazedocs.io/api/v1/convert",
            headers={
                "Authorization": f"Bearer {BLAZEDOCS_KEY}",
                "Content-Type": "application/json",
            },
            json=args,
        )
        return resp.json()["data"]["markdown"]

# GPT will call convert_pdf_to_markdown when it needs to read a PDF
response = openai.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Analyze this PDF..."}],
    tools=tools,
)

CrewAI — PDF Conversion Tool

Give your CrewAI agents the ability to read and analyze PDFs.

python
from crewai import Agent, Task, Crew
from crewai.tools import BaseTool
import requests

class BlazeDocsTool(BaseTool):
    name: str = "blazedocs_convert"
    description: str = "Convert a PDF file to Markdown text for analysis"

    def _run(self, file_path: str) -> str:
        with open(file_path, "rb") as f:
            resp = requests.post(
                "https://blazedocs.io/api/v1/convert",
                headers={"Authorization": f"Bearer {BLAZEDOCS_KEY}"},
                files={"file": (file_path, f, "application/pdf")},
            )
        return resp.json()["data"]["markdown"]

researcher = Agent(
    role="Research Analyst",
    goal="Extract insights from PDF documents",
    tools=[BlazeDocsTool()],
    llm="gpt-4o",
)

task = Task(
    description="Convert and analyze the research paper at paper.pdf",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff()

đŸ“Ļ Official SDKs

🐍

Python

pip install blazedocs

python
pip install blazedocs

from blazedocs import BlazeDocsClient

client = BlazeDocsClient("bd_live_YOUR_KEY")
result = client.convert("document.pdf")
print(result.markdown)
đŸ“Ļ

Node.js / TypeScript

npm install blazedocs

typescript
npm install blazedocs

import { BlazeDocsClient } from "blazedocs";

const client = new BlazeDocsClient("bd_live_YOUR_KEY");
const result = await client.convert("document.pdf");
console.log(result.markdown);

💰 Rate Limits & Pricing

API access uses the same quota as the web app. Every response includes rate-limit headers:

HeaderDescription
X-RateLimit-LimitTotal conversions allowed per month
X-RateLimit-RemainingConversions remaining this month
X-RateLimit-ResetUnix timestamp when limits reset

Plans

PlanPriceConversions / moBest For
Free$03Testing & evaluation
Starter$9.99/mo50Side projects & personal use
ProPopular$29.99/mo250RAG pipelines & AI agents
Enterprise$99.99/mo1,000Production workloads

Need more? Contact support@blazedocs.com for custom enterprise pricing.

âš ī¸ Error Reference

All errors follow a consistent format:

json
{
  "success": false,
  "error": "Human-readable error message",
  "code": "ERROR_CODE"
}
StatusCodeDescription
400BAD_REQUESTMissing file, invalid PDF, or malformed request body
401UNAUTHORIZEDInvalid or missing API key
413FILE_TOO_LARGEPDF exceeds your plan's file size limit
415UNSUPPORTED_TYPEContent-Type must be multipart/form-data or application/json
429RATE_LIMITEDMonthly conversion limit exceeded — upgrade your plan
500SERVER_ERRORInternal error — retry or contact support

Ready to give your AI agents the ability to read PDFs?

Get your API key in 30 seconds. Free tier includes 3 conversions/month — no credit card required.