Read current-period usage
Use a key with only read scopes. Your customer_id is in the reply to Get the calling API key.
GET
The workspace's plan and balance for the current monthly period: the included allowance and what is left of it (resets at included_resets_at), the prepaid pack balance (pack_balance_usd; negative is app-hosting debt), spend this period and the monthly spend cap. Amounts are USD; the portal shows them as credits at usd_per_credit from GET /purchases/tiers. Needs coding:billing:read.
CustomerApiKeyheader
AuthorizationBearer <API Key>Customer API key sent as a bearer token
customer_id?|nullRequest fulfilled, document follows
application/json- response
app_hosting?array<>autonomous_budget_usd?number|nullbids_usd?numberDefault
0extra_usage?|nullhosting_debt_since?|nullincluded_remaining_usd*numberincluded_resets_at*stringFormat
date-timeincluded_spend_this_period_usd*numberincluded_usd*numbermonthly_spend_cap_usd*numberpack_balance_usd*numberpack_spend_this_period_usd*numberperiod_end*stringFormat
date-timeperiod_start*stringFormat
date-timeplan_code*stringspend_this_period_usd*numbersubscriptions?array<>curl -X GET 'https://api.syndai.ai/api/v1/external/coding/usage/current-period'Example Response
{ "app_hosting": [ { "coding_repository_id": "string", "publication_id": "string", "slug": "string", "translation_usd": 0, "usd": 0 } ], "autonomous_budget_usd": 0, "bids_usd": 0, "extra_usage": { "accrued_this_month_usd": 0, "accrued_this_week_usd": 0, "held_usd": 0, "month_resets_at": "2019-08-24T14:15:22Z", "monthly_limit_usd": 0, "remaining_usd": 0, "state": "string", "week_resets_at": "2019-08-24T14:15:22Z", "weekly_limit_usd": 0 }, "hosting_debt_since": "2019-08-24T14:15:22Z", "included_remaining_usd": 0, "included_resets_at": "2019-08-24T14:15:22Z", "included_spend_this_period_usd": 0, "included_usd": 0, "monthly_spend_cap_usd": 0, "pack_balance_usd": 0, "pack_spend_this_period_usd": 0, "period_end": "2019-08-24T14:15:22Z", "period_start": "2019-08-24T14:15:22Z", "plan_code": "string", "spend_this_period_usd": 0, "subscriptions": [ { "share_pct": 0, "subject_kind": "string" } ]}