Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Calculate Tiered Fee

finance.tiered_fee

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

Apply a progressive or cliff tier schedule to one non-negative decimal base with deterministic ordered segment receipts and no hidden rounding or inferred boundaries.

We provide reproducible fee segmentation rather than prompt arithmetic.

Reliability

FEE_INPUT_INVALID and ITEM_LIMIT_EXCEEDED identify exact repair classes.

Context footprint

One call returns the total and compact segment proof. A successful call costs 1 execution credit.

When to use it

Use this when you have one complete explicit tier schedule.

Avoid this when schedule terms are missing.

Scope

Note
Apply one explicit bounded progressive or cliff fee schedule and return the ordered segment audit receipt without currency conversion, rounding, or schedule inference.

Non-goals

  • Does not infer or persist fee schedules.
  • Does not round currency amounts.

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

math

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
basestringYesNon-negative plain decimal base the schedule is applied to.
tiersarrayYesOrdered 1 through 100 closed tier objects {upTo?,rate}; only the final upTo may be omitted.
tierModestringYesWhether each band is charged progressively or the whole base uses the selected cliff tier.

Output schema

FieldTypeRequiredDescription
feeAmountstringYesNormalized plain-decimal sum of every ordered segment fee without implicit rounding.
segmentsarrayYesOrdered array of closed segment objects {from,to?,rate,appliedBase,fee}; to is omitted only for the open final tier.
tierModestringYesSelected tier mode repeated in the receipt so fee segmentation remains independently auditable.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"finance.tiered_fee","input":{"base":"150","tiers":[{"upTo":"100","rate":"0.01"},{"rate":"0.02"}],"tierMode":"PROGRESSIVE"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("finance.tiered_fee", {"base":"150","tierMode":"PROGRESSIVE","tiers":[{"upTo":"100","rate":"0.01"},{"rate":"0.02"}]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
FEE_INPUT_INVALID400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not infer or persist fee schedules.
  • Does not round currency amounts.
  • Unbounded or implicit schedules.

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "finance.tiered_fee",
  "input": {
    "base": "150",
    "tierMode": "PROGRESSIVE",
    "tiers": [
      {
        "upTo": "100",
        "rate": "0.01"
      },
      {
        "rate": "0.02"
      }
    ]
  }
}

Examples

Progressive management fee

Inputjson
{
  "base": "150",
  "tierMode": "PROGRESSIVE",
  "tiers": [
    {
      "upTo": "100",
      "rate": "0.01"
    },
    {
      "rate": "0.02"
    }
  ]
}
Expected outputjson
{
  "tierMode": "PROGRESSIVE",
  "feeAmount": "2",
  "segments": [
    {
      "from": "0",
      "to": "100",
      "rate": "0.01",
      "appliedBase": "100",
      "fee": "1"
    },
    {
      "from": "100",
      "rate": "0.02",
      "appliedBase": "50",
      "fee": "1"
    }
  ]
}
Tip
100 at one percent and 50 at two percent.

Cliff management fee

Inputjson
{
  "base": "150",
  "tierMode": "CLIFF",
  "tiers": [
    {
      "upTo": "100",
      "rate": "0.01"
    },
    {
      "rate": "0.02"
    }
  ]
}
Expected outputjson
{
  "tierMode": "CLIFF",
  "feeAmount": "3",
  "segments": [
    {
      "from": "0",
      "to": "100",
      "rate": "0.01",
      "appliedBase": "0",
      "fee": "0"
    },
    {
      "from": "100",
      "rate": "0.02",
      "appliedBase": "150",
      "fee": "3"
    }
  ]
}
Tip
Whole base uses selected tier.
  • Management-fee schedule evaluation.
  • Independent tier receipt verification.

Avoid for

  • Unbounded or implicit schedules.

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

feemathfinance