/v2/ai_signals/costs

This API returns AI Signals spend or token usage according to the parameters passed in. It works like getBillingCosts, with these differences:

  • Data comes from AI Signals telemetry for your whole organization, not from billing data. Your users' data access settings do not apply.
  • cost_type accepts only billed_cost (estimated spend in USD, the default) and usage_amount (token count).
  • include_projected_row_count is not supported.
  • Use getAiSignalsDimensions to list the dimensions you can group and filter by.
  • Your API key needs the AI Signals Read permission. A key that can read billing costs does not get it automatically.

Limits and behavior:

  • Rate Limit: 60 requests/day, shared with /v2/billing/costs. A call to either endpoint counts against the same daily allowance.
  • Timeout: 30 seconds.
  • Pagination: Results are paginated in blocks of 10,000 records.
    • Using cursors for pagination doesn't affect the rate limit.
    • You have 24 hours to page through your results before you will need to rerun your query.
    • While using pagination, your results will be static as of run time.
  • This data is statically sorted as usage_date asc.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
required
^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?$
Defaults to 2025-01-01T00:00:00Z

ISO 8601 datetime string from which to view costs.

  • When using this form: 2023-10-26T14:27:46+00:00
  • When using HTTP URL (This must be encoded!):
    • Encoded: 2023-10-26T14%3A27%3A46%2B00%3A00
    • Decoded: 2023-10-26T14:27:46+00:00
string
^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?$
Defaults to 2025-01-01T00:00:00Z

ISO 8601 datetime string until which to view costs (defaults to current date and time).

  • When using this form: 2023-10-26T14:27:46+00:00
  • When using HTTP URL (This must be encoded!):
    • Encoded: 2023-10-26T14%3A27%3A46%2B00%3A00
    • Decoded: 2023-10-26T14:27:46+00:00
string
enum
Defaults to daily

Supported periods, e.g. "daily"

Allowed:
group_by
array of objects

Dimension ID(s) by which to group the results. Get the available IDs from getAiSignalsDimensions. This is a multi-value query parameter, pass it more than once to specify multiple values.

  • When using this form: CZ:AI:AI_Model and CZ:AI:AI_User
  • When using HTTP URL: &group_by=CZ%3AAI%3AAI_Model&group_by=CZ%3AAI%3AAI_User
group_by
string

An encoded JSON mapping of Dimension IDs to values by which to filter the results. The keys are dimension IDs from getAiSignalsDimensions; they may be negated with a '!' prefix.

  • When using this form (Do not encode):
    • {"CZ:AI:AI_Model": ["<MODEL_NAME>"]}
  • When using HTTP URL (This must be encoded!):
    • Encoded: &filters=%7B%22CZ%3AAI%3AAI_Model%22%3A%20%5B%22<MODEL_NAME>%22%5D%7D
    • Decoded: &filters={"CZ:AI:AI_Model": ["<MODEL_NAME>"]}
string
enum
Defaults to billed_cost

billed_cost returns estimated AI spend in USD. usage_amount returns token counts.

Allowed:
boolean
Defaults to true

Controls whether the requested date range is expanded to align with granularity period boundaries.

When true (default), dates are snapped to the start of the granularity period. For example, requesting start_date=2024-09-15 with granularity=monthly will return data starting from 2024-09-01.

When false, the exact date range you specify is used. Partial periods will be included in the results. For example, requesting start_date=2024-09-15&end_date=2024-11-15&granularity=monthly will return monthly buckets containing only the costs within the September 15 through November 15 window.

string

Allows you to page forward and back in your results. NOTE: This must be URL Encoded!

  • See the Pagination section of the API Reference for more information!
Responses

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