Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

agentcap

Cost guardrails for LLM agent runs.

agentsanthropiccost-controlgeminillmopenai
Published3 Mar 2026
Direct dependencies0
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

agentcap

agentcap is a cost guardrail for LLM agent runs. It calculates safe token limits before execution and enforces strict budget ceilings using real usage data.


Github: https://github.com/OliverIida/agentcap

PyPI: https://pypi.org/project/agentcap/


Install

pip install agentcap

Example usage

from agentcap import AgentCap

prompt = "Write 2 lines about Tallinn."

cap = AgentCap(
    model="gpt-5",
    budget_usd=0.05,
)

plan = cap.plan(prompt_text=prompt)

# Pass plan.max_output_tokens into your LLM call

actual_cost = cap.finalize(
    prompt_tokens=response_prompt_tokens,
    output_tokens=response_output_tokens,
)

print("Actual cost (USD):", actual_cost)

Documentation

https://github.com/OliverIida/agentcap/blob/main/DOCUMENTATION.md


Supported models

https://github.com/OliverIida/agentcap/blob/main/agentcap/models.json To add more models, open a PR.

Note: Prices may change. Please verify with the provider.


Model pricing sources

OpenAI pricing: https://developers.openai.com/api/docs/pricing?latest-pricing=standard
Anthropic pricing: https://platform.claude.com/docs/en/about-claude/pricing
Gemini pricing: https://ai.google.dev/gemini-api/docs/pricing#standard

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

2 collected
agentcap-0.1.1-py3-none-any.whl

bdist_wheel · 7.67 KB · Python py3

Source file
agentcap-0.1.1.tar.gz

sdist · 4.43 KB · Python source

Source file

Repository

PENDING
oliveriida/agentcap

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:36 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:b267bb757bd1709ed573124ea11215d5591bf4ef2cacb2be540a02d229b2d3b2

Other collected versions

View all collected versions →