Key facts
| Billing unit | Cost per completed task, not per model call |
| Agent loop | Planning, tool calls, retrieval and synthesis multiply model invocations |
| Memory and RAG | Retrieved context and stored history are resent on each step |
| Retries | Tool failures and 429 backoff repeat work inside a task |
| Evals | Evaluation runs add a standing cost that is easy to forget |
| Flat-rate fit | Self-serve Plugsky plans are flat monthly with unlimited fair-use usage and no per-token billing |
| Free plan | 2 free models (plugsky-micro and plugsky-lite), no card required |
| Product status | Chat, function calling, embeddings, RAG and agents are live |
TL;DR
- Budget per completed task — agent loops make per-call pricing deceptive.
- Instrument calls, tokens and retries for every step in the loop.
- Route planning to a strong model and routine steps to smaller ones.
- Cap loop iterations and tool retries before they become budget leaks.
- Flat-rate plans absorb extra loop iterations without marginal token cost.
How it works, step by step
- Define what counts as a completed task and instrument it end to end.
- Log model calls, tokens and retries per task, per agent and per tenant.
- Measure average calls and tokens per task across at least two weeks of traffic.
- Multiply by monthly task volume and apply current rates for each model used.
- Add memory storage, retrieval and standing evaluation-run costs.
- Set per-task and per-tenant budget alerts, plus a hard loop-iteration ceiling.
- Review weekly during rollout, then monthly once the distribution stabilises.
Try it yourself
Open the AI agent cost calculator →
Why agents break naive cost models
A chat request is one call. An agent task is a loop: plan, call a tool, observe, retrieve, re-plan, synthesise. Each iteration resends context, so input tokens grow with step count, and failures trigger retries that repeat the expensive parts. A task that looked like one call in the demo can be a dozen in production.
The only reliable unit is the completed task. Instrument it end to end and attribute every model call, token and retry to the task that caused it.
The agent budget formula
Use measured numbers from your own traces:
- Average model calls per task = total calls / completed tasks.
- Average tokens per call, split by model tier and input versus output.
- Cost per task = sum over models of (tokens x live rate) plus retry overhead.
- Monthly variable cost = cost per task x monthly tasks.
- Add fixed costs: memory storage, vector database, evaluation runs, monitoring.
The agent cost calculator structures that arithmetic. If cost per task is stable and volume is growing, a flat plan with unlimited fair use removes the per-token variable entirely.
Where agent budgets leak
- Unbounded loops. An agent that cannot decide repeats steps until a timeout; cap iterations in code.
- Frontier models everywhere. Planning benefits from a strong model, but formatting and extraction usually do not.
- Context accumulation. Full history on every step grows input tokens quadratically across a task.
- Tool retries. A flaky API turns one step into five, each resending the same context.
- Continuous evals. Nightly evaluation suites are valuable but belong in the budget.
- Per-tenant overuse. Without per-tenant caps, one customer can consume the margin of several.
Choosing a pricing model for agents
Agents are the workload where flat-rate pricing is easiest to justify: the number of internal calls is an implementation detail, not something a product team wants to expose to finance. With unlimited fair-use usage, extra loop iterations cost nothing at the margin, so engineering optimises for quality and latency rather than shaving tokens.
On per-token plans, the same architecture makes forecasting harder because a prompt or tool change can shift cost per task without any change in user-visible volume. Either way, track cost per task and set alerts so a runaway agent is caught by monitoring, not by an invoice.
Honest comparison
| Budget factor | Plugsky flat-rate | Per-token agent API | Self-hosted agents |
|---|---|---|---|
| Billing unit | Flat monthly plan | Tokens across every loop step | GPU hours plus ops |
| Loop iterations | No marginal token charge on self-serve | Each iteration adds cost | Consumes GPU time |
| Retries | Consume rate-limit budget only | Billed when they reach the model | Consumes GPU time |
| Forecasting | Fixed plan plus task volume | Sensitive to prompt and tool changes | Capex plus utilisation |
| Tool ecosystem | OpenAI-compatible function calling | Provider-specific tool formats | Build your own runtime |
| Observability | Usage analytics per key and project | Varies by provider | You build tracing |
Frequently asked questions
Why is cost per task better than cost per call for agents?
Because one task spans many calls: planning, tools, retrieval and synthesis. Per-call metrics hide the loop. Cost per completed task is what finance can compare against revenue or user value.
How do I stop an agent from overspending?
Cap loop iterations and tool retries in code, route routine steps to smaller models, trim context between steps, and set per-task and per-tenant alerts so anomalies surface during monitoring.
Do retries matter for agent budgets?
Yes. A failed tool call that triggers re-planning repeats expensive model work. On per-token plans those retries are billed; on Plugsky self-serve plans they consume rate-limit budget instead.
Is flat-rate pricing good for agents?
Often yes, because agent loops make call counts unpredictable. A flat plan with unlimited fair-use usage keeps cost fixed while engineering focuses on task success rate rather than token shaving.
What fixed costs should an agent budget include?
Memory and vector storage, evaluation runs, tracing and monitoring, and the engineering time to maintain prompts and tools. Add them to variable cost before comparing with a flat plan.
How much does Plugsky cost for agents?
Self-serve plans are flat monthly with unlimited fair-use usage and no per-token billing. Check the live pricing page for current plans; the free plan covers prototyping with two models.
Should every agent step use the same model?
No. Use a stronger model for planning and hard reasoning, and smaller models for classification, extraction and formatting. Mixed tiers cut cost per task without hurting outcomes.
How do I prove an agent budget to finance?
Report cost per completed task, task success rate and monthly fixed costs. That framing ties spend to delivered work instead of raw token consumption, which is easier to approve.