Syndai Docs

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
/api/v1/external/coding/usage/current-period

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.

Authorization

CustomerApiKey
headerAuthorizationBearer <API Key>

Customer API key sent as a bearer token

Query Parameters

customer_id?|null

Response Body

Request fulfilled, document follows

application/json
  1. response
app_hosting?array<>
autonomous_budget_usd?number|null
bids_usd?number
Default0
extra_usage?|null
hosting_debt_since?|null
included_remaining_usd*number
included_resets_at*string
Formatdate-time
included_spend_this_period_usd*number
included_usd*number
monthly_spend_cap_usd*number
pack_balance_usd*number
pack_spend_this_period_usd*number
period_end*string
Formatdate-time
period_start*string
Formatdate-time
plan_code*string
spend_this_period_usd*number
subscriptions?array<>
Example Request
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"    }  ]}
Was this page helpful?