# PDF parser API for LLMs and RAG Turn a PDF at a URL into page-by-page text with a character count per page, capped at the length you set, ready to chunk and embed. ## When an agent wants this - Chunk a PDF by page for a retrieval index - Keep a document inside a model's context with maxChars - Embed the pages with the embeddings tool in the same workflow ## PDF to text, PDF text extraction: extract the text of a PDF document from a URL, page by page PDF to text, PDF text extraction: extract the text of a PDF document from a URL, page by page. $0.005 per successful call; failed calls are never charged. Extract the text of a public PDF (up to 10 MB) from its URL, page by page, with title, author and page count. Choose the first page, how many pages (up to 200) and maxChars. arXiv abstract links work. If a site blocks our fetch, the Internet Archive's dated copy is read and the answer says so. Scanned, encrypted and non-PDF files fail uncharged. Use to read papers, invoices, reports and manuals into an agent. Inputs: url (required): Absolute public http(s) URL of the PDF; firstPage: First page to read (default 1); pages: How many pages to read (1-200, default 20); maxChars: Maximum characters of text returned across all pages (1000-200000, default 50000). Not in the free calls over HTTP; pay from the first call. With prepaid credits this tool costs $0.002 a call: $1 by card pays for 500 calls, with no account and no subscription. With a card key from https://tools.funwords.eu/credits, in a header or, when your client can only fetch a URL, in the URL: curl -H "Authorization: Bearer adt_…" "https://tools.funwords.eu/pdf/text?url=https%3A%2F%2Fbitcoin.org%2Fbitcoin.pdf" curl "https://tools.funwords.eu/pdf/text?url=https%3A%2F%2Fbitcoin.org%2Fbitcoin.pdf&api_key=adt_…" Without a key the same URL answers 402 with x402 and MPP terms, so a wallet client pays USDC per call and retries. Over MCP (https://tools.funwords.eu/mcp) this tool is pdf_text. Example result: { "url": "https://bitcoin.org/bitcoin.pdf", "title": null, "author": null, "totalPages": 9, "firstPage": 1, "pagesRead": 1, "chars": 46, "truncated": true, "pages": [ { "page": 1, "chars": 46, "text": "Bitcoin: A Peer-to-Peer Electronic Cash System" } ] } Tool page: https://tools.funwords.eu/tools/pdf-text ## OpenAI compatible embeddings: BGE-M3, 1,024 dimensions OpenAI compatible embeddings: BGE-M3, 1,024 dimensions. $0.01 per successful call; failed calls are never charged. A 1,024-dimension embedding vector for up to 4,000 characters of text in 100+ languages, from BAAI's BGE-M3. Use for semantic search, RAG retrieval, clustering and deduplication. Inputs: text (required): Text to embed, up to 4,000 characters. Free first (3 successful calls per caller, no key): curl "https://tools.funwords.eu/ai/embed?text=pay-per-call%20APIs%20for%20AI%20agents&trial=1" With a card key from https://tools.funwords.eu/credits, in a header or, when your client can only fetch a URL, in the URL: curl -H "Authorization: Bearer adt_…" "https://tools.funwords.eu/ai/embed?text=pay-per-call%20APIs%20for%20AI%20agents" curl "https://tools.funwords.eu/ai/embed?text=pay-per-call%20APIs%20for%20AI%20agents&api_key=adt_…" Without a key the same URL answers 402 with x402 and MPP terms, so a wallet client pays USDC per call and retries. Over MCP (https://tools.funwords.eu/mcp) this tool is ai_embed. Example result: { "dimensions": 1024, "embedding": [ 0.0123, -0.0456, 0.0789 ], "model": "@cf/baai/bge-m3" } Tool page: https://tools.funwords.eu/tools/ai-embed ## Questions **Does it return tables and images?** It returns the text layer in reading order. Images are not returned, and a table comes back as its text. **How do I keep the answer small?** maxChars caps the text returned across all pages (1,000 to 200,000 characters); truncated in the answer says when the cap was hit. Docs for agents: https://tools.funwords.eu/llms.txt · OpenAPI: https://tools.funwords.eu/openapi.json · All guides: https://tools.funwords.eu/guides