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

Set upstream credential request limit

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

PUT /api/v1/vendors/{vendor}/request-rate-limit

Platform administration only. Applies to mapped inference dispatches pinned to this saved credential across workspaces and gateway instances, independent of customer key RPM. Null is unlimited; zero denies dispatch. Revision starts at string 0 and survives credential edits. Rolling 60-second admissions count dispatch, including upstream failures and uncertain outcomes; polling and connection checks are not inference dispatch. Unlimited dispatches also count when a cap is subsequently enabled. No automatic route substitution or replay. Duplicated credentials saved under different vendor IDs have independent windows. Storage operations use bounded transactions: read-only snapshots for reads and a recording transaction for updates, with transaction-local 250 ms lock and 2 s statement limits. Exceeded waits return sanitized 503; failed updates do not advance policy/history. These bounds exclude authorization and pool acquisition.

Operation: setVendorRequestRateLimit.

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 PUT "$NIU_ORIGIN/api/v1/vendors/{vendor}/request-rate-limit" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Location: path. Required.

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

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"requests_per_minute",
"expected_revision"
],
"properties": {
"requests_per_minute": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 1000000
},
"expected_revision": {
"type": "string",
"pattern": "^[0-9]+$",
"description": "Exact current revision. Concurrent stale updates return 409."
}
}
}

Current policy or descending immutable history.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"requests_per_minute",
"revision"
],
"properties": {
"requests_per_minute": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 1000000
},
"revision": {
"type": "string",
"pattern": "^[0-9]+$"
}
}
}
}
}

Invalid limit, revision or query.

Authentication required.

Platform administration required.

Credential configuration not found.

Stale revision on policy update.

Storage unavailable or bounded storage wait exceeded; no empty-success policy/history fallback.

Platform administration only. Applies to mapped inference dispatches pinned to this saved credential across workspaces and gateway instances, independent of customer key RPM. Null is unlimited; zero denies dispatch. Revision starts at string 0 and survives credential edits. Rolling 60-second admissions count dispatch, including upstream failures and uncertain outcomes; polling and connection checks are not inference dispatch. Unlimited dispatches also count when a cap is subsequently enabled. No automatic route substitution or replay. Duplicated credentials saved under different vendor IDs have independent windows. Storage operations use bounded transactions: read-only snapshots for reads and a recording transaction for updates, with transaction-local 250 ms lock and 2 s statement limits. Exceeded waits return sanitized 503; failed updates do not advance policy/history. These bounds exclude authorization and pool acquisition.

Supported scope: implemented