Convert PDFs to clean Markdown for AI agents and RAG pipelines. One API call. Sub-5-second latency. MCP server included.
1. Get your API key from the dashboard
2. Pick your language below
3. Convert your first PDF
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
# }
# }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)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);All requests require an API key. Generate one from your Dashboard â API Keys.
Pass your key via either header:
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.
Send the PDF as a file field.
curl -X POST https://blazedocs.io/api/v1/convert \
-H "Authorization: Bearer bd_live_YOUR_KEY" \
-F "file=@document.pdf"Send the PDF as a base64-encoded string in JSON body.
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"
}'fileFilerequiredfile_base64stringrequiredfile_namestring{
"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
}
}data.markdownstringdata.page_countnumberdata.token_countnumberdata.processing_time_msnumberusage.pages_usednumberusage.pages_remainingnumberReturns your current tier, usage, and limits without performing a conversion.
curl https://blazedocs.io/api/v1/convert \
-H "Authorization: Bearer bd_live_YOUR_KEY"{
"tier": "starter",
"usage": {
"monthlyConversions": 12,
"monthlyPages": 45,
"monthlyTokens": 52000
},
"limits": {
"conversions": 50,
"pages": 500,
"tokens": 500000,
"fileSize": 20971520
}
}Programmatically create and manage API keys. Requires authentication via Clerk session.
curl -X POST https://blazedocs.io/api/v1/keys \
-H "Content-Type: application/json" \
-H "Cookie: __session=YOUR_CLERK_SESSION" \
-d '{"name": "production-key"}'{
"success": true,
"key": {
"id": "key_abc123",
"name": "production-key",
"key": "bd_live_xxxxxxxxxxxxxxxx",
"created_at": "2025-01-15T10:30:00Z"
}
}The fastest way to get agents started with BlazeDocs. No dashboard signup, no manual API key generation â just one approval click.
POST /api/connect/sessionconst 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);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)# 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.
BlazeDocs is built for AI-first workflows. Give any AI agent the ability to read PDFs â MCP, LangChain, Vercel AI SDK, OpenAI, CrewAI.
Add BlazeDocs as an MCP tool so Claude, Cursor, or any MCP-compatible client can convert PDFs on the fly.
npm install -g @blazedocs/mcp-serverAdd to your MCP config (claude_desktop_config.json or .cursor/mcp.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".
Use BlazeDocs as a LangChain document loader for RAG pipelines.
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()Give your AI chatbot the ability to convert PDFs using Vercel AI SDK tool calling.
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.",
});Register BlazeDocs as an OpenAI function so GPT can convert PDFs during conversations.
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,
)Give your CrewAI agents the ability to read and analyze PDFs.
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()Python
pip install blazedocs
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
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);API access uses the same quota as the web app. Every response includes rate-limit headers:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Total conversions allowed per month |
| X-RateLimit-Remaining | Conversions remaining this month |
| X-RateLimit-Reset | Unix timestamp when limits reset |
| Plan | Price | Conversions / mo | Best For |
|---|---|---|---|
| Free | $0 | 3 | Testing & evaluation |
| Starter | $9.99/mo | 50 | Side projects & personal use |
| ProPopular | $29.99/mo | 250 | RAG pipelines & AI agents |
| Enterprise | $99.99/mo | 1,000 | Production workloads |
Need more? Contact support@blazedocs.com for custom enterprise pricing.
All errors follow a consistent format:
{
"success": false,
"error": "Human-readable error message",
"code": "ERROR_CODE"
}| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing file, invalid PDF, or malformed request body |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 413 | FILE_TOO_LARGE | PDF exceeds your plan's file size limit |
| 415 | UNSUPPORTED_TYPE | Content-Type must be multipart/form-data or application/json |
| 429 | RATE_LIMITED | Monthly conversion limit exceeded â upgrade your plan |
| 500 | SERVER_ERROR | Internal error â retry or contact support |
Get your API key in 30 seconds. Free tier includes 3 conversions/month â no credit card required.