PromptisePromptise
PlatformSoonEnterprise
DocsGitHub
Talk to usGet started
Promptise - AI Framework LogoPromptise

The full-stack framework for agentic systems. Build with the framework. Run it on the platform. Launch it with our engineers.

pip install promptise

[01] Product

  • Framework
  • Platform (coming soon)
  • Enterprise
  • How it works
  • Contact

[02] Framework

  • The Agent
  • The Interface
  • The Harness

[03] Resources

  • Documentation
  • GitHub
  • Why Promptise
  • Use cases
  • Roadmap
  • Guides
  • Learning Paths
  • Questions

[04] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

hello@promptise.com
← Guides> Topic

Cost control and rate limits

An agent's cost is hard to predict because the model decides how many steps to take. A loop that should take three calls can take thirty, and a busy client can drive up spend for everyone. Cost control puts limits where the spending happens: on tokens and calls per run, on requests per client, and on how much context goes into each call.

These guides start with budgets that stop a run before it overspends. Rate limiting per client keeps one caller from using up shared capacity on your MCP servers. Semantic caching reuses earlier answers to similar questions, caching and circuit breakers on tool servers avoid paying for repeated or failing calls, and trimming the tool list cuts the tokens spent on tool descriptions in every request.

11
guides
10
Intermediate
1
Advanced
3 h
of reading
01

Start here

AI Agent Cost Control: Budgets That Stop Runaway Spend

How to control AI agent costs: per-run and daily budgets that refuse tool calls before they run, token caps, iteration limits, and what each one misses.

Intermediate · 18 minRead the guide →

Then read on, in this order

10 guides

  1. 02LLM Tool Rate Limiting: Per-Client Limits for MCP ServersRate limit LLM tool calls per client, tenant and tool on a Python MCP server: a real load test, the error the agent sees, and how to retry it.Intermediate · 14 minIntermediate · 14 min→
  2. 03LLM Semantic Cache and Model Fallback in PythonReduce LLM API costs with a semantic cache and survive provider outages with model fallback. Real hits, tokens and a simulated outage, in Python.Intermediate · 23 minIntermediate · 23 min→
  3. 04MCP Server Caching, Timeouts and Circuit Breakers in PythonKeep an MCP server fast when its API is flaky: caching, retries with backoff, timeouts, a circuit breaker and limits, with real before and after numbers.Intermediate · 23 minIntermediate · 23 min→
  4. 05Too Many MCP Tools? How to Fix LLM Tool Selection in PythonToo many MCP tools cost tokens and lead an LLM agent to the wrong one. Learn how semantic tool selection works, how to check it offline and how to tune it.Intermediate · 18 minIntermediate · 18 min→
  5. 06AI Agent Cost Tracking: Tokens and Cost per Run and UserTrack AI agent token usage and cost per model call, run, user and agent: price tables, cost ledgers, alerts and limits. Runnable code with real output.Intermediate · 16 minIntermediate · 16 min→
  6. 07AI Agent Stuck in a Loop? How to Detect and Stop ItWhy AI agents get stuck in loops and how to stop them: detect repeated tool calls, cap tool calls per run, and write tool results that end the loop.Intermediate · 18 minIntermediate · 18 min→
  7. 08Context Engineering for AI Agents: Context Window ManagementContext engineering for AI agents: decide what the model sees on each step, return less from tools, and keep long runs small without losing the question.Intermediate · 26 minIntermediate · 26 min→
  8. 09LLM Routing: When to Use a Small vs Large ModelLLM routing explained: rules, LLM routers, learned routers and cascades to send each request to the cheapest model that works. A real router misroute.Intermediate · 7 minIntermediate · 7 min→
  9. 10MCP vs CLI for AI Agents: Tokens, Security, When to Use EachMCP vs CLI tools for AI agents: where the tokens go, prompt caching, per-user security and when to use each or both, with runnable code and real output.Intermediate · 20 minIntermediate · 20 min→
  10. 11Prompt Compression: LLMLingua and Lost in the MiddlePrompt compression techniques compared: selection, LLMLingua, summaries. Fix lost in the middle with reordering. Real example: 15,900 tokens cut to 1,400.Advanced · 9 minAdvanced · 9 min→

Other topics

  • Building AI agents in Python
  • Models and providers
  • Tools and the Model Context Protocol (MCP)
  • Memory, context and RAG
  • Agent reasoning patterns
  • Multi-agent systems
  • Guardrails and security
  • Human approvals (human-in-the-loop)
  • Observability and debugging
  • Testing and evals
  • Runtime, triggers and deployment
  • Frameworks and comparisons
  • AI at work
  • AI for leaders
  • Enterprise AI agents

In the documentation

  • Budgetsdocs ↗
  • Semantic cachedocs ↗
  • Tool optimizationdocs ↗

Build it with Promptise Foundry.

The code in these guides runs on Promptise Foundry, an open-source Python framework for AI agents and MCP servers.

QuickstartAll guides