Speko Docs

usage

GET /v1/usage — billing and usage reporting.

Usage summary for the current billing period. Exposed via speko.usage.

summary = speko.usage.get()
print(summary.total_sessions, summary.total_minutes, summary.total_cost)
print(summary.balance_usd)

Signature

Speko.usage.get(
    *,
    from_date: str | None = None,
    to_date: str | None = None,
) -> UsageSummary
await AsyncSpeko.usage.get(
    *,
    from_date: str | None = None,
    to_date: str | None = None,
) -> UsageSummary

Both parameters accept ISO-8601 dates or datetimes. Omit either to default to the current billing period.

Returns — UsageSummary

total_sessionsint
total_minutesfloat
total_costfloat

Total cost in USD over the range: minutes_cost + add_on_cost.

minutes_costfloat

Cost of the per-minute call rate.

add_on_costfloat

Cost of everything billed on top of the minute: telephony, speech-to-speech backend tokens, phone numbers.

breakdownlist[UsageByProvider]

Per-provider rollup — see below.

balance_usdfloat

Current organization balance in USD.

currency'USD'

UsageByProvider

providerstring
metricstring

Billable metric (e.g. session_seconds, llm_tokens, telephony_inbound_seconds).

charge_kind'minutes' | 'add_on' | 'included' | 'free' | 'byok'

How the line bills: the per-minute rate, an add-on on top of it, covered by the minute, absorbed by Speko (post-call summaries), or run on your own key.

key_source'BYOK' | 'MANAGED'

BYOK = customer key, no Speko margin. MANAGED = platform key, billed to the org.

quantityfloat
costfloat

Cost in USD for this row.

Example — last 24 hours

from datetime import datetime, timedelta, timezone

now = datetime.now(timezone.utc)
yesterday = now - timedelta(hours=24)

summary = speko.usage.get(
    from_date=yesterday.isoformat(),
    to_date=now.isoformat(),
)

for row in summary.breakdown:
    print(f"{row.charge_kind}\t{row.provider}\t{row.quantity} {row.metric}\t${row.cost}")

On this page