budgets

Get spend per agent

Changed on

Token usage and native-currency cost by agent for the chosen month (default: current), sorted by name. Each row includes an exact per-currency cost breakdown, agent and judge token usage, and run count. Covers every environment the caller can access; pass environment_id to limit to one. group_by=model ranks models; group_by=context.<key> ranks run context values such as context.customer_id, with context_value: null for runs that do not set it.

Required permission: budgets.view.

get/v1/projects/{project_id}/budgets/agent-ranking

Request

  • Base URL
    https://api.connic.co
  • Auth
    HTTP bearer

Path parameters

project_id, string uuid required

ID of the project the API key belongs to.

Query parameters

month, string nullable

Month in YYYY-MM format

environment_id, string uuid nullable

Restrict to one environment UUID

start_date, string date-time nullable

Exact range start; applies only together with end_date and replaces the month bounds

end_date, string date-time nullable

Exact range end (exclusive); applies only together with start_date

tz_offset, integer nullable

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_by, string

Group spend by 'agent', 'model', or a run context path such as 'context.customer_id'

convert_costs_to, 'EUR' | 'USD' nullable

Convert token costs to EUR or USD at the daily ECB reference rate of each model call

Response

Successful Response

PublicAgentRankingResponse required
month, string required

Month in YYYY-MM format.

currencies, string[] required

Currency codes with a nonzero cost in the results.

agents, union[] required

One row per agent, model or context value, depending on group_by, sorted by name.

Changes

    • info

      added the required property agents/items/anyOf[subschema #1: PublicAgentRankingItemResponse]/agent_token_cost/anyOf[subschema #1: PublicTokenCostResponse]/coverage/missing_price_models to the response with the status

    • info

      added the required property agents/items/anyOf[subschema #1: PublicAgentRankingItemResponse]/token_cost/anyOf[subschema #1: PublicTokenCostResponse]/coverage/missing_price_models to the response with the status

    • info

      added the required property agents/items/anyOf[subschema #2: PublicModelRankingItemResponse]/agent_token_cost/anyOf[subschema #1: PublicTokenCostResponse]/coverage/missing_price_models to the response with the status

    3 more changes in this revision