Observed since 20 Oct, 21:33 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
LLM cost intelligence + budget enforcement for AI agent fleets
LLM cost intelligence + budget enforcement for AI agent fleets.
The Python SDK for AgentBills. Drop one line at the top of your agent and every OpenAI / Anthropic / Bedrock call reports a cost event to your dashboard.
pip install agentbills[all]
Provider-specific installs are available if you only use one:
pip install agentbills[openai] # only the OpenAI library
pip install agentbills[anthropic] # only the Anthropic library
pip install agentbills[bedrock] # only boto3 / Bedrock
from agentbills import instrument
instrument() # patches openai/anthropic/bedrock libs at import time
# nothing else changes — your existing client calls now report events
import openai
client = openai.OpenAI()
client.chat.completions.create(model="gpt-4o-mini", messages=[...])
Set AGENTBILLS_API_KEY in the environment and you're done:
export AGENTBILLS_API_KEY=blaze_sk_...
Or pass it explicitly: instrument(api_key="blaze_sk_...").
set_metadata() attaches a dict to every event generated in the current context (works across await boundaries):
from agentbills import set_metadata
set_metadata({"feature": "summarize", "user_id": "u123"})
response = openai_client.chat.completions.create(...)
# the event for this call carries feature=summarize, user_id=u123
To pin the agent name for a specific call instead of relying on fleet_name:
set_metadata({"agent_id": "researcher"})
If you'd rather not monkey-patch globally, wrap a specific client:
import openai
from agentbills import AgentBillsClient, wrap_openai_client
ab = AgentBillsClient(api_key="blaze_sk_...")
openai_client = wrap_openai_client(openai.OpenAI(), ab, agent_name="researcher")
from agentbills import Fleet
fleet = Fleet(api_key="blaze_sk_...")
@fleet.agent("researcher")
def run(query: str):
...
print(fleet.dashboard_url)
The SDK buffers events and flushes in batches. For short-lived scripts, flush explicitly:
client = instrument()
# ... your agent code ...
client.flush()
For long-running services this isn't necessary — the buffer flushes automatically on every batch_size events.
blaze-agents 0.1The old package was blaze-agents with imports like from blaze import …. v0.2 renames to agentbills and adds the instrument() entry point.
# OLD
from blaze import Fleet, BlazeClient
# NEW
from agentbills import Fleet, AgentBillsClient # BlazeClient is a back-compat alias
The from blaze import … path no longer works — update your imports.
MIT.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.0 | 23 May 2026 | 5 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:33 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e7c13e2d1e72259dc837d511d92ac67a72103cab2ef077a7570a93530a9dfb19