Billing API
Read your account profile and balance, redeem vouchers, and review the activity feed.
Balance is funded by vouchers and tracked in an append-only ledger. Vouchers add credit; your running services (container apps and managed Postgres, MySQL, and Redis databases) are metered hourly and debited against your balance as you use them. Container registry storage and custom domains are priced separately and are not metered. This page also exposes your account profile, your transaction history, current-month usage, the active rate card, and recent activity. These operations are generated from the curated OpenAPI spec.
Authorization
bearerAuth Bearer JWT obtained after Google sign-in in the portal.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/me"{
"sub": "string",
"email": "[email protected]",
"balance_syp": 0
}{
"error": "validation failed",
"request_id": "01J9Z3K8QWERTYUIOP"
}Authorization
bearerAuth Bearer JWT obtained after Google sign-in in the portal.
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/billing"{
"balance_uusd": 5000000,
"balance_usd": "5.00",
"balance_syp": 650000,
"syp_per_usd": 130,
"low_balance": true,
"low_balance_threshold_uusd": 0,
"suspended_for_billing": true,
"display_currency": "AED",
"balance_display": "18.36",
"fx_rate_per_usd": 3.6725
}{
"error": "validation failed",
"request_id": "01J9Z3K8QWERTYUIOP"
}Authorization
bearerAuth Bearer JWT obtained after Google sign-in in the portal.
In: header
Query Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/billing/transactions"{
"transactions": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"amount_uusd": 0,
"kind": "usage_debit",
"source": "string",
"ref_id": "string",
"balance_after_uusd": 0,
"created_at": "2019-08-24T14:15:22Z"
}
],
"total": 0,
"limit": 0,
"offset": 0
}{
"error": "validation failed",
"request_id": "01J9Z3K8QWERTYUIOP"
}Authorization
bearerAuth Bearer JWT obtained after Google sign-in in the portal.
In: header
Query Parameters
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/billing/usage"{
"period_start": "2019-08-24T14:15:22Z",
"period_end": "2019-08-24T14:15:22Z",
"total_uusd": 0,
"lines": [
{
"resource_type": "container",
"rate_kind": "memory_gb_hour",
"unit": "GB-hour",
"quantity_milli": 694000,
"unit_price_uusd": 0,
"amount_uusd": 0,
"replicas_milli": 3000
}
],
"ai_pending": {
"prompt_tokens": 0,
"completion_tokens": 0
}
}{
"error": "validation failed",
"request_id": "01J9Z3K8QWERTYUIOP"
}Response Body
application/json
application/json
curl -X GET "https://example.com/v1/billing/rate-card"{
"rate_card": [
{
"resource_kind": "memory_gb_hour",
"unit": "GB-hour",
"unit_price_uusd": 200
}
],
"settings": {
"welcome_credit_uusd": 0,
"low_balance_threshold_uusd": 0,
"syp_per_usd": 0,
"voucher_denominations_uusd": [
0
]
}
}{
"error": "validation failed",
"request_id": "01J9Z3K8QWERTYUIOP"
}Authorization
bearerAuth Bearer JWT obtained after Google sign-in in the portal.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/vouchers/redeem" \ -H "Content-Type: application/json" \ -d '{ "code": "ALW-2K4F-9QXM" }'{
"balance_syp": 0,
"history": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"amount_syp": 0,
"kind": "credit",
"reason": "string",
"created_at": "2019-08-24T14:15:22Z"
}
]
}Authorization
bearerAuth Bearer JWT obtained after Google sign-in in the portal.
In: header
Response Body
application/json
curl -X GET "https://example.com/v1/activity"[
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "container.deployed",
"summary": "string",
"created_at": "2019-08-24T14:15:22Z"
}
]