VocalDocscontracts 1.65.0

Measured usage per minute of Call, for a cost estimate before a Call

GET /v1/analytics/usage-rates

PropertyValue
Operationget_usage_rates
GroupCall trace and analytics
Scopeusage:read
Route classread
IdempotencyNo Idempotency-Key
AuditNot audited: A metadata read; the figures are counts and averages only.
Released in1.28.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Estimates, per minute of Call, the TTS characters, model input tokens and model output tokens the caller's Organization used over the last window_days (30 when absent, at most 90), averaged over the Turns, the greeting included, of its answered Calls that ended in the window (1.28.0, workspace ADR 0077). Below the minimum Turn count (USAGE_RATES_MIN_TURNS, a target) the figures are measured over every Organization of the cell instead and basis says platform; from 1.29.0 that basis is answered only when at least 5 Organizations other than the caller's (a target) contributed a counted Call in the window, and otherwise every figure is null and both counts 0, so that no Organization learns another's averages. Every figure is an estimate measured from stored Turns, labelled with its basis and counts; it is not a price, a quote or a bill. Needs usage:read from 1.29.0 (workspace ADR 0078, decision 7), calls:read before it.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the usage:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl "$VOCAL_API/v1/analytics/usage-rates" \
  -H "Authorization: Bearer $VOCAL_API_KEY"

Parameters

NameInTypeRequiredDescription
window_daysqueryintegernoHow many days back from now the Calls are read, 1 to 90; 30 when absent.

Responses

StatusContent typeShapeError codes
200application/jsonUsageRates
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is UsageRates.

FieldTypeRequiredDescription
basisUsageRatesBasisyes
calls_countedintegeryesThe answered Calls that ended in the window behind the figures, on the basis, less those whose Agent ran a stage on the mock Provider; their minutes from answer to end are the denominator.
computed_atTimestampyesWhen the api computed the figures.
estimatetrueyesAlways true: every figure is an estimate measured from stored Turns, not a price, a quote or a bill.
llm_tokens_in_per_minutenumber or nullyesAn estimate: the model input tokens of every model round per minute of Call, summed over the counted Turns and divided by the minutes of the counted Calls, on the basis; null when no Call minute was counted. It estimates what a future Call uses from what earlier Calls used, and is never a price or a bill.
llm_tokens_out_per_minutenumber or nullyesAn estimate: the model output tokens of every model round per minute of Call, summed over the counted Turns and divided by the minutes of the counted Calls, on the basis; null when no Call minute was counted. It estimates what a future Call uses from what earlier Calls used, and is never a price or a bill.
object"usage_rates"yes
tts_characters_per_minutenumber or nullyesAn estimate: the characters of reply text sent to TTS per minute of Call, summed over the counted Turns and divided by the minutes of the counted Calls, on the basis; null when no Call minute was counted. It estimates what a future Call uses from what earlier Calls used, and is never a price or a bill.
turns_countedintegeryesThe Turns with usage of the counted Calls, the greeting included, behind the figures, on the basis.
window_daysintegeryesThe window the figures were measured over, in days back from computed_at.