Get daily spend
Changed onPer-day token usage and cost, split by agent, for one calendar month, including judge evaluations. Costs are in each model's pricing currency unless convert_costs_to is set. Defaults to the current month; pass month=YYYY-MM to query history. Covers every environment the caller can access; environment_id limits it to one. group_by=model splits by model; group_by=context.<key> splits by a run context value such as context.customer_id, with context_value: null for runs that do not set it. Response includes running month total, projected end-of-month estimate when the month is in progress, and month-over-month trend versus the prior calendar month.
Required permission: budgets.view.
Request
- Base URLhttps://api.connic.co
- AuthHTTP bearer
Path parameters
ID of the project the API key belongs to.
Query parameters
Month in YYYY-MM format
Restrict to one environment UUID
Exact range start; applies only together with end_date and narrows the data within month
Exact range end (exclusive); applies only together with start_date
UTC offset in minutes, with the sign inverted (-120 for UTC+2, 300 for UTC-5). Days are grouped in this timezone; defaults to UTC.
Group spend by 'agent', 'model', or a run context path such as 'context.customer_id'
Convert token costs to EUR or USD at the daily ECB reference rate of each model call
Response
Successful Response
Month in YYYY-MM format.
One item per calendar day of the month.
Currency codes with a nonzero cost this month or last month.
Token cost in each model's pricing currency, or in one currency when convert_costs_to is set.
Total tokens for the same period.
Estimated end-of-month cost keyed by currency code, extrapolated from the average daily spend so far. Null unless the month is in progress and every call could be priced.
Token cost in each model's pricing currency, or in one currency when convert_costs_to is set.
Total tokens for the previous calendar month.
Previous month's spend per group, sorted by name.
Change versus the previous month, keyed by currency code.
Groups with usage or spend in the period, sorted by name. Null stands for runs without the context value.
Changes
- info
added the required property
current_token_cost/anyOf[subschema #1: PublicTokenCostResponse]/coverage/missing_price_modelsto the response with the status - info
added the required property
days/items/agents/items/anyOf[subschema #1: PublicDailyCostAgentResponse]/token_cost/anyOf[subschema #1: PublicTokenCostResponse]/coverage/missing_price_modelsto the response with the status - info
added the required property
days/items/agents/items/anyOf[subschema #2: PublicDailyCostModelResponse]/token_cost/anyOf[subschema #1: PublicTokenCostResponse]/coverage/missing_price_modelsto the response with the status
6 more changes in this revision
- info