Resource Cost Estimator
devops.compute_resource_cost
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
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
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| resources | array | Yes | Bounded array of resource quantity declarations. The item shape is defined by the nested schema and the array contains from 1 through 10000 items. |
| priceTable | array | Yes | Bounded 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. |
| options | object | No | Purpose-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
| Field | Type | Required | Description |
|---|---|---|---|
| currency | string | Yes | ISO currency code from the price table. |
| period | string | Yes | Applied cost-period label. |
| total | string | Yes | Exact decimal total serialized as a string. |
| lines | array | Yes | Bounded cost-line receipts in input order. The item shape is defined by the nested schema and the array contains from 0 through 100000 items. |
| byResource | array | Yes | Bounded resource-key subtotal receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items. |
| findings | array | Yes | Bounded array of safe structured DevOps findings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items. |
| _meta | object | Yes | Closed cost-calculation metadata receipt. Its documented receipt properties are bounded to 256 entries — unconstrained RFC 8259 JSON items. |
API contract
POST /v1/executecurl -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"}]}}'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
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| COST_CURRENCY_MIXED | 400 | No | The request payload failed this skill's input validation. |
| COST_QUANTITY_INVALID | 400 | No | The request payload failed this skill's input validation. |
| COST_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| COST_PRICE_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 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)
{
"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
{
"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"
}
}{
"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
{
"priceTable": [
{
"sku": "cpu-hour",
"unitPrice": "0.01",
"per": "hour",
"currency": "USD"
}
],
"resources": [
{
"sku": "unknown-sku",
"quantity": "1",
"id": "db"
}
]
}{
"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"
}Recommended use cases
- 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
Related skills
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.