Azure AI Engineer · AI-103
CostTotal cost of ownership

What does an agent cost to run?

What the claims agent does, why only part of it needs an agentic loop, and an itemised daily bill from users and turns down to tokens, search, hosting and people. Change any input; every line recalculates.

The example: a claims assistant over 18,000 policy PDFs with an MCP server for claims data; 2,000 conversations a day, 6 turns each. Compare two designs: All-agent sends every turn to the agent. Hybrid sorts each turn first: fixed flows (claim status, forms, payouts) use no model, policy questions go to a RAG workflow, and only mixed, multi-step questions reach the agent. Prices are USD list prices for Global Standard; lines marked est. are estimates. Check your region in the Azure pricing calculator before budgeting.

1 · What the agent does

Contoso's customers contact the claims assistant through the support web app. Every message is sorted first, then handled by the cheapest path that can do the job safely. Only one path is an agent.

"No model" means no model writes the answer. Recognising the request can need a small model: "any news on my roof thing?" won't match a pattern, so the sorting step may use gpt-5-nano to label it status. That model can only pick a label from a fixed list. After that, code does everything: it finds the claim from the signed-in session, reads the claims system, and fills a reply template. A model may recognise the request; code decides and answers. A wrong label costs a re-route; a made-up claim fact would cost trust.
Customermessage Sorting steprules or gpt-5-nano Fixed flowsstatus · forms · payoutsno model decides RAG workflowsearch policies → answerwith citations Agent loopplan → call tool → observe→ repeat (max 8 steps)or hand off to a person 45% 35% 20% Replyto the customer Adjusterapproves payouts
Every message is sorted first. Fixed flows and the RAG workflow handle about 80% of turns; only mixed, multi-step questions reach the agent loop. Payouts always go through a fixed flow and an adjuster, never through the agent alone.
PathA customer says…What happensTools and model
Fixed flow: status"Where's my claim?"The customer is already signed in, so the flow calls get_claim and fills a reply template: stage, next step, expected date.get_claim + a reply template; no model writes the answer
Fixed flow: missing details"Here are the photos and the plumber's invoice."A form checks which required fields and documents are still missing and asks only for those. A small model pulls dates and amounts out of free text.list_documents; gpt-5-nano for extraction
Fixed flow: payout"Can you pay the €640 for the plumber?"Rules check eligibility and the amount against the policy limit, then create a payout request that an adjuster approves in Teams.issue_payout behind human approval; rules decide, no model
RAG workflow"Am I covered if a pipe bursts while I'm on holiday?"Search the policy wording (hybrid search plus semantic ranker), answer only from the retrieved clauses, and cite them.AI Search; gpt-5-mini
Agent loop"Why did you only pay part of my roof claim, and what do I need to send to get the rest?"The next step depends on what each step finds; see the trace below.get_claim, list_documents, policy search, hand-off; gpt-5-mini (gpt-5 if evaluations demand)

2 · How the sorting step decides

The sorting step (also called an intent router or triage step) is a small piece of your application code that labels each customer message and sends it to a path. It isn't Foundry's model router: that picks which model answers; this picks which path handles the message. It tries the cheapest signal first, and the first confident layer wins.

Layer 1 · Signals, no model

  • Show it before they ask: a signed-in customer with an open claim sees a status card first, so most "where is my claim" questions are never typed.
  • Buttons: "Check my claim", "Upload documents", "Talk to someone" route directly.
  • State: a form half filled → the next message continues the form; a payout awaiting approval → status questions go to the status flow.
  • Patterns: a claim number plus "where" or "status" → status flow; "human", "complaint" → a person.

Layer 2 · A small model labels it

Only when Layer 1 can't decide. gpt-5-nano reads the message and the last few turns, with 2–3 examples per label, and must return a label from a fixed list (structured outputs):

{ "route": "status | provide_details | payout |
           policy_question | complex | human | out_of_scope",
  "confidence": 0.0-1.0,
  "multiple_intents": true | false }
Layer 3 · When it's unsureRouteWhy
Confidence below about 0.7Agent, or one clarifying questionBetter to over-serve than answer the wrong question
Several questions in one messageAgentMixed questions are exactly its job
Asks for a person, angry, or complainingHuman hand-offNever trap a customer in automation
Off-topicPolite fixed replyDon't spend tokens
Medium confidence on a fixed-flow routeConfirm with buttons: "Do you want the status of claim CL-88213?"One tap turns the model's guess into a deterministic step
Example messageDecided byRoute
Taps "Check my claim"Layer 1: buttonFixed flow: status
"CL-88213 where is it now?"Layer 1: patternFixed flow: status
"Here's the plumber's invoice" (form in progress)Layer 1: stateFixed flow: details
"Am I covered if a pipe bursts while I'm away?"Layer 2: policy_question, 0.93RAG workflow
"Why did you only pay part of my roof claim, and what do I send?"Layer 2: complex, multiple intentsAgent loop
"This is the third time I've asked. I want to complain."Layer 1: patternHuman hand-off
Mistakes don't cost the same. A simple question sent to the agent is answered correctly at a few cents more. A complex question sent to a fixed flow gets a canned reply that misses the point: a frustrated customer, a call, maybe a complaint. So when unsure, lean toward the agent, and give every path a way back: a fixed flow escalates to the agent when the customer says "that's not what I asked", and the RAG workflow escalates when no retrieved passage scores as relevant.

Prove it before launch: label about 500 real messages with the right route, measure accuracy per route and which routes get confused, and watch the expensive mistake above all. After launch, sample routed messages weekly; phrasing shifts, for example during a storm.

Where it runs: your application code (a few lines calling gpt-5-nano), or the first branching node of an Agent Framework workflow. Fixed flows are ordinary code; the agent is a Foundry prompt agent.

3 · How it helps the business

WhoBeforeWith the assistantMeasure it with
CustomersPhone queues of 20+ minutes during storms; office hours onlyAnswers at any hour, in their language, with the policy clause quotedSatisfaction score, time to first answer
Contact centreFive times the calls during storms; temporary staff hired at short noticeStatus and policy questions resolved without a person; peaks absorbed without hiringCalls avoided, share resolved without a person
Claims handlersDays of emails chasing missing documentsMissing details collected at the first contact; claims arrive completeTime from first report to a handler's decision
AdjustersLook-ups and explanations take time from decisionsTheir time goes to approvals and real edge casesApprovals per adjuster per day
ComplianceExplanations vary by agent and aren't recordedEvery coverage answer cites the clause and is tracedComplaints about wrong answers, audit sample pass rate
FinanceCost per call from the contact centreA few cents per conversation; see the calculatorTotal cost per resolved conversation
Be honest about where the value comes from: storm-peak capacity, calls avoided and cited answers come mostly from the fixed flows and the RAG workflow. The agent loop adds value for the complex 20%: questions that today need a handler to piece together the claim, the documents and the policy. Those are also the calls that take longest and generate complaints, which is why it's worth doing well.

4 · Why the agentic loop is a must here, and only here

The question: "Why did you only pay part of my roof claim, and what do I need to send to get the rest?" Here's what the agent does, step by step.

  1. get_claim(CL-88213) → roof claim, €2,400 claimed, €900 paid. Exclusion code WR-3 applied to the rest. The agent now knows which clause matters, which it couldn't know before this call.
  2. Search policies for clause WR-3 → "Gradual deterioration and wear and tear are excluded, unless the damage was caused by a single sudden event, such as a storm, evidenced at the time." Now it knows what evidence would change the outcome.
  3. list_documents(CL-88213) → three photos (no dates in their data) and a roofer's quote that says "old flashing". No storm report, no dated photos. Now it knows exactly what's missing.
  4. Decide: the gap is evidence of a sudden event. The quote's wording supports the exclusion, so the agent mustn't promise anything. It explains clause WR-3 in plain words, quotes it, and asks for dated photos from the storm night or a roofer's statement that the damage was storm-related. It offers to hand the claim to a handler.

A different customer asking the same question would take a different path: a payout cap instead of an exclusion (search the limits clause, no documents needed), or a document already uploaded but unread (no request, hand straight to a handler). The steps can't be written down in advance, because each one depends on what the last one returned.

Test (deterministic first)Status questionPolicy question"Why partial, what do I send?"
Can you write the steps down in advance?Yes → fixed flowYes: search, then answer → workflowNo: they depend on the claim
Does the next tool depend on the last result?NoNoYes: exclusion code → which clause → which evidence
Is the number of steps known?Yes (1)Yes (2)No: 2 to 6 depending on the case
Would coding every path be practical?YesYesNo: about 40 exclusion codes × claim states × document states
Is the cost of a wrong step bounded?——Yes: read-only tools; payouts need an adjuster; max 8 steps; hand-off available
VerdictFixed flowRAG workflowAgent loop
The rule, from CCA-F: use a loop only when the path is decided by the data, the paths are too many to code, and a wrong step is cheap or caught. All three hold for the "why partial" question and for none of the others. The safeguards make the third one true: the agent's tools are read-only, payouts go through a fixed flow and an adjuster, there's a step limit, guardrails check tool results for hidden instructions, and the agent can always hand off to a person.

5 · Cost calculator

Design
Traffic
Hybrid: where turns go (%)

Agent path
Retrieval
Hosting and operations ($/day)
People (not on the Azure bill)
Business value (your assumptions)
#Line itemHow it's worked out$/day

Business value per day

LineHow it's worked out$/day

Value is an illustration from your assumptions, not an industry benchmark. Measure the real numbers: resolution without a person, calls avoided, time to a handler's decision, and complaints about wrong answers.

One-time costs

ItemHow it's worked out$

What moves the total

If you…Change per day

Reading the bill

Most of this app isn't an agent

Claim status, forms and payouts are fixed flows; policy questions are a RAG workflow. Only mixed, multi-step questions, where the next step depends on what the last one found, need an agent. Hybrid cuts model cost and keeps money decisions away from a model. It also makes a stronger model affordable where it matters: with the agent on 20% of turns, moving it to gpt-5 costs far less than in the all-agent design.

At this volume, the model isn't the biggest cost

Fixed platform costs (Search, hosting, endpoints) are a large share of the Azure bill. Set conversations to 20,000 and the model takes over: fixed costs barely move.

Output and reasoning tokens dominate the model cost

There are far fewer of them than input tokens, yet they cost more. Lower reasoning_effort and ask for short answers before trimming input.

Most of the value comes from the simple paths

Storm-peak capacity, calls avoided and consistent cited answers come mainly from fixed flows and RAG. The agent adds value for the complex minority, and carries the most risk, so keep it narrow and evaluated.

What's checked and what's estimated

ItemStatusSource
gpt-5-mini: $0.25 input, $0.025 cached, $2.00 output per million tokensChecked 8 Oct 2026azurespeed
Other model prices in the listList prices as last known; check before useAzure OpenAI pricing
AI Search S1 $245 per search unit per monthCheckedSearch cost playbook
Semantic ranker: first 1,000 queries a month free, then $1 per 1,000CheckedMicrosoft Learn
Standard agent setup: Cosmos DB at 3,000 RU/s minimum if provisioned, or serverlessCheckedMicrosoft Learn
No separate charge for the prompt-agent runtime; guardrails included with the modelBelieved true; verifyFoundry pricing page
Layout extraction $10 per 1,000 pages; trace data $2.30 per GB; private endpoint ~$0.24 a dayApproximate list pricesAzure pricing pages
Traffic split, resolution rate, call costYour assumptionsMeasure in a pilot

Related: Choose the right model has the ranked cost levers and the prompt-caching comparison.