Proration compute

proration-compute · version 1.0.0 · Money & pricing · free, no key needed

Prorate an amount by used days over period days (counts or ISO dates) into prorated and remaining parts that add up.

Use when you need to: prorate a monthly fee for 12 days of 30 · how much is the unused part of a subscription worth · partial month rent from March 10 to March 31.

Decide before calling

Read the versioned contract and the supported scope below. Reuse proration-compute@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use proration-compute@1.0.0 for prorate a monthly fee for 12 days of 30. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "amount": "30.00",
  "used_days": 12,
  "period_days": 30,
  "currency": "USD",
  "rounding": "half_even"
}

Response:

{
  "result": {
    "prorated_amount": "12.00",
    "remaining_amount": "18.00",
    "used_days": 12,
    "period_days": 30,
    "fraction": {
      "numerator": 2,
      "denominator": 5
    },
    "exact": true,
    "currency": "USD",
    "scale": 2,
    "data_version": "iso4217-datasets-7cdc784-2026-07-27"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "proration-compute",
  "version": "1.0.0",
  "input": {
    "amount": "30.00",
    "used_days": 12,
    "period_days": 30,
    "currency": "USD",
    "rounding": "half_even"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/proration-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"amount":"30.00","used_days":12,"period_days":30,"currency":"USD","rounding":"half_even"}'

The machine-readable contract is at /v1/tools/proration-compute/versions/1.0.0.

CLI

node cli.mjs run proration-compute 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.