Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Inspect requests contributing unresolved key capacity

Generated from the checked-in source. Do not edit this reference by hand.

GET /api/v1/workspaces/{workspace}/keys/{key}/capacity

Workspace read authority required. Includes the full secret-rotation lineage. Concurrency uses unresolved dispatched requests. Tokens uses reservations and unbounded usage from unresolved dispatches plus completed unknown-usage requests in the rolling 60-second window, matching the token-budget calculation; known recent usage is not returned here. Each page has a fresh statement snapshot. UUID keyset cursor is internal; rows may resolve between pages. Refresh to restart investigation. This read does not contact Providers, reconcile usage, release reservations or retry requests. No credentials, prompt content or procurement data. Cache-Control no-store. The server resolves the organization from the authorized workspace. Foreign or missing workspaces return 404. The compatibility route remains supported with identical payload, owner, revision and replay semantics.

Operation: listKeyCapacityRequestsByWorkspace.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X GET "$NIU_ORIGIN/api/v1/workspaces/{workspace}/keys/{key}/capacity" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: path. Required.

JSON
{
"type": "string",
"format": "uuid"
}

Location: query. Optional.

JSON
{
"type": "string",
"enum": [
"concurrency",
"tokens"
],
"default": "concurrency"
}

Location: query. Optional.

JSON
{
"type": "string",
"format": "uuid"
}

Location: query. Optional.

JSON
{
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
}

No request body is declared.

Matching current contributors and snapshot count

Content type: application/json.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"data",
"total",
"snapshot_at",
"next_after"
],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"attempt_id",
"model_alias",
"key_name",
"created_at",
"dispatched_at",
"completed_at",
"execution",
"reserved_tokens"
],
"properties": {
"attempt_id": {
"type": "string",
"format": "uuid"
},
"model_alias": {
"type": "string"
},
"key_name": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"dispatched_at": {
"type": "string",
"format": "date-time"
},
"completed_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"execution": {
"type": "string",
"enum": [
"may_have_executed",
"confirmed_completed"
]
},
"reserved_tokens": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
}
}
}
},
"total": {
"type": "integer",
"minimum": 0
},
"snapshot_at": {
"type": "string",
"format": "date-time"
},
"next_after": {
"type": [
"string",
"null"
],
"format": "uuid"
}
}
}

Invalid query

Authentication required

Insufficient management permission

Key or workspace outside the authorized scope

Cursor unavailable; restart pagination

Workspace read authority required. Includes the full secret-rotation lineage. Concurrency uses unresolved dispatched requests. Tokens uses reservations and unbounded usage from unresolved dispatches plus completed unknown-usage requests in the rolling 60-second window, matching the token-budget calculation; known recent usage is not returned here. Each page has a fresh statement snapshot. UUID keyset cursor is internal; rows may resolve between pages. Refresh to restart investigation. This read does not contact Providers, reconcile usage, release reservations or retry requests. No credentials, prompt content or procurement data. Cache-Control no-store. The server resolves the organization from the authorized workspace. Foreign or missing workspaces return 404. The compatibility route remains supported with identical payload, owner, revision and replay semantics.

Supported scope: implemented