{"uid":"cap_qv1t_jeowE4A541Y6sQVE","slug":"writerslogic-metered-price-calculator-817e20d4","name":"WritersLogic Metered Price Calculator","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/metered-price?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"per":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Units per billing package (default 1). Tiers are expressed in packages."},"mode":{"enum":["graduated","volume"],"type":"string"},"tiers":{"type":"array","items":{"type":"object","required":["unitPrice"],"properties":{"upTo":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Inclusive upper bound in billing units. Omit on the last tier for unlimited."},"flatFee":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Fee in major units charged with this tier."},"unitPrice":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Price per billing unit in major units; sub-cent precision allowed."}},"additionalProperties":false},"maxItems":50,"minItems":1},"minimum":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Minimum charge in major units, applied after the tiers."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"ISO 4217 alphabetic code, upper case."},"exponent":{"type":"integer","maximum":8,"minimum":0},"included":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Free quantity subtracted before packaging and tiers (never below zero)."},"quantity":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"rounding":{"enum":["half-up","half-down","half-even","up","down","ceiling","floor"],"type":"string","description":"Final rounding to the minor unit. Default half-up. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity."},"packageRounding":{"enum":["up","down","none"],"type":"string","description":"How a partial package is billed when per > 1. Default up."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OSH_az45FaxhooukzkBou","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Prices a usage quantity against up to 50 graduated or volume tiers, applying included quantities, billing packages, flat fees, and minimum charges, then rounds to currency precision.","exampleAgentPrompt":"Calculate the metered price for 2500 units using graduated pricing with three tiers: first 1000 units at $0.01 each (up to 1000), next 500 at $0.008 each (up to 1500), then unlimited at $0.005 each — include 200 free units, use USD with half-up rounding, and apply a $1.00 minimum charge.","exampleUseCases":[{"title":"SaaS invoice verification for monthly bill","prompt":"I need to verify my API usage bill: I consumed 8,750 API calls this month, our plan includes 1,000 free calls, then it's graduated pricing — $0.02 per call up to 5,000, $0.015 per call up to 20,000, unlimited at $0.01. Can you compute what I should owe in USD with half-even rounding?"},{"title":"Volume pricing quote for sales proposal","prompt":"Can you quote the price for a customer who wants to buy 50,000 data records under our volume pricing model? Tiers are: up to 10,000 at $0.005 each, up to 100,000 at $0.003 each, unlimited at $0.002 each. Currency is USD, package size is 1, no included free units, minimum charge $5.00."},{"title":"Billing package simulation with per-unit rounding","prompt":"Price 1,375 SMS messages under graduated tiers — messages are billed in packages of 10, rounded up. Tiers: up to 100 packages at $0.08 flat fee plus $0.005 per package, unlimited packages at $0.003 per package. Currency EUR, exponent 2, rounding ceiling. What's the total charge?"}],"resultDescription":"Returns the computed total price rounded to the currency's minor unit, along with a breakdown of charges per tier (units consumed, unit price applied, flat fees) and the final minimum-charge-adjusted amount in the requested currency.","failureModes":["Quantity exceeds the last bounded tier — returns an error since unbounded last tier is required for overflow","Invalid tier ordering — upTo bounds must be strictly ascending or the request is rejected","Missing required unitPrice on any tier causes validation failure","Currency code not matching ISO 4217 three-letter uppercase format returns a 400 error","Negative or zero quantity may return a zero charge or validation error depending on configuration","Per-package rounding mode not one of the accepted enum values returns a validation error"],"whenToPreferThis":"Use this endpoint when an AI agent needs a deterministic, auditable metered price computation — especially for SaaS billing, usage-based pricing quotes, or invoice verification. It supports both graduated and volume models, sub-cent precision, included free quantities, billing packages, flat fees, and minimum charges in a single call. Prefer it over building custom billing logic when you need consistent, currency-aware rounding and tier validation without maintaining billing infrastructure.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:40:38.848Z","isFirstParty":false,"canonicalSlug":"writerslogic-metered-price-calculator-817e20d4"}