Install
openclaw skills install @mdapiio/mdapi-conversionUse mdapi.io to convert documents, images, webpages, and text into AI-ready Markdown or structured data, with prompt-driven transformation, streaming, x402 payments, token activation, and REST/MCP/ACP/A2A/OpenAI-compatible access.
openclaw skills install @mdapiio/mdapi-conversionTransforms documents, images, and webpages into AI-ready Markdown and structured data, optimized for LLM efficiency and token usage.
mdapi.io is minimal by design: responses are Markdown or JSON only. No HTML, CSS, or JavaScript.
GET / always returns Markdown.POST / always returns JSON.result parameter controls output completeness: markdown, prompt, or both.Choose your entry point based on your role:
| Role | Protocol | Endpoint | When to use |
|---|---|---|---|
| IDE / coding agent (JetBrains, Cursor, VS Code, etc.) | ACP (Agent Client Protocol) | POST /acp | You are an IDE plugin or coding agent. Use tools/call with convert tool. |
| AI agent (Claude Code, Codex, OpenClaw, Hermes, etc.) | A2A (Agent-to-Agent) | POST /a2a | You are an autonomous agent. Use SendMessage with text/file parts. Supports streaming and task tracking. |
| AI agent (any framework) | MCP (Model Context Protocol) | GET /mcp + POST /mcp | You need tool discovery. Use tools/call with convert tool. |
| OpenAI-compatible client | OpenAI API | POST /v1/chat/completions | You already use OpenAI SDK. Pass URL/file in messages. Supports streaming. |
| Direct HTTP / curl / script | REST API | GET / or POST / | Simplest path. GET returns Markdown directly. POST returns JSON with metadata. |
All protocols and capabilities are described in one file: GET /.well-known/ai-discovery.json
Use this skill when the task includes any of the following:
prompt.url, file, or text, and choose the simplest valid endpoint.GET / for direct Markdown output.POST / for JSON output or file upload.prompt is provided, set result explicitly.result=both when both raw conversion and prompt result are useful.Documents:
Images:
Text:
Webpages:
text or prompt values, use POST.markdown, prompt_result, and metadata together.Supported query parameters:
urltextpromptresultstreamtokenmemoNote: GET URLs are limited to ~2048 characters (browser-dependent). For long text or prompt values, use POST with form data or multipart upload.
Expected JSON fields may include:
successmarkdownprompt_resultresourcemimetypetoken_status - Can be: free, valid, invalid, expired, exhausted, expired_pending, activated, verification_error, invalid_payment, error, pendingtoken_balancetoken_expiresThe token_status field (and X-Token-Status header) indicates the authentication state:
| Status | Description |
|---|---|
| free | Free tier (no token required, 10 requests/day), within the service’s overall free quota |
| valid | Paid token active with remaining balance |
| invalid | Token not found or not provided |
| expired | Token validity period has ended |
| exhausted | Token balance has been fully used |
| expired_pending | Activation memo has expired |
| activated | Token was just activated with this request |
| verification_error | Payment verification failed |
| invalid_payment | Payment transaction is invalid |
| error | Internal error during token processing |
| pending | Payment required (token not yet activated) |
Use result to control how much output is returned.
markdown: return converted Markdown only.prompt: return only the result of prompt processing.both: return both the Markdown and the prompt result.Note:
result=both returns Markdown with a ## Prompt Result section appended.result=both returns JSON with separate markdown and prompt_result fields.Rules:
prompt is present and both outputs are useful, use result=both.result=prompt.result=markdown.Use prompt for:
Examples:
prompt=Summarize this documentprompt=Extract key pointsprompt=Convert this content to JSONprompt=Analyze and explainPreferred:
Authorization: Bearer TOKENLegacy:
X-Token-Required: TOKEN?token=TOKENThe service enforces rate limits to ensure fair usage.
All responses include rate limit information in headers:
| Header | Description |
|---|---|
| X-RateLimit-Remaining | Requests remaining in current window |
| X-RateLimit-Reset | Unix timestamp when the limit resets |
| Tier | Limit |
|---|---|
| Free | 10 requests/day, within the service’s overall free quota |
| Paid | 10,000 requests/hour |
When rate limit is exceeded, the service returns HTTP 429.
Autonomous agents should first attempt delegated payment when a connected wallet and sufficient balance are available.
If the service returns 402 Payment Required, the response may include:
PAYMENT-REQUIREDThis header contains a base64-encoded payment requirement payload.
After payment is prepared and signed, the client retries the same request with:
PAYMENT-SIGNATURE: <base64-payment-payload>This header proves that the client prepared and signed payment according to PAYMENT-REQUIRED.
If the payment is accepted and verified:
200 OKPAYMENT-RESPONSE: <base64-json-response>The decoded JSON in PAYMENT-RESPONSE should confirm payment and may include:
PAYMENT-RESPONSE as authoritative payment confirmation metadata.402 response.Manual payment is intended as a fallback path when autonomous payment is unavailable.
When payment is required, the service may provide the following headers:
X-Token-RequiredX-Memo-RequiredX-Wallet-AddressX-QR-PaymentX-QR-Payment is present, treat it as the canonical payment payload.X-QR-Payment is not present, fall back to the returned token, memo, and wallet address exactly as provided by the service.Continue.Continue.Continue, continue to token activation using the exact token and memo from the 402 response.After payment, activate the paid token with the exact token and memo from the 402 response.
402 response.402 response.Authorization: Bearer TOKEN with X-Memo-Required: MEMOX-Token-Required: TOKEN with X-Memo-Required: MEMOtoken=TOKEN and memo=MEMOtoken=TOKEN and memo=MEMOIf activation succeeds, continue the conversion in the same request and return the normal output.
PAYMENT-* headers with manual X-* payment headers.402 response.Continue.Use stream=true when:
Streaming applies to GET / and other supported paths where the service enables it.
The streaming response uses Server-Sent Events (SSE) with this exact format:
First message (token info):
data: {"type":"token_info","status":"valid","balance":99,"expires":2027-01-01}
Content chunks (one or more):
data: {"content":" partial markdown ","resource":"https://example.com/file.pdf","mimetype":"application/pdf"}
End marker:
data: [DONE]
If an error occurs during streaming:
{"error":"error message","code":400}[DONE]| Parameter | Value | Description |
|---|---|---|
| stream | true | Enable SSE streaming |
| result | "markdown" or "prompt" | What to stream |
Note: result=both streams markdown first, then prompt_result after.
POST /v1/chat/completions supports:
image_url inputsUse it when the host agent is already built around OpenAI-compatible chat completions.
The service exposes MCP discovery and tool calls.
Use these endpoints when needed:
GET /mcpPOST /mcpThe convert tool parameters:
url, text, file (Base64-encoded content), filename, prompt, result, stream, token, memoNote: file is Base64-encoded string (not multipart).
Preferred MCP connection:
{
"mcpServers": {
"mdapi": {
"url": "https://mdapi.io/mcp"
}
}
}
If using a paid token:
{
"mcpServers": {
"mdapi": {
"url": "https://mdapi.io/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
For IDE agents (JetBrains, Cursor, VS Code, etc.) using the Agent Client Protocol, send JSON-RPC requests to POST /acp.
Example request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "convert",
"arguments": {
"url": "https://example.com/doc.pdf",
"prompt": "Summarize",
"result": "both"
}
}
}
Supported methods:
initialize - protocol initializationtools/list - list available tools (includes convert)tools/call - call convert tool (single request only; batch not supported)resources/list - list available resourcesresources/read - read a resourceNote: ACP does not support batch processing; use sequential convert calls.
For autonomous agents (Claude Code, Codex, OpenClaw, Hermes, etc.) using the Agent-to-Agent protocol, send JSON-RPC requests to POST /a2a.
Example request:
{
"jsonrpc": "2.0",
"id": "1",
"method": "SendMessage",
"params": {
"message": {
"messageId": "msg_1",
"parts": [
{"text": "Convert https://example.com/doc.pdf"}
]
}
}
}
Supported methods:
SendMessage - single conversion requestSendStreamingMessage - streaming conversionGetTask - check task statusCancelTask - cancel ongoing taskSubscribeToTask - receive task updates via SSEUse mdapi.io as a shared transformation layer in multi-agent and swarm setups. Agents can hand off compact Markdown or structured outputs between roles such as researcher, summarizer, extractor, classifier, and validator without carrying raw source noise through the workflow.
Agents may change roles across the workflow and reuse mdapi.io at each step to normalize input, refine output, or produce task-specific transformations.
Use text and prompt for downstream transformation, agent handoffs, and multi-step pipelines where the output of one step becomes the input of the next.
Prefer compact intermediate outputs to preserve context and reduce token usage across chained transformations.
Treat the agent role as dynamic. A workflow may start with fetching and normalization, continue with summarization or extraction, and finish with validation or structured export.
Use mdapi.io at each stage when switching roles so each agent receives only the information needed for its step.
url, file, or text is present when required.Monitor service status at GET /health. Returns full service health information.
Example:
curl "https://mdapi.io/health"
Response includes:
status: "ok"service: "mdapi.io"description: "Minimal Data API I/O: a content transformation layer primitive for AI systems. Transforms documents, images, and webpages into AI-ready Markdown and structured data, optimized for LLM efficiency and token usage."version: "1.0.0"endpoints: list of all endpoints with their pathsexamples: usage examples for common operationslimits: current service limits (file size, rate limits, tier info)mdapi.io exposes multiple discovery endpoints for different protocols and use cases. Each serves a specific purpose:
Both agent.json and agent-card.json exist because different standards require different formats. Use ai-discovery.json for automatic protocol detection.
GET /?url=....POST /.prompt and result=prompt or result=both.POST /.convert tool through MCP.curl "https://mdapi.io/?url=https://example.com/page"
curl "https://mdapi.io/?url=https://example.com/page&prompt=Summarize+this&result=both"
curl "https://mdapi.io/?text=Hello+World&prompt=Extract+key+points&result=prompt"
curl -X POST -F "file=@document.pdf" "https://mdapi.io/"
curl "https://mdapi.io/?url=https://example.com/doc.pdf&token=YOUR_TOKEN&memo=YOUR_MEMO"
{
"model": "markdown-v1",
"messages": [
{
"role": "user",
"content": "Convert https://example.com/doc.pdf"
}
],
"stream": false
}
This skill is intentionally focused on execution, not on authoring skills.
The root / should contain the full public documentation and discovery references.
This /.well-known/SKILL.md or /SKILL.md file is the operational skill that agents load and execute.