Skip to content

`GET /api/workspaces/{id}/usage/manage` (#1644 S6, F-49/F-51). RBAC: workspace admin/owner. Every current reading with its provenance class, scope, account, reader and age — the SAME shape the chat `/usage` row and the MCP `usage.get` tool read — plus the reader health and the threshold pair in force. Never a secret: credential IDs and account labels only.

GET
/api/workspaces/{id}/usage/manage
curl --request GET \
--url https://example.com/api/workspaces/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/usage/manage \
--cookie supacloud_session=<supacloud_session>

GET /api/workspaces/{id}/usage/manage (#1644 S6, F-49/F-51). RBAC: workspace admin/owner. Every current reading with its provenance class, scope, account, reader and age — the SAME shape the chat /usage row and the MCP usage.get tool read — plus the reader health and the threshold pair in force. Never a secret: credential IDs and account labels only.

id
required
string format: uuid

Workspace ID whose Manage view to read

Every current reading with class, scope, account, reader and age, plus reader health

Media typeapplication/json

The whole Manage view of one workspace.

object
health
required

Every credential-reader pair carrying state.

Array<object>

One credential-reader pair’s health - the operator’s “last read failed: token expired” line, per credential.

object
account
required
string
backoff_until
string | null format: date-time
consecutive_failures
required
integer format: int32
credential_id
required
string format: uuid
credential_kind
required
string
enabled
required

The INSTANCE-wide reader switch in force (owner decision D1’s first layer).

boolean
last_attempt_at
string | null format: date-time
last_error_class

unauthorized | forbidden | not_found | rate_limited | server | malformed | transport | unsupported - a typed class, never response text.

string | null
last_success_at
string | null format: date-time
next_read_at
string | null format: date-time
opted_out
required

The TENANT’s per-credential opt-out (D1’s second layer): true means no trigger reads this credential through a vendor-client reader, and the row states no reading it did not make.

boolean
provider
required
string
reader
required
string
observed_at
required

The instant this view was assembled (the caller’s clock, so ages agree).

string format: date-time
readers
required
Array<object>

One declared reader, its instance switch and its aggregated health.

object
backoff_until
string | null format: date-time
class
required

measured | header | estimate | definition.

string
consecutive_failures
required
integer format: int32
credential_count
required

How many credential-reader pairs this declaration currently reads in the workspace (0 = declared but unused here).

integer format: int64
enabled
required

The operator switch in force (owner decision D1: ON when unset).

boolean
health
required

The worst health of those pairs: ok (last read succeeded), failing (consecutive failures), never (declared, never attempted), disabled.

string
implemented
required

False while the declaration is still Pending (no implementation in this build). A surface must say so instead of implying a live reader.

boolean
ladder
required

official | headers | harness_local | back_door | own_metering | definition - the section 6 ladder position.

string
last_error_class

The typed failure class of the worst pair, when it is failing.

string | null
last_success_at
string | null format: date-time
providers
required

The providers it reads; empty = every provider.

Array<string>
reader
required
string
scope
required

server | harness - where the read happens.

string
switch_reason
string | null
switched_at
string | null format: date-time
switched_by

WHO last set the switch, when it is not the built-in default.

string | null
tos_note
required

The ToS/risk note shown at enable time (section 6’s back-door contract).

string
thresholds
required

The 80/95 pair in force for this instance, ascending.

Array<number>
windows
required

Newest-first per provider/window/scope; closed windows are INCLUDED and flagged (window_open), so a surface can draw them recessed instead of silently dropping the fact that a window exists (F-49’s predecessor dropped them, which hid a limit hit the moment its reset passed).

Array<object>

One current reading, as every Manage surface draws it.

object
account
required

The account label: the OAuth account e-mail, the key’s own label, the plan badge, or a short credential id when none of them is known. Never a secret.

string
age_seconds
required

Seconds since the observation - the age every row states (F-49, section 9).

integer format: int64
class
required

measured | header | estimate | definition - HOW the number was obtained. A surface MUST mark estimate as ours, never as a provider figure.

string
credential_id
required
string format: uuid
credential_kind
required

oauth_token | api_key.

string
fill_pct

Percent consumed, 0.0..=100.0, when the reading states a figure it is entitled to. None = unknown; a surface must not draw an unknown as 0 %.

number | null format: double
freshness
required

fresh | aging | stale | closed (section 7 rule 6, from the view).

string
gate_eligible
required

True only when the ONE gate predicate would accept this reading.

boolean
limit_hit
required

Our own observed limit response: measured, but not a utilisation figure. Drawn as “limit hit”, never as a measured 100 % (F-34).

boolean
minutes_to_reset
integer | null format: int64
observed_at
required
string format: date-time
permits_overage
required

The window is spent but the provider bills overage instead of refusing.

boolean
plan_label
string | null
provider
required
string
reader
required

The reader declaration that produced the reading (F-49’s “reader name”).

string
reading_id
required

The reading this row was projected from - the evidence id a gate decision and an alert name.

string format: uuid
resets_at
string | null format: date-time
scope
required

all | model:<id> | family:<id>.

string
unit
required

The reading’s unit (fraction, percent, usd, requests, tokens, …).

string
used_fraction
number | null format: double
window_open
required
boolean
window_type
required

rolling_5h | weekly | monthly | daily.

string
workspace_id
required
string format: uuid

Example generated

{
"health": [
{
"account": "example",
"backoff_until": "2026-04-15T12:00:00Z",
"consecutive_failures": 1,
"credential_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"credential_kind": "example",
"enabled": true,
"last_attempt_at": "2026-04-15T12:00:00Z",
"last_error_class": "example",
"last_success_at": "2026-04-15T12:00:00Z",
"next_read_at": "2026-04-15T12:00:00Z",
"opted_out": true,
"provider": "example",
"reader": "example"
}
],
"observed_at": "2026-04-15T12:00:00Z",
"readers": [
{
"backoff_until": "2026-04-15T12:00:00Z",
"class": "example",
"consecutive_failures": 1,
"credential_count": 1,
"enabled": true,
"health": "example",
"implemented": true,
"ladder": "example",
"last_error_class": "example",
"last_success_at": "2026-04-15T12:00:00Z",
"providers": [
"example"
],
"reader": "example",
"scope": "example",
"switch_reason": "example",
"switched_at": "2026-04-15T12:00:00Z",
"switched_by": "example",
"tos_note": "example"
}
],
"thresholds": [
1
],
"windows": [
{
"account": "example",
"age_seconds": 1,
"class": "example",
"credential_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"credential_kind": "example",
"fill_pct": 1,
"freshness": "example",
"gate_eligible": true,
"limit_hit": true,
"minutes_to_reset": 1,
"observed_at": "2026-04-15T12:00:00Z",
"permits_overage": true,
"plan_label": "example",
"provider": "example",
"reader": "example",
"reading_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"resets_at": "2026-04-15T12:00:00Z",
"scope": "example",
"unit": "example",
"used_fraction": 1,
"window_open": true,
"window_type": "example"
}
],
"workspace_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Authentication required

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Permission denied

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}

Structured server error

Media typeapplication/json

The canonical JSON body of every error response. Every AppError serializes as this exact shape; code is the generated stable machine-readable vocabulary.

object
cap
One of:

Present only on an MCP budget refusal (429) — the refusing layer + retry hint.

object
layer
required

The refusing layer.

string
limit
required

The layer’s budget.

integer format: int64
retry_after_seconds

Seconds until a retry can pass, or null when it never will for this session.

integer | null format: int64
used
required

Calls already counted in the layer.

integer format: int64
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden license_required license_expired fresh_auth_required source_not_released bad_request unprocessable precondition_failed conflict artifact_staging_busy artifact_staging_store_unavailable intervention_attachment_limit method_not_allowed rate_limited too_many_requests quota_exceeded mcp_cap_exceeded form_schema_invalid autosave_not_offered submit_not_offered idempotency_key_reused response_cap_reached required_missing database_error docker_error vault_error internal_error artifact_frames_unavailable identity_native_custody_unconfigured launch_concurrency_limit launch_already_active launch_not_pending launch_budget_exhausted launch_draining launch_side_effects_disabled launch_dispatch_disabled no_eligible_runner launch_image_unavailable pull_request_no_git_branch pull_request_no_project project_credential_missing project_credential_expired project_credential_revoked project_credential_substitution project_parent_credential_not_current project_lineage_invalid project_binding_missing project_binding_mismatch project_not_found project_capability_not_granted project_capability_unknown project_capabilities_required project_history_is_not_authority project_task_not_found project_task_project_missing project_task_not_active project_native_origin_missing project_broader_scope_required project_system_scope_required project_lifetime_invalid project_lifetime_not_finite project_lifetime_exceeds_maximum project_delegation_exceeds_parent project_renewal_not_allowed project_delegation_widened project_audience_mismatch project_deployment_claim_missing project_authority_disabled project_issuer_not_current project_operation_not_durable project_dispatch_gate_refused
details
One of:

Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.

object
key
required

The entitlement feature key that was hit, e.g. apps.max_count.

string
limit
required

The plan’s limit for this key.

integer format: int64
upgrade_url
required

Where to send the user to upgrade.

string
used
required

Current usage (count or bytes, per the key).

integer format: int64
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
launch
One of:

Present on a launch refusal (400/403/409) — the structured facts only the refusing class can fill: occupancy, exhausted budget, or required labels.

object
active

Weighted workspace slots already held by starting/running agent runs.

integer | null format: int64
cap_usd

The budget cap that refused.

number | null format: double
effective_spend_usd

Effective spend of the refusing budget scope (spend + in-flight reservations).

number | null format: double
max

The workspace’s configured agent-concurrency cap.

integer | null format: int64
provider

The provider whose budget cap refused; absent for the workspace-wide cap.

string | null
required_labels

Runner labels a fail-policy placement required and no runner offered.

Array<string>

Example

{
"code": "not_found"
}