Kit for AI documentation
Turn any document or URL into clean Markdown or structured JSON for LLMs, RAG, and agents — and search the live web — from one API.
Introduction
Kit for AI is a document-and-web conversion API built for AI pipelines. Send a file or a URL and get back clean Markdown — or, with your own JSON schema, typed structured data. It handles the messy parts (layout, tables, OCR, page chrome) so your model gets exactly the context it needs.
- • Documents — PDF, Word, Excel, PowerPoint, CSV, HTML, and images → Markdown.
- • URLs & the web — fetch any page and keep just the main content.
- • OCR — scanned pages and images → text, automatically.
- • JSON extraction — structured data shaped by your schema.
- • Bulk — up to 25 files/URLs per call.
- • Live web search — fresh, ranked results scraped to Markdown.
- • Knowledge bases & memory banks — collections of docs your AI can read over MCP/API.
- • MCP — the same tools for any MCP-capable LLM client.
Quickstart
- 1. Create an account — free, no card required.
- 2. Generate an API key in Settings → API keys.
- 3. Make your first call:
bash
curl -X POST https://kitforai.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "url=https://example.com/article" \ -F "outputFormat=markdown"
Authentication
Every request authenticates with an API key. Create one in Settings → API keys and send it in the x-api-key header. Keys are scoped to your account and stay valid until you revoke them — keep them server-side.
header
x-api-key: kfa_your_api_key
Convert documents & URLs
POST /api/v1/convert — multipart form. Send exactly one of file (an upload) or url (a web page or document link). Returns Markdown by default, or JSON when outputFormat=json.
Upload a file
bash
curl -X POST https://kitforai.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "[email protected]" \ -F "outputFormat=markdown"
Convert a URL
bash
curl -X POST https://kitforai.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "url=https://example.com/blog/building-with-ai"
JavaScript
javascript
const form = new FormData();
form.set("file", file); // a File or Blob — or use form.set("url", "https://…")
form.set("outputFormat", "markdown");
const res = await fetch("https://kitforai.com/api/v1/convert", {
method: "POST",
headers: { "x-api-key": "kfa_your_api_key" },
body: form,
});
const { data } = await res.json();
console.log(data.markdown ?? data.json);Response
json
{
"data": {
"id": "cmq...",
"status": "completed",
"cached": false,
"markdown": "# Quarterly Report\n\nRevenue grew **20%** ...",
"json": null
}
}OCR — scanned docs & images
Images and scanned pages run through OCR automatically. Send a PNG, JPG, or an image-only PDF and you get the recognized text back as Markdown — no special flag, it's part of the normal convert pipeline.
bash
curl -X POST https://kitforai.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "[email protected]"
For higher-fidelity extraction on complex layouts (dense tables, figures), Pro plans can add deepExtract=true for vision-based cleanup and figure descriptions.
JSON extraction
Set outputFormat=json and pass a jsonSchema (stringified) describing the fields you want. You get typed, structured data instead of Markdown — ideal for invoices, forms, and records. Included on Pro.
bash
curl -X POST https://kitforai.com/api/v1/convert \ -H "x-api-key: kfa_your_api_key" \ -F "[email protected]" \ -F "outputFormat=json" \ -F 'jsonSchema={"invoiceNumber":"string","total":"number","dueDate":"string"}'
Bulk conversion
POST /api/v1/batch — send up to 25 file and/or url fields in one request. Returns a per-item results[] array at HTTP 200 even on partial failure; each item is completed, failed, or rate_limited.
bash
curl -X POST https://kitforai.com/api/v1/batch \ -H "x-api-key: kfa_your_api_key" \ -F "url=https://example.com/a" \ -F "url=https://example.com/b" \ -F "[email protected]"
Web search
POST /api/v1/search — search the live web and get back fresh, ranked results scraped to clean Markdown. Built for agents that need current information.
bash
curl -X POST https://kitforai.com/api/v1/search \
-H "x-api-key: kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"query":"best vector databases for RAG 2026","limit":5}'Knowledge bases & memory banks
Group your converted docs into named collections, then give any AI model access to all of them at once. A knowledge base is a category of reference docs; a memory bank is the docs your agent should remember. Manage them in your dashboard, or entirely over the API.
Create a collection
bash
curl -X POST https://kitforai.com/api/v1/collections \
-H "x-api-key: kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name":"Product docs","kind":"knowledge_base"}'Add a converted document
bash
curl -X POST https://kitforai.com/api/v1/collections/{id}/documents \
-H "x-api-key: kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"conversionId":"cmq..."}'Read everything (feed your model)
GET /api/v1/collections/{id} returns every document in the collection joined into one Markdown content field — the whole category in a single call.
bash
curl https://kitforai.com/api/v1/collections/{id} \
-H "x-api-key: kfa_your_api_key"Over MCP, use read_collection with the collection's id or name to give the model all its docs at once, and list_collections to enumerate them.
MCP server
Attach Kit for AI to any MCP-capable LLM client. It speaks Streamable HTTP at /api/mcp and authenticates with your API key.
Client config
json
{
"mcpServers": {
"kit-for-ai": {
"url": "https://kitforai.com/api/mcp",
"headers": { "Authorization": "Bearer kfa_your_api_key" }
}
}
}Tools
convert_url— fetch a URL and convert it to Markdown or JSON.web_search— search the live web and return Markdown results.list_recent_conversions— list your latest conversions.list_collections— list your knowledge bases and memory banks.read_collection— read every doc in a knowledge base / memory bank at once.
Test it
bash
curl -X POST https://kitforai.com/api/mcp \
-H "Authorization: Bearer kfa_your_api_key" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Rate limits & quotas
Each API key is rate limited per minute by plan. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset; a 429 includes Retry-After. Conversions also count against your monthly plan quota.
| Plan | Requests / min | Conversions / month |
|---|---|---|
| Free | 10 | 50 |
| Pro | 60 | 3,000 |
| Enterprise | 300 | 50,000 |
Data & privacy
- Scoped to you. Conversions, files, and API keys belong to your account; nothing is shared across accounts.
- Caching. Results are cached by content hash, so re-sending the same input returns instantly (
cached: true) without re-processing or re-billing. - Re-convert. The original bytes you upload are stored (deduplicated per account) so you can re-convert a file to another format without re-uploading.
- Safe fetching. URL conversion is SSRF-guarded — internal, private, and cloud-metadata addresses are blocked, and every redirect hop is re-validated.
- In transit. All traffic is HTTPS, fronted by Cloudflare.
Errors
Errors return a JSON body { "error": { "code", "endUserMessage" } } with an HTTP status.
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 422 | VALIDATION_FAILED | Unsupported file or bad input |
| 429 | RATE_LIMITED | Rate limit or monthly quota reached |
| 503 | AI_UNAVAILABLE | An upstream service is temporarily unavailable |