Usage

Dollars and tokens charged to your account, optionally narrowed by project, session, or time, and optionally broken down by model, project, session, or day.

This reports your own usage. A project you share with collaborators returns what you spent on it, not the project's total — what someone else spends is their financial data, not the project's.

Reads are eventually consistent with a live run: the engine reports usage on an interval, so check asOf before treating a total as final.

get/api/v2/usage

Request

  • Base URL
    https://davinci-app.com
  • Auth
    HTTP bearer

Query parameters

projectIdstring

Narrow to one project. Accepts the bare id or {projectId}--{branch}.

sessionIdstring

Narrow to one session.

fromstring date-time

Only count events at or after this time. Omit for all of recorded history.

tostring date-time

Only count events at or before this time.

groupBy'model' | 'project' | 'session' | 'day'

Break the totals down. Omit to receive totals only — totals is always present and always covers the whole scope, whether or not you group.

Response

Usage totals for the scope, and the breakdown if one was asked for.

scope'account' | 'project' | 'session' required

What the numbers cover, determined by the path you called.

projectIdstring

Present on the project and session reads. Always the bare id.

sessionIdstring uuid

Present on the session read.

asOfstring date-time nullable required

When the newest counted event was recorded, or null when the scope holds none. This is the honest bound on freshness: the engine reports usage on an interval, so a run's last few seconds may not be included. Null means "nothing here", not "nothing yet" — a scope with no usage looks the same either way, and inventing a timestamp would hide that.

groupBy'model' | 'project' | 'session' | 'day'

Echoed back when you asked for a breakdown.

Changes

    • breaking

      removed the required property ////// from the response with the status

    • breaking

      removed the required property / from the response with the status

    • info

      added the required property ////// to the response with the status

    • info

      added the required property / to the response with the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status

    • info

      the response property const value false was added for the status