Set your monthly spending cap or webhook
`spend_cap_usd` up to the tenant's `limits.max_spend_cap_usd`. At the cap, new viewers are refused (402 `spend_cap_reached`) and viewers already in keep watching; alerts go out at 50, 80 and 100 %. A new cap re-arms the alerts. Setting `webhook_url` answers a new `webhook_secret` once; `null` removes the webhook. Name and limits are the operator's (403).
spend_cap_usd up to the tenant's limits.max_spend_cap_usd. At the cap,
new viewers are refused (402 spend_cap_reached) and viewers already in
keep watching; alerts go out at 50, 80 and 100 %. A new cap re-arms the
alerts. Setting webhook_url answers a new webhook_secret once; null
removes the webhook. Name and limits are the operator's (403).
secretKeyAuthorizationBearer <token>sk_...
application/json- body
spend_cap_usd?number0 <= valuewebhook_url?|http or https, at a public address (not loopback, private, link-local or an internal name)
the tenant
application/json- response
id?stringname?stringscope?|the relay URL path (/tn_...); null for the default tenant
relays?array<string>issuer?stringaudience?stringpublic_key_pem?stringsecret_keys?array<>publishable_keys?array<string>limits?set by the operator; every field has a value
spend_cap_usd?number|nullwebhook_url?string|nullstreams?integermonth?secret_key?stringon create only
webhook_secret?stringwhen a webhook is set, once
curl -X PATCH 'https://api.nearglass.com/v1/tenant' \ -H 'Content-Type: application/json' \ -d '{ "spend_cap_usd": 80}'{ "id": "string", "name": "string", "scope": "string", "relays": [ "string" ], "issuer": "string", "audience": "string", "public_key_pem": "string", "secret_keys": [ { "hint": "string", "created_at": "string" } ], "publishable_keys": [ "string" ], "limits": { "viewer_cap": 0, "max_streams": 0, "max_sessions": 0, "max_publishers": 0, "max_egress_mbps": 0, "max_spend_cap_usd": 0 }, "spend_cap_usd": 0, "webhook_url": "string", "streams": 0, "month": { "month": "string", "viewer_hours": 0, "gib": 0, "bytes": 0, "free_viewer_hours": 0, "free_gib": 0, "prices": { "per_gib_usd": 0, "per_viewer_hour_usd": 0 }, "spend_usd": 0, "spend_cap_usd": 0, "percent_of_cap": 0, "cap_reached": true, "alerts": [ { "percent": 50, "at": "2019-08-24T14:15:22Z" } ] }, "secret_key": "string", "webhook_secret": "string"}Your tenant (limits, relay scope, public key, this month's spend) GET
Previous Page
Viewer-hours and bytes per day and per stream, and this month's spend GET
From the relay's session records (UTC days, a session counted on the day it ended; viewer sessions under 10 s are bytes but not viewer-hours). At most 92 days a call.