Skip to main content
GET
/
dashboard
/
billing
Get Billing Info
curl --request GET \
  --url https://api.example.com/dashboard/billing \
  --header 'x-api-key: <x-api-key>'
{
  "billing_enabled": true,
  "period_start": 1704067200,
  "period_end": 1706745600,
  "total_usage_gb": 45.67,
  "period_start_formatted": "Jan 01, 2024",
  "period_end_formatted": "Feb 01, 2024"
}

Overview

Returns billing information for the current period, including total usage in GB. Requires a Stripe subscription linked to your API key.

Header Parameters

x-api-key
string
required
Your API key for authentication

Response (Billing Enabled)

billing_enabled
boolean
Whether Stripe billing is enabled for this API key
period_start
integer
Unix timestamp of billing period start
period_end
integer
Unix timestamp of billing period end
total_usage_gb
number
Total data transferred in GB during current period
period_start_formatted
string
Human-readable period start date (e.g., “Jan 01, 2024”)
period_end_formatted
string
Human-readable period end date (e.g., “Feb 01, 2024”)

Response (No Billing)

When no Stripe subscription is linked:
billing_enabled
boolean
false when no subscription is linked
message
string
Explanation message

Examples

curl -X GET "https://tornado.velys.software/dashboard/billing" \
  -H "x-api-key: sk_your_api_key"

Success Response

{
  "billing_enabled": true,
  "period_start": 1704067200,
  "period_end": 1706745600,
  "total_usage_gb": 45.67,
  "period_start_formatted": "Jan 01, 2024",
  "period_end_formatted": "Feb 01, 2024"
}

Error Responses

{
  "error": "Missing x-api-key header"
}

Billing Model

Tornado uses usage-based billing through Stripe:
  • Metered billing: Pay only for what you use
  • Per-GB pricing: Charged based on total data transferred
  • Monthly billing cycle: Usage resets each billing period
Contact [email protected] to set up Stripe billing for your account.