# TrollBridge Prompt Cost Estimator

> TrollBridge Prompt Cost Estimator is a paid API for AI agents from mini-tollbooth.onrender.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-12).

Estimates the token count and USD cost of a given prompt across all supported AI models, returning a cheapest-first ranked list

## Facts

- Endpoint: GET https://mini-tollbooth.onrender.com/prompt-cost?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/trollbridge-prompt-cost-estimator-39201a50
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3JqhlHhvUysEOVyv4srKG

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability trollbridge-prompt-cost-estimator-39201a50
```

Example prompt: Estimate how many tokens this system prompt is and what it would cost across every model — just paste the text: 'You are a helpful assistant that answers questions about crypto security and DeFi protocols. Always be concise and cite sources when possible.'

## When to prefer this

Use this endpoint when you need a quick, cross-model cost comparison before committing to an LLM API call — especially useful for long prompts, budget-constrained agent pipelines, or when selecting the cheapest viable model for a given task. Prefer this over manually querying each model's pricing page when you want a unified, ranked view. Not suitable when you need exact token counts from the model's native tokenizer.

## Known failure modes

- Prompt text exceeds 50,000 character limit — request rejected
- Missing required 'text' query parameter — validation error
- Model substring provided but no matching model found — may return empty or full list
- Heuristic token estimate may diverge from actual tokenizer counts for models with unusual tokenization
- Service unavailable on Render free tier during cold start — slow or timeout response
- Payment not attached or insufficient USDC — 402 Payment Required

## How this service works

The insurance booth for AI agents, with Mini's Agent Supply Store on the side of the road. One hundred checkpoints: pre-transaction safety lanes (honeypot, approval-risk, rug-score, receipt-check, tx-dryrun, permit-scan, airdrop-verdict, deployer-history, wallet-watch, secret-scan at $0.02 USDC per call; the protection tier — /contract-check, /approval-screen, /tx-plain-english, /honeypot-check, /tx-simulate, /redteam, /skill-scan, /verdict, /egress-audit, /tool-gate, /airlock, /repo-scan, /prove, /task-scope — at $0.10; the one-call /shield don't-get-rugged screen at $0.25; the full /preflight bundle at $0.05), bounty intel (bounties, fresh, verdicts, deadlines, sweepstakes, opportunities) at $0.02 USDC per call, trader intel (/prices and /quant at $0.02; /enrich and /token-check at $0.05; /contract-check and /honeypot-check at $0.10; /sec-facts at $0.05), market intel (/markets and /search at $0.05; /grants at $0.02), DeFi intel (/yields and /new-pairs at $0.05; /gas and /defi at $0.02), AI intel (/models at $0.02), agent-ops intel (/prompt-cost, /model-picks, /rpc-speed, /terms-tldr, /scrape, /gigs, /retry-verify, /idempotency, /verify-independent at $0.02; /site-watch, /wallet-check, /code-run, /regulatory-pack, /sage, /cron-watch, /caveat-check, /tripwire, /escrow, /trust, /bridge-fees, /dao-votes, /dev-activity, /dex-arb, /dydx-perps, /funding-rates, /gas-predict, /hack-tracker, /long-short-ratio, /lp-yields, /mev-scan, /open-interest, /perp-basis, /polymarket-odds, /rwa-watch, /sentiment, /stablecoin-flows, /tokenomics, /top-movers, /whale-watch, and /yield-stable at $0.05; /approval-screen, /tx-plain-english, /tx-simulate, and /task-scope at $0.10; /scam-scan deep scan at $5.00 or 30-day subscription at $30.00), supply store (/road-pack combo meal at $0.05; curated datasets, the /audit-prep pre-audit review, and the /prove-state symbolic-execution run at $1.00; the /audit AI-agent audit at $25.00). Every lane answers before money moves — heuristic verdicts, not audits. Don't get rugged.

## Output

Returns estimated token count for the prompt (heuristic, not exact tokenizer), plus a list of models from the /models catalog sorted cheapest-first with estimated USD cost per call. If a model filter is supplied, returns cost only for that model.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "The prompt to estimate token cost for (max 50,000 chars)."
      },
      "model": {
       "type": "string",
       "description": "Optional model id (substring match) — cost for just that model."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lane": "/prompt-cost",
  "cheapest": {
   "id": "openai/gpt-4o-mini",
   "est_cost_usd": 0.0000042
  },
  "description": "Prompt cost estimator — paste a prompt, get a heuristic token estimate and what it would cost across every model in the /models catalog, cheapest first. Heuristic estimate, not an exact tokenizer count.",
  "estimated_tokens": 28
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/trollbridge-prompt-cost-estimator-39201a50/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mini-tollbooth.onrender.com](https://www.zero.xyz/host/mini-tollbooth.onrender.com/llms.txt)
