# WritersLogic Metered Price Calculator

> WritersLogic Metered Price Calculator is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

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.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/metered-price?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-metered-price-calculator-817e20d4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qv1t_jeowE4A541Y6sQVE

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 writerslogic-metered-price-calculator-817e20d4 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
   ],
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-metered-price-calculator-817e20d4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
