🪜

AI Agent Multi-Step Workflow Cost Calculator

Estimate per-run and monthly cost for multi-step AI agent workflows across major LLM providers and local GPU routes.

Workload

Prices are directional estimates in USD. Last updated: 2026-07-05. See notes.

Workflow steps

Edit model, tokens, and calls per run. Unused rows are ignored.

Estimated monthly workflow cost

Enter a workload to see the cost.

Step Model Input / run Output / run Calls Cost / run Monthly % of LLM cost
Subtotal (LLM calls) 100%
Retrieval / external
Tool calls / APIs
Human review
Total

Frequently asked questions

What counts as a 'step' in an AI agent workflow?

A step is any discrete LLM call inside a single end-to-end run. Classifying intent, rewriting a query, retrieving context, generating an answer, self-checking, and combining sub-agent outputs are all common steps. Each step has its own model, token budget, and number of calls per run.

Why do multi-step agents cost so much more than a single chat completion?

A production agent often chains 3–8 LLM calls per user request. Retrieval, planning, generation, and safety checks each consume input and output tokens. This calculator adds them up so you can see the real per-run and monthly cost.

Should I route cheap tasks to a smaller model?

Yes. Classification, routing, formatting, and safety checks usually work well on fast, cheap models such as GPT-4o mini, Claude 3 Haiku, or Gemini 1.5 Flash. Reserve larger models for reasoning, coding, and synthesis.

How do I include RAG or tool-call costs?

Use the Retrieval cost per run and Tool-call cost per run fields to capture embedding search, web search, API calls, or external service fees that are not priced as LLM tokens.

When is self-hosting cheaper than API calls?

Self-hosting wins at high volume if you can keep a GPU utilized and you are comfortable managing the stack. This calculator uses an effective per-token cost for a local RTX 4090 that includes power and hardware amortization; compare it to managed APIs at your expected scale.

Prices are directional estimates per 1M tokens in USD. Provider rates change frequently; confirm current pricing before budgeting. Local GPU cost is estimated based on RTX 4090 effective inference cost including power and amortization.

🤖 Use this tool in your agent

✓ Agent-ready code

Copy the snippet below into your agent, newsletter, or script. The tool page at hermesdispatch.dev/tools/agent-workflow-cost-calculator/ is the canonical contract: inputs, outputs, and formulas.

python
# Hermes Dispatch Tool — AI Agent Workflow Cost Calculator
# Source: https://hermesdispatch.dev/tools/agent-workflow-cost-calculator/
# Description: Estimate cost per workflow run for multi-step agents with LLM calls and tool usage.
# License: MIT (generated by hermesdispatch.dev)
#
# INSTALL:
#   1. Save this file as ~/.hermes/hermes-agent/tools/agent_workflow_cost_calculator.py
#   2. Restart Hermes or run /reset in a session
#   3. The tool auto-registers if Hermes uses auto-discovery of tools/*.py
#
# MANUAL REGISTRY (if auto-discovery is off):
#   from tools.agent_workflow_cost_calculator import register
#   register()

import json

DATA = {}

def _ok(result):
    return json.dumps({"success": True, "data": result}, indent=2)

def _err(message):
    return json.dumps({"success": False, "error": message}, indent=2)


TOOL_NAME = "agent_workflow_cost_calculator"
TOOLSET = "agents"

SCHEMA = {
  "type": "function",
  "function": {
    "name": "agent_workflow_cost_calculator",
    "description": "Estimate cost per workflow run for multi-step agents with LLM calls and tool usage.",
    "parameters": {
      "type": "object",
      "properties": {
        "runs_per_month": {
          "type": "integer",
          "description": "Number of workflow runs per month."
        },
        "llm_calls_per_run": {
          "type": "integer",
          "description": "Average LLM calls per workflow run."
        },
        "input_tokens_per_call": {
          "type": "integer",
          "description": "Average input tokens per LLM call."
        },
        "output_tokens_per_call": {
          "type": "integer",
          "description": "Average output tokens per LLM call."
        },
        "input_price_per_m": {
          "type": "number",
          "description": "Input token price per 1M tokens."
        },
        "output_price_per_m": {
          "type": "number",
          "description": "Output token price per 1M tokens."
        },
        "tool_cost_per_run": {
          "type": "number",
          "description": "External tool/API cost per run in USD."
        }
      },
      "required": [
        "runs_per_month",
        "llm_calls_per_run",
        "input_tokens_per_call",
        "output_tokens_per_call"
      ]
    }
  }
}

def _run(args):
    runs = int(args.get("runs_per_month", 0))
    calls = int(args.get("llm_calls_per_run", 1))
    input_tok = int(args.get("input_tokens_per_call", 0))
    output_tok = int(args.get("output_tokens_per_call", 0))
    in_price = float(args.get("input_price_per_m", 0.5))
    out_price = float(args.get("output_price_per_m", 1.5))
    tool_cost = float(args.get("tool_cost_per_run", 0))
    llm_cost_per_run = calls * ((input_tok / 1e6 * in_price) + (output_tok / 1e6 * out_price))
    total_monthly = runs * (llm_cost_per_run + tool_cost)
    return _ok({
        "llm_cost_per_run_usd": round(llm_cost_per_run, 4),
        "tool_cost_per_run_usd": round(tool_cost, 4),
        "total_cost_per_run_usd": round(llm_cost_per_run + tool_cost, 4),
        "monthly_cost_usd": round(total_monthly, 2),
        "annual_cost_usd": round(total_monthly * 12, 2)
    })

def HANDLER(args):
    try:
        return _run(args)
    except Exception as e:
        return _err(str(e))


def register():
    """Manual registry hook. Import and call this to register with Hermes."""
    try:
        from tools.registry import registry
        registry.register(
            name=TOOL_NAME,
            toolset=TOOLSET,
            schema=SCHEMA,
            handler=HANDLER,
        )
    except ImportError:
        print("Hermes registry not found; skipping manual registration.")

if __name__ == "__main__":
    # CLI smoke test
    print(HANDLER({}))

Want early access to the next locked tool? Subscribe to The Hermes Dispatch.

🚀 Get AI automation insights daily

15:00 MST. One-click unsubscribe.

Subscribe