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

Read an API key's Credits spending limit and commitment

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

GET /api/v1/organizations/{organization}/projects/{project}/keys/{key}/units/limit

Workspace read permission required. Rotated keys share their original spending root identity. Returns the key lineage’s explicit Credits atom limit, policy revision, committed atoms (settled charges minus restorations plus unresolved holds and known overrun liabilities), remaining allowance, and whether an existing monetary key limit is preserved. A preserved monetary key limit blocks Credits admission until an explicit Credits key limit revision is published.

Operation: getKeyCustomerUnitSpendingLimit.

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/organizations/{organization}/projects/{project}/keys/{key}/units/limit" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

Location: path. Required.

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

Location: path. Required.

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

Location: path. Required.

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

No request body is declared.

Current API key Credits spending limit state

Content type: application/json.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"unit",
"limit_atoms",
"revision",
"definition_revision",
"committed_atoms",
"remaining_atoms",
"monetary_limit_preserved",
"credits_admission_blocked_by_monetary_limit"
],
"properties": {
"unit": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"required": [
"definition_revision",
"name",
"display_precision",
"atoms_per_unit"
],
"properties": {
"definition_revision": {
"type": "string",
"pattern": "^[1-9][0-9]*$"
},
"name": {
"type": "string"
},
"display_precision": {
"type": "integer",
"minimum": 0,
"maximum": 9
},
"atoms_per_unit": {
"type": "string",
"const": "1000000000"
}
}
},
"limit_atoms": {
"type": [
"string",
"null"
],
"pattern": "^(0|[1-9][0-9]*)$"
},
"revision": {
"type": [
"string",
"null"
],
"pattern": "^[1-9][0-9]*$"
},
"definition_revision": {
"type": [
"string",
"null"
],
"pattern": "^[1-9][0-9]*$"
},
"committed_atoms": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$"
},
"remaining_atoms": {
"type": [
"string",
"null"
],
"pattern": "^(0|[1-9][0-9]*)$"
},
"monetary_limit_preserved": {
"type": "boolean"
},
"credits_admission_blocked_by_monetary_limit": {
"type": "boolean"
}
}
}
}
}

Authentication required or revoked

Workspace access denied

Key does not exist in the authorized workspace

Storage unavailable

Workspace read permission required. Rotated keys share their original spending root identity. Returns the key lineage’s explicit Credits atom limit, policy revision, committed atoms (settled charges minus restorations plus unresolved holds and known overrun liabilities), remaining allowance, and whether an existing monetary key limit is preserved. A preserved monetary key limit blocks Credits admission until an explicit Credits key limit revision is published.

Supported scope: implemented