查询用量

GET/api/business/v1/customer/usage

Return aggregated usage (totals + per-model) for the API key's project over a time range. API key only.

Bearer API Key请求头使用 Authorization: Bearer sk_live_...,也支持 x-api-key。

请求结构

下方内容用于确认方法、地址和鉴权方式,属于 HTTP 结构片段,不是可独立执行示例。

HTTP
GET https://www.silvamux.com/api/business/v1/customer/usage
Authorization: Bearer $SILVAMUX_API_KEY

请求参数

参数类型与位置必填说明
Authorizationstring · headerBearer API Key (sk_live_...)
X-Organization-Idstring · headerNot required for API key auth
fromstring · queryRFC3339 start time (inclusive)
tostring · queryRFC3339 end time (exclusive)

响应

200OK

application/json · object

字段类型必填说明
$schemastring (uri)A URL to the JSON Schema for this object.
by_modelarray<object>Per-model breakdown, ordered by cost_points desc
fromstring (date-time)Report start (RFC3339, inclusive)
project_idstringProject filter ('' means org-wide)
tostring (date-time)Report end (RFC3339, exclusive)
totalsobject

defaultError

application/problem+json · object

字段类型必填说明
$schemastring (uri)A URL to the JSON Schema for this object.
detailstringA human-readable explanation specific to this occurrence of the problem.
errorsarray<object>Optional list of individual error details
instancestring (uri)A URI reference that identifies the specific occurrence of the problem.
statusinteger (int64)HTTP status code
titlestringA short, human-readable summary of the problem type. This value should not change between occurrences of the error.
typestring (uri)A URI reference to human-readable documentation for the error.;默认值:about:blank