Skip to main content

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

MicroSkills Reference

Resource Cost Estimator

devops.compute_resource_cost

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You pass a resource list and a price table you already trust; we multiply quantities, replicas, and hours with BigDecimal arithmetic and return line-item totals as decimal strings (never JSON numbers). Kubernetes quantities such as 512Mi or 500m use the same parser as devops.validate_kubernetes_yaml. We do not look up cloud prices or convert currencies. Do not use this when you need live pricing APIs or discount modelling.

Cost math done in floating point silently loses cents, and mixed currencies are worse. We keep every step in decimal strings you can audit, and every price comes from the table you send rather than any pricing feed of ours.

Reliability

Deterministic — the same resources, prices, and options always give the same figures, rounded per line at your declared scale and then summed, so retrying is safe. Treat the result as an estimate: it reflects the price table you supplied and your hoursPerMonth and replicas assumptions, with no taxes, discounts, committed-use rates, or currency conversion applied. A resource whose sku is missing from the table does not fail the call — it appears in findings[] as COST_SKU_UNPRICED and is left out of total, so check _meta.unpricedSkuCount before you trust the number. The typed failures all need an input fix rather than a retry. COST_CURRENCY_MIXED means the price table names more than one currency, so split the call one currency at a time. COST_QUANTITY_INVALID means a quantity could not be parsed as a decimal or a Kubernetes quantity such as 512Mi or 500m, so correct that value. COST_LIMIT_EXCEEDED means you sent more than 1,000 resources or more than 1,000 prices, so break the request into batches. COST_PRICE_INVALID means a unitPrice was not a valid decimal, or scale or rounding fell outside the accepted values, so fix the price table or options and call again.

Context footprint

One call yields total, per-line formulas, grouped totals, and unpriced SKU findings. A successful call costs 1 execution credit.

When to use it

When prices are known and you need a line-item projection with formulas.

When you need live cloud pricing, currency conversion, or discount modelling.

Scope

Note
Arithmetic projection of your resource list against a price table you supply.

Non-goals

  • Does not look up cloud prices
  • Does not model reserved, spot, or savings-plan discounts
  • Does not convert currencies
  • Does not claim billing accuracy

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysismath

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input256 KB

How we handle your data

Structured input
What this means

This skill only accepts structured technical values such as numbers, booleans, enums, timestamps, or identifiers. It does not process free-form text, files, or documents.

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
resourcesarrayYesBounded array of resource quantity declarations. The item shape is defined by the nested schema and the array contains from 1 through 10000 items.
priceTablearrayYesBounded array of price entries with resource key, unit price, currency, and period. The item shape is defined by the nested schema and the array contains from 1 through 100000 items.
optionsobjectNoPurpose-bound bounded cost-calculation options; omit it for exact unrounded totals. Its purpose-bound option properties are bounded to 128 entries — unconstrained RFC 8259 JSON items.

Output schema

FieldTypeRequiredDescription
currencystringYesISO currency code from the price table.
periodstringYesApplied cost-period label.
totalstringYesExact decimal total serialized as a string.
linesarrayYesBounded cost-line receipts in input order. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
byResourcearrayYesBounded resource-key subtotal receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
findingsarrayYesBounded array of safe structured DevOps findings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items.
_metaobjectYesClosed cost-calculation metadata receipt. Its documented receipt properties are bounded to 256 entries — unconstrained RFC 8259 JSON items.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"devops.compute_resource_cost","input":{"resources":[{"id":"a","sku":"cpu-hour","quantity":"1"}],"priceTable":[{"sku":"cpu-hour","unitPrice":"0.01","currency":"USD"}]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("devops.compute_resource_cost", {"resources":[{"id":"api","sku":"cpu-hour","quantity":"2","hoursPerMonth":730,"replicas":3,"unit":"vcpu"}],"priceTable":[{"sku":"cpu-hour","unitPrice":"0.031611","per":"vcpu-hour","currency":"EUR"}],"options":{"scale":2,"rounding":"HALF_UP"}});

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.
COST_CURRENCY_MIXED400NoThe request payload failed this skill's input validation.
COST_QUANTITY_INVALID400NoThe request payload failed this skill's input validation.
COST_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
COST_PRICE_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not look up cloud prices
  • Does not model reserved, spot, or savings-plan discounts
  • Does not convert currencies
  • Does not claim billing accuracy
  • Live cloud pricing or FX conversion
  • Invoice reconciliation against a cloud provider bill

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "devops.compute_resource_cost",
  "input": {
    "resources": [
      {
        "id": "api",
        "sku": "cpu-hour",
        "quantity": "2",
        "hoursPerMonth": 730,
        "replicas": 3,
        "unit": "vcpu"
      }
    ],
    "priceTable": [
      {
        "sku": "cpu-hour",
        "unitPrice": "0.031611",
        "per": "vcpu-hour",
        "currency": "EUR"
      }
    ],
    "options": {
      "scale": 2,
      "rounding": "HALF_UP"
    }
  }
}

Examples

Three-replica API priced monthly

Inputjson
{
  "resources": [
    {
      "id": "api",
      "sku": "cpu-hour",
      "quantity": "2",
      "hoursPerMonth": 730,
      "replicas": 3,
      "unit": "vcpu"
    }
  ],
  "priceTable": [
    {
      "sku": "cpu-hour",
      "unitPrice": "0.031611",
      "per": "vcpu-hour",
      "currency": "EUR"
    }
  ],
  "options": {
    "scale": 2,
    "rounding": "HALF_UP"
  }
}
Expected outputjson
{
  "findings": [],
  "_meta": {
    "unpricedSkuCount": 0,
    "scale": 2,
    "rounding": "HALF_UP"
  },
  "currency": "EUR",
  "lines": [
    {
      "id": "api",
      "replicas": 3,
      "sku": "cpu-hour",
      "hours": 730,
      "lineTotal": "138.46",
      "resolvedQuantity": "2",
      "unitPrice": "0.031611",
      "formula": "2 x 3 x 730 x 0.031611"
    }
  ],
  "byResource": [
    {
      "id": "api",
      "total": "138.46"
    }
  ],
  "total": "138.46",
  "period": "monthly"
}

Unpriced SKU surfaces a warning with zero total

Inputjson
{
  "priceTable": [
    {
      "sku": "cpu-hour",
      "unitPrice": "0.01",
      "per": "hour",
      "currency": "USD"
    }
  ],
  "resources": [
    {
      "sku": "unknown-sku",
      "quantity": "1",
      "id": "db"
    }
  ]
}
Expected outputjson
{
  "findings": [
    {
      "details": {
        "id": "db",
        "sku": "unknown-sku"
      },
      "path": "db",
      "code": "COST_SKU_UNPRICED",
      "message": "SKU 'unknown-sku' has no entry in the price table.",
      "severity": "warning"
    }
  ],
  "_meta": {
    "unpricedSkuCount": 1,
    "scale": 2,
    "rounding": "HALF_UP"
  },
  "currency": "USD",
  "lines": [],
  "byResource": [],
  "total": "0.00",
  "period": "monthly"
}
  • What-if cost from a known internal price sheet
  • Agreeing Kubernetes quantity meanings with devops.validate_kubernetes_yaml

Avoid for

  • Live cloud pricing or FX conversion
  • Invoice reconciliation against a cloud provider bill

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

analysiscostpricingfinops