Apps API · Billing Subscription
Billing Subscription: 3 个接口
GET /api/v1/billing/agent-overview
Agent usage overview (roster × billing rates)
权限(scope): billing:subscription:read · 调用方式: appToken · operationId: get-billing-agent-overview
Required app scope: billing:subscription:read.
Org agent roster composed with billing addon commercial truth. Runtime-billed agents carry provisioned CPU/memory/storage quantities and current online/sleep rates; agents on monthly-retainer billing carry monthly estimates instead. External agents carry neither. Any org member. Response wrapped in standard envelope. Optional page/page_size/q apply AFTER roster×billing composition; omit page and page_size for the full roster.
参数
| 名字 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
page |
query | integer (int32) | Page number (1-based). Omit together with page_size for the full roster. | |
page_size |
query | integer (int32) | Items per page (1-200). Omit together with page for the full roster. | |
q |
query | string | Case-insensitive substring match on the agent display name. Applied BEFORE paging, so total reflects the filtered set. |
回包
200OK —application/json·AgentOverviewListResponseBodydefaultError —application/problem+json·D8Error
GET /api/v1/billing/plan-state
Get the current plan state
权限(scope): billing:subscription:read · 调用方式: appToken · operationId: get-billing-plan-state
Required app scope: billing:subscription:read.
Returns the caller org's current subscription, entitlements, usage snapshot, and active add-ons. Response wrapped in standard envelope.
回包
200OK —application/json·DataResponsePlanStateDTOBodydefaultError —application/problem+json·D8Error
GET /api/v1/billing/subscription/intent
Get the org's live subscription intent
权限(scope): billing:subscription:read · 调用方式: appToken · operationId: get-billing-subscription-intent
Required app scope: billing:subscription:read.
Returns the org's single live subscription checkout intent — the read-after-failure source of truth: after any subscribe write fails, a client reads server state here instead of interpreting the write-path error. next_step adds the GET-only value processing (an in-flight order to poll, never an error). 404 (BILLING_SUBSCRIPTION_INTENT_NOT_FOUND) when the org has no live intent — the client mints a fresh idempotency key and re-subscribes. org_id is taken from the caller's Principal. Any org member. Response wrapped in standard envelope.
回包
200OK —application/json·DataResponseSubscriptionIntentReadDTOBodydefaultError —application/problem+json·D8Error
