Skip to content

Overview

View as Markdown

ai-tally shows what your AI features cost, per feature and per customer. It also shows whether they pay for themselves.

An AI product is rarely a single prompt. One click from a user can call several models, a few tools, a vector search and an embedding. That happens for every one of your customers. Your AI provider’s bill shows one total, so it cannot tell you which feature or which customer drove the cost.

  • Every model call is recorded automatically. Calls made with the OpenAI, Anthropic, Gemini or Bedrock Python clients, or sent through the proxy, are recorded with their model, token counts and cost.
  • Cost is grouped by feature. You name the part of your product making each call.
  • Cost is split by customer. You attach your own customer id, which is hashed so it cannot be traced back.
  • Your prompts and answers stay with you. ai-tally keeps counts, names and hashed ids.
  • Unknown cost shows as a blank. When a cost cannot be known, you see a blank instead of a made-up $0.

To try it, create an account at app.ai-tally.com, then follow the Quickstart. It takes about five minutes.

For a Python app, install the SDK and put tally run -- in front of the command that starts your app. Your code stays exactly as it is. tally run is a preview.

Terminal window
pip install ai-tally
tally run -- uvicorn main:app

Or add one line to your app instead, and your OpenAI client stays exactly as it is:

# pip install ai-tally
import os
import aitally
from openai import OpenAI
aitally.init(os.environ["TALLY_KEY"])
client = OpenAI() # unchanged: every call through this client is now tracked

Either way, your calls show up in ai-tally with their cost. See Python SDK. Apps in any language can also use the proxy, which only means changing one base URL, or send the OpenTelemetry traces you already collect.

A customer is whoever you want to see cost for: a company on your paid plan, a workspace, or a single user.

with aitally.with_account("acct_northwind"):
client.chat.completions.create(model="gpt-4o-mini", messages=messages)

Every call inside the block counts toward that customer. The id is hashed inside your app before anything is sent.

A feature is a part of your product that uses AI, like a support chat or a summary button.

with aitally.start_trace(feature_tag="support-chat"):
client.chat.completions.create(model="gpt-4o-mini", messages=messages)

Calls inside the block count toward that feature, and the dashboard adds up cost per feature.

AI features also pay for things that are not model calls, like vector database searches or paid APIs. You can record those too:

aitally.record_vector_call(provider="pinecone", index="docs", operation="query", cost_micro_usd=250)

Costs are in whole micro-dollars, so 250 is $0.00025.