← All APIs

POST · JSON API

PDF-to-Markdown Converter

Convert a supplied PDF into Markdown while preserving document structure and tables.

$0.760 USD / request

Not covered by the initial $0.050 grant. This quote requires full payment; there is no partial credit-plus-payment split.

Trial access and limits

Try eligible APIs with free service credit. Each verified EVM externally owned wallet receives $0.050 once, shared across APIs with no expiry. No deposit, payment, on-chain transaction, API key, or registration is required. Wallet sign-in (SIWX) is required; contract wallets are not supported. Credit is nontransferable. Execution requires sufficient credit, daily trial budget, and API availability.

Not covered by the initial $0.050 grant. This quote requires full payment; there is no partial credit-plus-payment split.

No free execution is promised for this API. Check its availability and quote before choosing access. An unaffordable quote requires a separate, fully paid request; there is no partial credit-plus-payment split.

Trial-only protocol reference (stops without paying)
// Node.js 22+ ES module. Use an existing EOA key locally; never send it to the seller.
// npm init -y && npm pkg set type=module && npm install @x402/extensions viem
import { privateKeyToAccount } from "viem/accounts";
const privateKey = process.env.TRIAL_PRIVATE_KEY;
if (!/^0x[0-9a-fA-F]{64}$/.test(privateKey ?? "")) throw new Error("Set an existing EOA's TRIAL_PRIVATE_KEY locally.");
const existingSigner = privateKeyToAccount(privateKey);
// npm install @x402/extensions
// existingSigner is your EVM EOA signer with address and signMessage({ message }).
// Use plain fetch, never a payment-wrapped fetch, for trial-only access.
import { wrapFetchWithSIWx } from "@x402/extensions/sign-in-with-x";

const trialFetch = wrapFetchWithSIWx(fetch, existingSigner);
const response = await trialFetch("https://manyfish-seller.redcliff-d7368db1.westus2.azurecontainerapps.io/api/v1/content/pdf-to-markdown", {
  method: "POST",
  headers: { "content-type": "application/json", accept: "application/json" },
  body: JSON.stringify({
  "pdfBase64": "JVBERi0xLjQKJcTl8uXrCg==",
  "pages": "1-5",
  "locale": "en-US"
}),
  redirect: "error",
  signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`Trial stopped: HTTP ${response.status}. Do not automatically retry or pay.`);
if (response.headers.get("x-access-mode") !== "trial" ||
    response.headers.get("x-trial-status") !== "charged" ||
    response.headers.get("x-trial-accounting-status") !== "confirmed" ||
    response.headers.has("payment-response") || response.headers.has("x-payment-response")) {
  throw new Error("Trial accounting is unconfirmed. Do not repeat this request or pay.");
}
console.log(await response.json());
// No payment signer, paid fallback, or application retry loop is installed.
Manual authentication protocol

A valid request without payment headers can discover a SIWX challenge. Sign once and resend the identical URL, method, and body with SIGN-IN-WITH-X. Empty requests only discover the API. The canonical challenge is in the PAYMENT-REQUIRED header, not a cached directory entry.

Ready for continued use? Set up explicit paid API calls at the listed price. This quickstart never falls back to payment.

Inspect access requirements (returns 402)

POST /api/v1/content/pdf-to-markdown

Send the documented JSON body. Invalid input is rejected before payment or upstream execution. An empty request does not execute the API.

This curl example only inspects access requirements. It sends no payment or wallet proof and does not return a business result. HTTP 402 is expected. A paid call requires an explicit x402 payment using a compatible client.

Replace sample inputs with your data. Encoded file samples illustrate the JSON format and may not be complete usable files.

curl --request 'POST' 'https://manyfish-seller.redcliff-d7368db1.westus2.azurecontainerapps.io/api/v1/content/pdf-to-markdown' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "pdfBase64": "JVBERi0xLjQKJcTl8uXrCg==",
  "pages": "1-5",
  "locale": "en-US"
}'

Illustrative response · Not live data

This is a synthetic contract example, not a live result. Actual results depend on the submitted input and upstream availability.

{
  "markdown": "# Example\n\nDocument text.",
  "markdownCharacters": 25,
  "pageCount": 1,
  "processedPages": [
    1
  ]
}

Schemas & documentation

These schemas come from the same API descriptor used for validation and discovery. Read the complete OpenAPI contract for responses, errors, and access requirements.

Request JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "pdfBase64"
  ],
  "properties": {
    "pdfBase64": {
      "type": "string",
      "minLength": 8,
      "maxLength": 13981016,
      "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
    },
    "pages": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[1-9]\\d*(?:-[1-9]\\d*)?(?:,[1-9]\\d*(?:-[1-9]\\d*)?)*$"
    },
    "locale": {
      "type": "string",
      "minLength": 2,
      "maxLength": 32,
      "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$"
    }
  }
}
Response JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "markdown",
    "markdownCharacters",
    "pageCount",
    "processedPages"
  ],
  "properties": {
    "markdown": {
      "type": "string"
    },
    "markdownCharacters": {
      "type": "integer",
      "minimum": 0
    },
    "pageCount": {
      "type": "integer",
      "minimum": 0
    },
    "processedPages": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1
      }
    }
  }
}
How your submitted data is used

Quality review is enabled: executed paid and trial request/response bodies, including uploaded documents and images, are retained in private storage for operator review. Deletion is scheduled after 30 days and runs asynchronously. Authentication and payment headers are not recorded. Do not submit secrets or unnecessary personal data.