AI Cost
ANTS Platform prices every LLM call your applications send as a trace, rolls the cost up by model, user, agent, environment and time, and helps you cut it with tested model recommendations. This page explains where the numbers come from and where to find each tool.
ℹ
Came here from the AI Optimizer or Models page? Jump to AI Optimizer to create an optimizer, or Models & Pricing to set model prices.
How cost gets into the platform
- Your application sends traces through the SDK, OpenTelemetry or the Budget AI gateway. Each LLM call is a generation with a model name and token usage.
- The platform matches the model name to a model definition and multiplies usage by price, unless the trace already reports a cost.
- Generation costs add up to the trace cost, which the Gauge AI views break down further.
python
from ants_platform import get_client
client = get_client()
with client.start_as_current_span(name="support-agent") as span:
span.update_trace(user_id="user-123", session_id="session-456", tags=["support"])
with client.start_as_current_generation(
name="answer",
model="gpt-4o-mini",
input=[{"role": "user", "content": "Where is my order?"}],
) as generation:
generation.update(
output="It ships tomorrow.",
usage_details={"input": 412, "output": 38},
)
The OpenAI, LangChain and CrewAI integrations capture model and usage for you. See Python SDK and Sending Data In.
Where to see and act on cost
| Goal | Where | Docs |
|---|---|---|
| See spend by model, user, trace name, environment and gateway key | Gauge AI → Cost Dashboard | Cost & Latency Dashboards |
| Compare cost, tokens and latency with quality scores | Gauge AI → Cost Performance Metrics, Latency & Analytics | Cost & Performance Metrics |
| See cost per end user | Gauge AI → Users | Users |
| See cost and projections per agent | Discover AI → AI Agent Center | AI Agent Center |
| Find a cheaper model that keeps quality | Gauge AI → AI Optimizer | AI Optimizer |
| Set or override model prices | Settings → Models | Models & Pricing |
| Cap spend with budgets and rate limits | Budget AI → Budgets & Limits | Budget AI |