Skip to content
HALOWERK

Denkwerk

trace cost breakdown

Takes the steps of one agent run (model, input, cached and output tokens, latency, tool) and the price list in USD per million tokens supplied by the caller (no stale built-in prices) and returns cost per step, totals, cost and time share per model and tool, the five most expensive and slowest steps, and steps whose model has no price. Cached input tokens are billed at the separately supplied cached price when given.

POST https://denk.halowerk.com/v1/trace-cost-breakdown

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
stepsarrayYes
pricesobjectYesUSD per 1M tokens per model.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "steps",
    "prices"
  ],
  "properties": {
    "steps": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "model": {
            "type": "string",
            "maxLength": 100
          },
          "tool": {
            "type": "string",
            "maxLength": 100
          },
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "cached_input_tokens": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          },
          "latency_ms": {
            "type": "number",
            "minimum": 0,
            "default": 0
          },
          "extra_cost_usd": {
            "type": "number",
            "minimum": 0,
            "default": 0
          }
        }
      }
    },
    "prices": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "input",
          "output"
        ],
        "properties": {
          "input": {
            "type": "number",
            "minimum": 0
          },
          "output": {
            "type": "number",
            "minimum": 0
          },
          "cached_input": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "description": "USD per 1M tokens per model."
    }
  }
}

Open original schema

Published input example

{
  "prices": {
    "model-a": {
      "input": 3,
      "output": 15,
      "cached_input": 0.3
    }
  },
  "steps": [
    {
      "name": "plan",
      "model": "model-a",
      "input_tokens": 12000,
      "output_tokens": 800,
      "latency_ms": 2100
    },
    {
      "name": "search",
      "model": "model-a",
      "tool": "web_search",
      "input_tokens": 30000,
      "cached_input_tokens": 10000,
      "output_tokens": 500,
      "latency_ms": 4300,
      "extra_cost_usd": 0.003
    }
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’