azure-cost-management-api

azure-cost-management-api is a skill for Claude Code, Codex from fabioc-aloha/Alex_Skill_Mall. It costs 23 tokens per session (567 once invoked), scanned A, original, MIT.

A focused guide to querying Azure Cost Management, the service that reports cloud spending, through PowerShell and the Azure CLI.

In plain words
What is it for?
Use it to build JSON request files and run cost queries such as monthly spending by resource group or resource.
Why use it?
It avoids request failures caused by PowerShell changing inline JSON, the structured text sent to the cost-reporting API.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build JSON request files and run cost queries such as monthly spending by resource group or resource.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fabioc-aloha/Alex_Skill_Mall --skill azure-cost-management-api
Clone the repo
git clone --depth 1 https://github.com/fabioc-aloha/Alex_Skill_Mall

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for azure-cost-management-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api/github.svg)](https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api)
Your own site
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for azure-cost-management-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/azure-cost-management-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.00567
Opus 5 $0.00012 $0.00283
Sonnet 5 $0.00005 $0.00113
Haiku 4.5 $0.00002 $0.00057

Measured 7d ago against content hash c18d1cae9926, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

azure-cost-management-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cloud-infrastructure/azure-cost-management-api/skills/azure-cost-management-api/SKILL.md · 100 lines

What it actually says

Azure Cost Management API

The Problem

In PowerShell, inline JSON for Cost Management API causes "Unsupported Media Type" errors:

# This fails silently or with 415 error
az rest --method POST --uri $uri --body '{"type":"Usage","timeframe":"MonthToDate"}'

The shell mangles the JSON.

The Solution

Write JSON to a file, then reference with @:

# 1. Create body file
$body = @{
    type = "Usage"
    timeframe = "MonthToDate"
    dataset = @{
        granularity = "Daily"
        aggregation = @{
            totalCost = @{
                name = "Cost"
                function = "Sum"
            }
        }
    }
} | ConvertTo-Json -Depth 10

$bodyFile = "$env:TEMP\cost-query-body.json"
$body | Out-File -FilePath $bodyFile -Encoding utf8

# 2. Call with file reference
$uri = "/subscriptions/$subscriptionId/providers/Microsoft.CostManagement/query?api-version=2023-03-01"
az rest --method POST --uri $uri --body "@$bodyFile"

Common Queries

Monthly Cost by Resource Group

{
  "type": "Usage",
  "timeframe": "MonthToDate",
  "dataset": {
    "granularity": "None",
    "aggregation": {
      "totalCost": { "name": "Cost", "function": "Sum" }
    },
    "grouping": [
      { "type": "Dimension", "name": "ResourceGroup" }
    ]
  }
}

Daily Cost Trend

{
  "type": "Usage",
  "timeframe": "MonthToDate",
  "dataset": {
    "granularity": "Daily",
    "aggregation": {
      "totalCost": { "name": "Cost", "function": "Sum" }
    }
  }
}

Verification

# Should return JSON with "rows" array
$result = az rest --method POST --uri $uri --body "@$bodyFile" | ConvertFrom-Json
$result.properties.rows | Format-Table

When to Apply

  • Any Azure Cost Management API call from PowerShell
  • Complex JSON bodies in az rest commands
  • Budget alerts and cost analysis scripts

Tags

azure cost-management api powershell

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 100 lines · 23 tokens per session scan A c18d1cae9926

Subscribe to this mod's changes

azure-cost-management-api is a skill published in the GitHub repository fabioc-aloha/Alex_Skill_Mall (4 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 567 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

apply-earnings-myopia-defense

Use when a company's investment decisions — R&D spending, long-term infrastructure, maintenance — are being evaluated against their effect on the next quarterly earnings report, before letting that pressure cut or delay a genuinely positive-long-term-value investment, because quarterly-earnings pressure is a…

jeffreytse/grimoire-core · 87 tokens

apply-deep-industry-immersion-research

Use when forming an investment thesis in a new or emerging technology trend — committing to extended, multi-year immersion in the industry before evaluating specific deals, rather than assessing opportunities opportunistically as they arrive.

jeffreytse/grimoire-core · 50 tokens

apply-double-down-portfolio-strategy

Use when managing a portfolio of early-stage investments — reserving significant capital for follow-on investment in the clearest-performing companies rather than spreading the initial investment evenly or holding follow-on capital back proportionally.

jeffreytse/grimoire-core · 48 tokens

apply-full-lifecycle-investing

Use when structuring a venture capital firm's investment mandate — building the capability to invest in a portfolio company across its entire lifecycle from seed through pre-IPO and beyond, rather than confining the firm to a single stage, so the strongest companies can be backed continuously without forcing a founder…

jeffreytse/grimoire-core · 78 tokens

apply-moonshot-technology-investing

Use when evaluating a technically ambitious, high-uncertainty breakthrough technology investment — accepting a much higher individual-investment failure rate than standard venture investing in exchange for the possibility of a genuinely transformative, category-defining outcome most investors wouldn't accept the…

jeffreytse/grimoire-core · 62 tokens

apply-non-consensus-category-conviction

Use when evaluating an investment in an unproven category or business model that the prevailing market consensus actively doubts or dismisses — betting on the category and founder ahead of any price or market validation signal, based on independently-formed conviction rather than following consensus.

jeffreytse/grimoire-core · 61 tokens