{"uid":"cap_XzLxme3vSYllrEHuZHBCb","slug":"delx-pdf-header-sniff-65f695ce","name":"Delx PDF Header Sniff","description":"Sniff PDF magic and approximate size from base64 prefix. Call when rejecting non-PDF uploads before heavy OCR. Returns is_pdf and decoded_prefix_len as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.","url":"https://api.delx.ai/api/v1/x402/pdf-header-sniff","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"base64_prefix":{"type":"string","description":"Base64 prefix of a file for sniffing"}}},"responseSchema":{"type":"json","example":{"is_pdf":true,"schema":"delx/util-pdf-header-sniff/v1","decoded_prefix_len":8}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_WcpKKqi5qdhkgq8m5V9mj","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects whether a base64-encoded file prefix represents a PDF by inspecting its binary header signature.","exampleAgentPrompt":"I have a base64-encoded snippet of the start of a file — can you check if it's actually a PDF by sniffing its header? The prefix is 'JVBERi0xLjQK...'","exampleUseCases":[{"title":"Pre-validate uploads before PDF parsing","prompt":"Before I send this file to the PDF parser, can you sniff the header of this base64 prefix 'JVBERi0xLjMg...' to confirm it's actually a PDF and not some other file type?"},{"title":"Filter non-PDF files in a document pipeline","prompt":"I'm processing a batch of user-uploaded files and need to skip anything that isn't a PDF — can you check if this base64 prefix 'UEsDBBQAAAAI...' belongs to a PDF?"},{"title":"Validate file type from partial download","prompt":"I only fetched the first few bytes of a remote file as a base64 string — can you tell me if it's a PDF based on the header? Here's the prefix: 'JVBERi0xLjY...'"}],"resultDescription":"Returns a JSON object indicating whether the file is a PDF (is_pdf: boolean), the length of the decoded prefix in bytes, and a schema identifier string ('delx/util-pdf-header-sniff/v1').","failureModes":["Missing or empty base64_prefix field returns an error","Invalid base64 encoding causes a decode failure","Prefix too short to contain a recognizable PDF magic number may return is_pdf: false even for valid PDFs","Malformed JSON body returns a 400-level error"],"whenToPreferThis":"Use this endpoint when you need a lightweight, fast check to determine if a file is a PDF before committing to heavier parsing or download operations. It is ideal for agent pipelines that need to filter or route files by type without loading the full document. Prefer this over full PDF parsers when you only need a boolean type-check, not content extraction.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:47:56.834Z","isFirstParty":false}