Workspace API
Get Credits
Get the workspace's rolling 24-hour credit usage with GET /workspace/credits.
GET https://api.parcelengineering.com/api/v1/workspace/creditsReturns the workspace’s credit usage for the trailing 24-hour rolling window: how many credits have been consumed, how many remain, and what the ceiling is.
Get credits costs 0 credits. It never throttles, so a workspace at its credit ceiling can always check its own usage.
The Workspace API requires the Pro plan. A request from a non-Pro workspace receives 403 forbidden.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspace_id | string (UUID) | No | Override the workspace resolved from your API key. Useful for admin tooling. |
Example
curl https://api.parcelengineering.com/api/v1/workspace/credits \ -H "Authorization: Bearer pcl_your_api_key"const response = await fetch( 'https://api.parcelengineering.com/api/v1/workspace/credits', { headers: { 'Authorization': 'Bearer pcl_your_api_key', }, });
const { data, metadata } = await response.json();Response
{ "data": { "plan": "pro", "remaining": 247500, "ceiling": 250000, "used": 2500, "window_hours": 24 }, "metadata": { "credits": 0 }}Response fields
| Field | Type | Description |
|---|---|---|
data.plan | string | The workspace’s effective plan (e.g. "pro"). |
data.remaining | integer | Credits remaining in the current rolling window. Computed as ceiling - used, clamped at 0. |
data.ceiling | integer | Maximum credits the workspace may consume per rolling window. 250000 on Pro. |
data.used | integer | Credits consumed in the trailing window_hours-hour window. |
data.window_hours | integer | Length of the rolling rate-limit window in hours. Always 24. |
metadata.credits | integer | Always 0. |
About remaining
remaining always means the residual of the rolling 24-hour rate-limit window. If a monthly purchased-allowance model is introduced in the future, it will be exposed as a separate, additive field. The meaning of remaining will not change.
Errors
| Status | Code | Description |
|---|---|---|
403 | forbidden | The workspace is not on the Pro plan. |