Repository avatar
AI Tools
v1.2.2
active

inferrail-robust-read

io.github.domondi1/inferrail-robust-read

Pages a plain read can't get, as Markdown: official APIs, embedded data or a render. $0.009 each.

Documentation

Inferrail logo

Inferrail

External evidence for AI agents.
Public webpages, document text and investigation data your agent can use,
with structured results and transparent per-result pricing.

CI PyPI version License: Apache-2.0

Web Read · Developer quickstart · Pricing · Inference budgets · For agents

Start with Web Read: retrieve an original public source as clean Markdown with its title, source URL, retrieval timestamp, content hash and payment receipt. Use it for research, document ingestion, citations and recurring documentation reads without maintaining an extraction and payment-recovery stack. Inferrail also ships independent inference spending controls: the Python package installs the self-hosted gateway, not the hosted evidence APIs.

Readable sources. Predictable purchases. Put readable source material in your agent's context, keep the URL, retrieval time and receipt attached, and know the price before each purchase. Failed native deliveries are uncharged. Start with a prepaid API key or a wallet you already use.

What you can use today

Verified 2026-11-28 against unpaid production challenges, live pricing and public registries. Commercial availability and maturity are separate: the purchasable APIs remain developer preview. Production contracts override this dated inventory.

ProductResult / priceLive payment pathMaturity
Web ReadPublic page or text-layer PDF as Markdown, metadata and receipt. $0.002 per delivered page or document.API key + prepaid credits; x402 USDC on Base; MPP on TempoCommercial developer preview
Package CheckOSV.dev advisories, CVEs, severity and available fixes for 1–20 versions, $0.002 per delivered check.API key + credits; x402 Base; MPP TempoCommercial developer preview
Domain CheckDNS, SPF/DMARC and available RDAP registration. $0.002 per delivered lookup.API key + credits; x402 Base; MPP TempoCommercial developer preview
x402 FinderUp to five matching paid APIs with invocation details. $0.002 per delivered answer; no match is free.x402 Base; MPP TempoCommercial developer preview
Inferrail HostedShared per-run inference budgets. 250 qualifying runs/workspace/month free, then $0.001/run. Provider spend separate.Workspace key; prepaid card or x402 creditsDeveloper preview; experimental pricing
Self-hosted gatewayInference budgets, payload-free receipts, dashboard. Free Apache-2.0 software.Your infrastructure and provider keyPublished open source; developer preview

Package/Domain credit routes are live: POST /pkg/credits/v1/check and POST /domain/credits/v1/lookup, the same workspace key and 2 credits per delivery. Published SDK 0.3.2 and paid MCP also support these two with the same prepaid key.

Web Read quickstart

API key and prepaid credits (no wallet)

Fastest: Create and fund a key in your browser. The hosted page presents the key once, then offers card checkout. No terminal is needed for those steps. Or use the commands below.

  1. Create a workspace key for free; the API shows it once. Save it securely.
  2. Obtain a Stripe Checkout link and complete it yourself: one $10 pack is 10,000 credits, enough for 5,000 delivered reads. No subscription or automatic replenishment.
  3. Call Web Read with the key. A delivered page or PDF costs 2 credits ($0.002).
curl --fail-with-body -X POST \
  https://inferrail-cost-gateway.onrender.com/hosted/v1/workspaces
# Save api_key from the response. Load it without entering its value in shell history:
read -rsp 'Workspace key: ' INFERRAIL_API_KEY; echo
export INFERRAIL_API_KEY

curl --fail-with-body -X POST \
  'https://inferrail-cost-gateway.onrender.com/hosted/v1/credits/checkout?packs=1' \
  -H "Authorization: Bearer $INFERRAIL_API_KEY"
# A person opens the returned checkout_url and completes payment.

curl --fail-with-body -X POST \
  https://inferrail-cost-gateway.onrender.com/read/credits/v1/page \
  -H "Authorization: Bearer $INFERRAIL_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/","request_id":"first-read-1"}'

curl --fail-with-body \
  https://inferrail-cost-gateway.onrender.com/hosted/v1/workspace \
  -H "Authorization: Bearer $INFERRAIL_API_KEY"

Use Bash for read -rsp; alternatively load the key through your secret manager. Never put keys in URLs, source control or browser application code. An insufficient balance returns 402 insufficient_credits before the read. The Hosted free-run allowance is not free page credit. USDC funding is also available: $1 for 1,000 credits via the live funding contract.

Check packages or domains with the same key

Each delivered check or lookup costs 2 credits ($0.002). A package check covers 1–20 versions; one domain lookup covers one domain. These commands use the balance you funded above:

curl --fail-with-body -X POST \
  https://inferrail-cost-gateway.onrender.com/pkg/credits/v1/check \
  -H "Authorization: Bearer $INFERRAIL_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"packages":[{"ecosystem":"npm","name":"lodash","version":"4.17.20"}],"request_id":"package-review-1"}'

curl --fail-with-body -X POST \
  https://inferrail-cost-gateway.onrender.com/domain/credits/v1/lookup \
  -H "Authorization: Bearer $INFERRAIL_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"domain":"example.com","request_id":"domain-review-1"}'

Package Check returns known OSV advisories and available fixes, not a security certification. Domain Check returns DNS, email-policy and available registration data, not a trust verdict. Use a new request ID for a fresh investigation; preserve the original body and ID for recovery.

Existing wallet: inspect the unpaid offer

curl -i -X POST https://inferrail-cost-gateway.onrender.com/read/v1/page \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/","request_id":"first-read-1"}'
# HTTP 402: price, schema and payment instructions. Nothing is purchased.

An x402 client pays the Base offer with PAYMENT-SIGNATURE; an MPP client answers the Tempo challenge with Authorization: Payment <credential>. A human initially authorizes and funds the wallet. Runnable buyers · production OpenAPI · Web Read contract.

Finder uses the same wallet challenge flow at POST /find/v1/find with {"need":"read a public webpage as markdown","request_id":"find-reader-1"}. It costs $0.002 per delivered answer and returns invocation details for up to five selected catalog resources. If no API matches, there is no charge. Finder does not execute or guarantee the APIs it lists.

Delivery, batches and boundaries

  • Output: url, final_url, title, content_markdown, word_count, content_sha256, fetched_at, source-declared metadata, and receipt. A hash identifies the returned content; it does not prove the source is true. Metadata can be absent or wrong.
  • Charging: wallet authorization is verified before extraction, then settled after successful extraction before the paid HTTP response. Credits are held, billed on success or released on failure. Structured refusals and upstream failures are uncharged.
  • Recovery: use the same URL, request_id and wallet/workspace within 10 minutes to recover the paid result without a second charge. A new read needs a new request ID.
  • Wallet batch: POST /read/v1/pages, 1–10 distinct URLs, $0.002 each, all-or-nothing delivery and charge. Preserve the same ordered URLs and request ID for recovery.
  • API-key SDK batch: individual page requests; successful deliveries are charged even when another page fails. Not interchangeable with the direct wallet batch.
  • Limits: public HTTP(S), robots.txt respected, 2 MB HTML/text, 5 MB PDFs, first 50 PDF pages. Text-layer extraction only; no OCR, JavaScript, login or paywall bypass. Up to three redirects and a 15-second fetch timeout per request. A thin JavaScript shell can still be returned; inspect content rather than assuming completeness.
  • Retention: Web Read temporarily stores delivered results for recovery, separately from the gateway's payload-free receipts. Expiration cleanup can be lazy, so the 10-minute recovery window is not a precise deletion-time promise. Accounting records remain.

Full technical contract · watcher examples · 20-URL extraction benchmark: 17 delivered responses, roughly 9× lower median estimated tokens versus raw HTML (characters ÷ 4). One delivered JavaScript shell is labelled a miss. This small sample is not a completeness or workflow-savings guarantee.

SDK and paid execution MCP

Published npm 0.3.2 supports prepaid Web Read, Package Check and Domain Check, wallet-based tools, and explicit credit-batch failure reporting. Pin the verified release when reproducing these examples.

Use Node.js 22+ with the current AI SDK releases. The tools package itself supports Node.js 18+.

npm install @inferrail/ai-sdk-tools@0.3.2 ai zod @x402/fetch @x402/evm viem
import { inferrailCreditTools } from "@inferrail/ai-sdk-tools";

const tools = inferrailCreditTools({ apiKey: process.env.INFERRAIL_API_KEY! });
// Pass to AI SDK generateText: readPage, readPages, checkPackages and lookupDomain.
// All four tools use your prepaid credit balance.

Wallet mode uses inferrailTools({ fetch: wrapFetchWithPayment(fetch, client) }): readPage, readPages, checkPackages, lookupDomain, findPaidApi. You supply the funded, authorized x402 client. guardInferrailPrices(client) checks Inferrail offer prices/recipients; creditsFetch(apiKey) is the API-key HTTP helper. Complete setup · working agents.

Paid local MCP: run npx -y @inferrail/ai-sdk-tools@0.3.2 in your MCP client with INFERRAIL_API_KEY (prepaid credits), or INFERRAIL_WALLET_KEY (USDC on Base). Both modes offer read_page, read_pages, check_packages and lookup_domain. Set INFERRAIL_MAX_USD_PER_DAY (default $0.10). It enforces that server's daily spending record, persisted locally across restarts; it is not an account-wide cap across independent clients. Treat client config as secret. Published Desktop extension 0.3.2 offers secure client configuration. MCP Registry Web Read entry 1.2.2 is published.

Read-only gateway MCP is separate: inferrail mcp provides get_spend and get_health; it cannot purchase pages, execute paid tools or run inference.

claude mcp add inferrail-reports \
  -e INFERRAIL_RECEIPTS_PATH=/absolute/path/to/inferrail-receipts.jsonl \
  -- uvx --with "mcp>=2.0" inferrail mcp

MCP client configuration · read-only MCP.

For agents

One discovery document: llms.txt, with executable first requests, prices, payment paths, output contracts and refusal/recovery terms. Generated production contracts describe the deployment; this repository's root openapi.json describes the self-hosted inference gateway, not the commercial service catalog.

npx skills add domondi1/inferrail

Claude Code plugin: /plugin install inferrail --marketplace domondi1/inferrail. Update with npx skills update, or /plugin marketplace update inferrail then /plugin update inferrail@inferrail. These are public integration paths, not platform endorsements or evidence of customer adoption. Skills use authorized wallets; paid MCP is the prepaid Web Read path. Package checks in CI require a wallet and spending cap.

Apify marketplace tools

Separate distribution and billing through your Apify account. These listings are public and pay-per-event; platform/account fees and limits can apply. Native Inferrail API coverage is narrower than the marketplace catalog. Consult each listing's current terms before execution.

ActorWhat it doesPrice
Web Page & PDF to Markdown, Site CrawlerPages, PDFs or whole sites as Markdown with metadata$0.002 per readable page
PDF to Markdown & TextPDFs at public URLs as Markdown with title, author and dates$0.002 per readable document
Website Contact FinderEmails, phones and social profiles a site publishes$0.005 per site with contacts
Company Jobs APIOpen jobs from Greenhouse, Lever, Ashby, Workable, SmartRecruiters and Recruitee; give it company domains$0.001 per job
Company EnrichmentDomain to profile: identity, contacts, socials, tech stack, open-job count$0.004 per company

Also verified public: Tech Stack, SEO Audit, Domain Check, RSS/Atom Reader, and Website Screenshot. All ten tools and billing units.

Inferrail Hosted

One workspace ledger shares inference budgets across agents and machines. Create a key, send your provider key on each request, and use the same work ID and ceiling for the run. Hosted controls only routed model calls. 250 qualifying runs per workspace per UTC month are free; after that, $0.001 per run from prepaid credits. A run is billed only if a provider answers a call. Card and USDC top-ups are live; model-provider charges are separate. No subscription or automatic top-up; experimental pricing. Setup and privacy boundaries · live prices.

Self-hosted gateway quickstart

Requires Python 3.11+.

Try it offline. No API key, no network calls, no provider charges:

pip install inferrail
inferrail demo
inferrail report --by customer --receipts ./inferrail-demo-receipts.jsonl

The demo sends scripted requests through the real engine to a fake provider with made-up prices labelled DEMO, and prints what they cost by customer.

Give one run a budget, inside your Python app. No config file, no second process:

import inferrail
from openai import OpenAI

base_url = inferrail.start()   # the gateway, on a background thread in this process
client = OpenAI(base_url=base_url, api_key="unused")   # your key stays in OPENAI_API_KEY
client.chat.completions.create(
    model="gpt-4o-mini",   # any model your account can use; `inferrail models` lists priced ones
    max_tokens=200,
    messages=[{"role": "user", "content": "Summarize this contract."}],
    extra_headers={
        "X-Inferrail-Attribute-Work-Id": "contract-review-42",   # the run
        "X-Inferrail-Budget-Usd": "0.50",                        # its dollar ceiling
    },
)

Calls with the same work id share that budget, including parallel calls. Admission reserves a conservative estimate before the provider call. Actual usage can exceed an estimate; that overrun is recorded and later calls are refused. Only routed inference is governed. inferrail work contract-review-42 shows what the run cost.

More: run it as a shared gateway with the local dashboard, framework snippets (LangChain, LangGraph, OpenAI Agents SDK, CrewAI, Haystack, LlamaIndex, Microsoft Agent Framework), and other clients, including the Anthropic SDK.

Recording of a real Inferrail run. The gateway starts with its local dashboard. An agent script gives one AI job, contract-review-42, a $0.04 spending limit and makes six model calls: four are answered and two are blocked with HTTP 402 before reaching the model. The dashboard lists each call with its cost, then shows the job spent $0.0325 of its $0.0400 budget, with 2 requests blocked before reaching the provider.

A real run of the gateway and dashboard with a local stand-in model: one job with a $0.04 limit, four calls answered, two refused with HTTP 402 before reaching the model. How it was recorded

Labs and other previews

AP invoice-exception recovery is an isolated, experimental open-source workflow (contract). The hosted trial is a temporary inference demo, not free Web Read. Work Economics and Economic Authority are Base Sepolia testnet experiments (session example). Job-Safe Search, joint model/purchase budgets, sub-agent allocations and @inferrail/x402-budgets are experimental; no universal external-spend control or production commerce is claimed. Labs. The optional AWS payment rail is implemented but commercially inactive at verification.

How it works

Data flow. On your machine, your application sends requests to the Inferrail gateway, which reads the provider API key from its environment, forwards request content and the key to OpenAI or Anthropic, and returns the response. Separately, the gateway writes a metadata receipt (tokens, cost, status, timing, attributes, no message bodies) to a local JSONL or SQLite store that reports, the local dashboard, and MCP tools read. A usage beacon collector receives lifecycle events only if an endpoint is configured.

The gateway routes each request by model to a configured provider, checks any budget in scope, forwards the call, and writes one receipt per request, including requests a budget refused. A cost is recorded only when the provider reports usage and a price is on file; otherwise it's unknown, never a guessed $0.

WhereWhat it sees or keeps
Your providerThe full request, exactly as it would without Inferrail, under the provider's own policies.
The gateway, in memoryYour provider key (from its own environment) and the prompts and responses it forwards.
Receipts, on your diskProvider, model, token usage, the price used and the cost, status, timing, and the attribution tags you send.
Not in receiptsPrompt and response bodies.

Attribution tags are stored as sent, so keep secrets and message content out of them. inferrail verify-payload-free prints the live receipt schema, and canary tests check that message bodies never reach receipts; neither is a security audit. The optional usage beacon sends nothing unless an endpoint is configured (details). Architecture: docs/ARCHITECTURE.md.

Current support

  • Endpoints: POST /v1/chat/completions (OpenAI-compatible) and POST /v1/messages (Anthropic-compatible), with streaming and tool calls, plus GET /v1/models.
  • Providers: OpenAI, Anthropic, and endpoints compatible with either. Built-in prices cover OpenAI and Anthropic models; others need a price in your config, or their cost stays unknown.
  • Not supported: the OpenAI Responses API, embeddings, image generation, audio and Realtime, batch, and native Gemini or Bedrock APIs. Fields the gateway can't account for are rejected with a clear error, never silently dropped.
  • Scope: only calls through a running gateway are counted.

Exact contract and non-goals: docs/PRODUCT.md. Running agent jobs that spend real money? Open a production setup request.

Documentation

Contributing, security, license

Questions and bugs: GitHub issues. Security or privacy vulnerabilities: report privately, as described in SECURITY.md. Contributing: CONTRIBUTING.md (pytest needs no API key or network). License: Apache-2.0.