Skip to main content

get_cost_summary()

Get an aggregate cost summary for your tenant over a time period.
summary = client.get_cost_summary(
    period="month",
    from_date="2026-03-01",
    to_date="2026-03-17",
)
period
string
default:"month"
Aggregation period: day, week, month
from_date
string
Start date (ISO 8601). Defaults to start of current month.
to_date
string
End date (ISO 8601). Defaults to today.
Returns:
{
  "total_cost_usd": 1245.67,
  "total_input_tokens": 15234000,
  "total_output_tokens": 4567000,
  "total_requests": 8923,
  "period": "month",
  "from": "2026-03-01T00:00:00Z",
  "to": "2026-03-17T23:59:59Z"
}

get_cost_by_agent()

Break down costs by individual agent.
by_agent = client.get_cost_by_agent(
    from_date="2026-03-01",
    to_date="2026-03-17",
    limit=10,
)
from_date
string
Start date (ISO 8601)
to_date
string
End date (ISO 8601)
limit
integer
default:"20"
Number of agents to return (sorted by cost descending)
Returns:
[
  {
    "agent_id": "agt_abc123",
    "agent_name": "production-summarizer",
    "team": "support-team",
    "total_cost_usd": 456.78,
    "input_tokens": 5600000,
    "output_tokens": 1200000,
    "requests": 3400
  },
  {
    "agent_id": "agt_def456",
    "agent_name": "lead-qualifier",
    "team": "sales-team",
    "total_cost_usd": 312.45,
    "input_tokens": 4100000,
    "output_tokens": 980000,
    "requests": 2100
  }
]

get_cost_by_model()

Break down costs by model.
by_model = client.get_cost_by_model(
    from_date="2026-03-01",
    to_date="2026-03-17",
)
from_date
string
Start date (ISO 8601)
to_date
string
End date (ISO 8601)
Returns:
[
  {
    "model_provider": "openai",
    "model_name": "gpt-4o",
    "total_cost_usd": 890.12,
    "input_tokens": 10200000,
    "output_tokens": 3100000,
    "requests": 5800
  },
  {
    "model_provider": "anthropic",
    "model_name": "claude-sonnet-4-20250514",
    "total_cost_usd": 355.55,
    "input_tokens": 5034000,
    "output_tokens": 1467000,
    "requests": 3123
  }
]