Usage

What one session spent

Changed on

What a single session's agent run cost. This is the granularity to use when you want to know the price of a specific piece of work rather than a month of it.

A run still in progress will under-report until its last interval is flushed, so read asOf — or read this after waitUntilDone returns.

get/api/v2/projects/{projectId}/sessions/{sessionId}/usage

Request

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

Query parameters

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 session.

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

    • info

      the response property const value false was added for the status