API Reference
Log In
API Reference

Get cost by provider over time

Returns the cost of your AI calls per provider, such as OpenAI or Anthropic, in USD, split into time buckets (hourly, daily or monthly, depending on the length of the date range). Coding assistants the team is charged for at API rate, or that ran through a host that bills each call, are inside the provider total, mostly as their own rows, such as claudecode (Claude Code). The coding-assistant cost from get_cost_by_user_aggregated (shown as Assistants) reads the same calls, so it is already inside this total; never add it. To split assistants from other spend, report the assistant provider rows as a part of this total; they can differ from that cost, so do not reconcile them. Assistants on the AI by Employee page can also hold seat-plan usage and invoice-billed Cursor or GitHub Copilot spend, which is outside this total. For one figure per group over the whole period, a far smaller answer over a long date range, use get_cost_by_provider_aggregated.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
date-time

Start of the date range, ISO 8601 in UTC, for example 2026-01-01T00:00:00Z. Defaults to 24 hours before endDate.

date-time

End of the date range, ISO 8601 in UTC. Defaults to now.

string
enum

How the values in each group are combined: sum, avg, max, min, count, median, or the percentile p50, p90, p95 or p99. Defaults to sum.

integer | null
≥ 0
Defaults to 0

Zero-based page of _embedded.items to return. Defaults to 0.

integer
≤ 100
Defaults to 20

Number of _embedded.items per page, from 1 to 100. Defaults to 20.

string

IANA time zone for the buckets, such as America/Denver. Day, week, month and six-hour buckets start at that zone's midnight. Weeks start on Monday. With a zone, UTC included, the range is read exactly as given, so the first and last buckets can be partial. Buckets of 30 minutes or less stay on UTC's clock, so 30-minute buckets match the zone's half hours only where its offset from UTC is a whole or half hour, not in a zone such as Asia/Kathmandu. Defaults to UTC.

string

Hashed id of the team to answer for. Optional. With a user token it may be any team the user belongs to; without it the user's default team answers. An API key always answers for its own team, and naming any other team is refused with 403.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
API Key
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json