Skip to main content
POST
Query grouped usage cost subtotals for an account.

Authorizations

Authorization
string
header
required

Bearer authentication using your Fireworks API key. Format: Bearer <API_KEY>

Path Parameters

account_id
string
required

The Account Id

Body

application/json

Request for grouped usage cost subtotals over a time range.

startTime
string<date-time>

Inclusive lower bound for usage event timestamps.

endTime
string<date-time>

Exclusive upper bound for usage event timestamps.

scope
enum<string>
default:SCOPE_UNSPECIFIED

ACCOUNT requires account administrator access. SELF derives the user ID from the authenticated principal.

Available options:
SCOPE_UNSPECIFIED,
ACCOUNT,
SELF
groupBy
enum<string>[]

Dimensions to group by. At most two dimensions may be combined. HOUR and DAY are mutually exclusive. SESSION is intentionally filter-only to prevent high-cardinality enumeration.

Available options:
DIMENSION_UNSPECIFIED,
HOUR,
MODEL,
USER,
API_KEY,
DAY
filter
object

Optional exact-match filters. All populated fields are ANDed.

pageSize
integer<int32>

For paginated queries, the maximum number of grouped values to return. A page can contain more rows when each value spans multiple time buckets. Zero uses the server default; values above the maximum are clamped.

pageToken
string

Opaque token from a previous response. Set this to retrieve the next page while keeping all other request fields unchanged.

Maximum string length: 4096

Response

200 - application/json

A successful response.

rows
object[]

Cost rows for the requested dimensions. A successful response contains at most 10,100 rows and is limited to 4 MiB.

nextPageToken
string

Opaque token for the next page. Empty when no additional page is available.

subtotal
object

Subtotal for the complete query.

evaluationTime
string<date-time>
read-only

Time when this result was evaluated.

attributionCompleteness
enum<string>
default:ATTRIBUTION_COMPLETENESS_UNSPECIFIED
read-only

Whether the result may omit usage without a user ID. INCOMPLETE means the query filters by user, so historical unattributed usage may be excluded. The amount excluded is unknown.

Available options:
ATTRIBUTION_COMPLETENESS_UNSPECIFIED,
COMPLETE,
INCOMPLETE,
UNKNOWN