Traffic usage and pricing across your account
const url = 'https://api.nsin.cloud/traffic-usage';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.nsin.cloud/traffic-usage \ --header 'Authorization: Bearer <token>'Recent daily traffic rows (up to 90) with totals, plus the current per-gigabyte prices.
Traffic is billed in three tiers — cached (served from cache),
proxied (fetched through the edge proxy) and direct — each priced
separately. Older rows may carry only the legacy bypass_bytes column;
those are folded into the direct total.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Usage rows, totals and prices.
object
One day’s traffic for one domain.
object
Legacy two-tier column, present on historical rows. Folded into the direct total for display.
The portion above the plan’s free allowance.
The portion above the plan’s free allowance.
The portion above the plan’s free allowance.
Rials per GB of cache-served traffic.
Rials per GB of proxied traffic.
Rials per GB of direct traffic.
Example generated
{ "usage": [ { "id": 1, "domain_id": 1, "user_id": 1, "date": "2026-04-15", "billing_window_key": "example", "cached_bytes": 1, "proxied_bytes": 1, "direct_bytes": 1, "bypass_bytes": 1, "charged_rials": 1, "window_start": "2026-04-15T12:00:00Z", "window_end": "2026-04-15T12:00:00Z", "billed_cached_bytes": 1, "billed_proxied_bytes": 1, "billed_direct_bytes": 1, "charged_cached_rials": 1, "charged_proxied_rials": 1, "charged_direct_rials": 1, "invoice_id": 1, "processed_at": "2026-04-15T12:00:00Z", "created_at": "2026-04-15T12:00:00Z" } ], "total_cached_bytes": 1, "total_proxied_bytes": 1, "total_direct_bytes": 1, "total_charged_rials": 1, "cached_price_per_gb": 1, "proxied_price_per_gb": 1, "direct_price_per_gb": 1}Missing, malformed, revoked or expired API key, or a key whose owning
user row is gone. A key whose owning account has merely been deactivated
is not this: that is 403 with code: account_suspended, because the
credential itself is intact and re-issuing it changes nothing.
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Examples
{ "error": "invalid API key"}The key exceeded its request budget (300 requests per minute by default).
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Examples
{ "error": "rate limit exceeded"}