Metered API-as-a-Service. Sells billed, idempotent data/action API calls to AI agents and developers. Prepaid credit, priority queue, stateless idempotent workers, per-call settlement, full audit trail — over a compliant supply side.
One of three independent passive-cashflow systems. Sibling products: Rainmaker (Business-in-a-Box) and Ratchet (compute broker). Each is self-contained and embeds its own copy of the shared
coreengine.
Furthest along of the three systems. The billing rails, the worker engine, and a 10-endpoint catalog are built and under test; deployment configs, legal docs, and a launch kit are written. Not yet taking outside traffic — the remaining work is operational (host it, point a domain at it, take the first paying call), not architectural.
- 35 tests passing across the shared core and the product workers
- 10 billable endpoints in the catalog (below)
- Self-host path is real: Dockerfile,
docker-compose.yml, and a Render blueprint
| Endpoint | What it does |
|---|---|
text.summarize |
Condense text to a target length |
text.classify |
Label text against caller-supplied categories |
text.extract |
Pull entities/fields out of free text |
text.keywords |
Rank salient terms |
text.redact |
Find and mask PII (emails, phones, SSNs, cards) + report what was found |
text.structured |
Schema-guided extraction — caller supplies fields/JSON schema, gets JSON back |
text.chunk |
Token-sized chunks with overlap, for RAG pipelines |
text.language |
Language detection |
html.extract |
HTML → main article text, title, links; nav/ads stripped |
document.extract |
PDF → structured JSON |
text.structured runs rules-first and can be upgraded to an LLM backend through an
OpenAI-compatible client. The default preset targets Ollama on the host — no API
key, no per-token vendor cost, nothing leaving the machine. If the model is
unreachable, the endpoint degrades to the rules path rather than failing the call.
src/core/ shared engine: ledger, pricing, queue, worker, auth,
gateway, ratelimit, audit, config, db, errors
src/tollgate/ the product: billable workers, LLM client, API boot
docs/ architecture (00-overview, 01-core, 02-tollgate),
endpoint roadmap, ADRs
legal/ TERMS, PRIVACY, ACCEPTABLE_USE
tests/ 35 tests
Operational docs live alongside the code: DEPLOY.md, SELF_HOST.md,
MONITORING.md, LAUNCH.md. A dashboard ships in-repo, and an admin metrics
endpoint reports revenue derived from purchase-tagged ledger entries, with a
stdlib digest script for cron/systemd.
pip install -e ".[dev]"
pytest
uvicorn tollgate.app:create_app --factorySee docs/00-overview.md to get oriented, docs/01-core.md for the shared engine,
and docs/02-tollgate.md for the worker/API contract. docs/adr/0001 records the
compliant-supply-side decision.
- Deploy it and take one real call. Everything needed is written — the gap is an actual host, a domain, and a first transaction end to end.
image.ocr— scanned PDFs and receipts are the highest-demand endpoint still missing. It needs Tesseract as a system package, which is why it slipped behind the pure-Python tier.data.normalize— validation and normalization, to round out the catalog.- Move off SQLite once concurrent traffic justifies it; self-hosted Postgres is the planned target.
- Own the ingress. Currently a free Cloudflare Tunnel; the in-house path is Caddy or Nginx with Let's Encrypt.
Source code is private. This repository is a public write-up of what the project does, how it's built, and the decisions behind it — not the implementation.