AI Agent Infrastructure
Cost per task
Shows how to calculate cost per task from billing tags and completed-run counts for each task type, and why failed runs must stay in the spend figure.
What you will be able to do
- Calculate cost per completed task from a billing breakdown and a run log.
- Explain why failed runs belong in the spend figure.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in AI Agent Infrastructure
- Concurrency limitsAdvanced · 5 min
Explains how concurrency caps and provider rate limits differ, and how a client should react to 429 responses with retry-after and backoff rather than more retries.
- Token budgetsAdvanced · 4 min
Explains why token budgets must be enforced in code, how input and output tokens differ, and how to find the tasks that use the most tokens.
- Context window managementAdvanced · 4 min
Explains what counts toward the context window, why more space does not fix missed details, and how to measure and trim input before each call.
- Retrieval permissionsAdvanced · 4 min
Shows how a retrieval step filters results by user identity before any passage reaches the model, and why prompt rules are not an access control.
- Vector index freshnessAdvanced · 5 min
Explains how pull indexers, schedules and change detection set the delay between a source change and a searchable update, and how to measure that delay.
- Memory consentAdvanced · 5 min
Explains what a valid consent record must hold for an assistant's memory, how withdrawal must reach derived copies, and what to check in the data stores.