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

Publish a platform standard selling-price revision

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

POST /api/v1/pricing/standard-prices

Explicit platform administration required; ordinary customer/Provider membership does not grant access. Independent model/currency/text-or-media identity; standard prices are independent of Provider purchase offers. expected_version is zero for a new identity and the last management version for replacement. All changes are versioned and attributed. Global UUID idempotency keys preserve canonical intent; exact retries return the original publication version, which may be older than current configuration. New standards take effect at commit and do not revoke still-eligible finite promotions. Existing request prices remain pinned; balances, supply qualification and routes are unchanged. Rates are decimal integer strings; token rates are nanounits per million tokens, fixed charges are nanounits, media quantities are exact rationals. Published standards supply default customer prices; publication alone does not establish supply qualification or model access.

Operation: publishRetailStandard.

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 POST "$NIU_ORIGIN/api/v1/pricing/standard-prices" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

No path, query, or header parameters are declared.

Required.

JSON
{
"type": "object",
"additionalProperties": false,
"properties": {
"model_alias": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"currency": {
"type": "string",
"pattern": "^[A-Z]{3}$"
},
"schedule": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "text"
},
"prompt_rate": {
"type": "string",
"pattern": "^[0-9]+$"
},
"completion_rate": {
"type": "string",
"pattern": "^[0-9]+$"
},
"cached_prompt_rate": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"cache_write_prompt_rate": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"reasoning_completion_rate": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"minimum_charge_nanos": {
"type": "string",
"pattern": "^[0-9]+$"
},
"request_fee_nanos": {
"type": "string",
"pattern": "^[0-9]+$"
},
"context_tiers": {
"type": "array",
"maxItems": 32,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"minimum_input_tokens": {
"type": "string",
"pattern": "^[0-9]+$"
},
"prompt_rate": {
"type": "string",
"pattern": "^[0-9]+$"
},
"completion_rate": {
"type": "string",
"pattern": "^[0-9]+$"
},
"cached_prompt_rate": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"cache_write_prompt_rate": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"reasoning_completion_rate": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
}
},
"required": [
"minimum_input_tokens",
"prompt_rate",
"completion_rate",
"cached_prompt_rate",
"cache_write_prompt_rate",
"reasoning_completion_rate"
]
}
}
},
"required": [
"kind",
"prompt_rate",
"completion_rate",
"cached_prompt_rate",
"cache_write_prompt_rate",
"reasoning_completion_rate",
"minimum_charge_nanos",
"request_fee_nanos",
"context_tiers"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"const": "media"
},
"dimensions": {
"type": "object",
"additionalProperties": false,
"properties": {
"model": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"channel": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"resolution": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"reference_video": {
"type": "boolean"
}
},
"required": [
"model",
"channel",
"resolution",
"reference_video"
]
},
"meter": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"decimal_places": {
"type": "integer",
"minimum": 0,
"maximum": 9
},
"amount_units": {
"type": "string",
"pattern": "^[0-9]+$"
},
"per_quantity": {
"type": "object",
"additionalProperties": false,
"properties": {
"numerator": {
"type": "string",
"pattern": "^[0-9]+$"
},
"denominator": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": [
"numerator",
"denominator"
]
},
"minimum_quantity": {
"type": "object",
"additionalProperties": false,
"properties": {
"numerator": {
"type": "string",
"pattern": "^[0-9]+$"
},
"denominator": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": [
"numerator",
"denominator"
]
},
"rounding": {
"type": "string",
"enum": [
"Down",
"Up",
"HalfEven"
]
}
},
"required": [
"kind",
"dimensions",
"meter",
"decimal_places",
"amount_units",
"per_quantity",
"minimum_quantity",
"rounding"
]
}
],
"description": "Concrete resulting selling price; exact decimal strings, no multipliers or Provider purchase terms."
},
"expected_version": {
"type": "string",
"pattern": "^[0-9]+$"
},
"idempotency_key": {
"type": "string",
"format": "uuid"
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 500
}
},
"required": [
"model_alias",
"currency",
"schedule",
"expected_version",
"idempotency_key",
"reason"
]
}

Current configuration or exact prior committed publication

Content type: application/json.

JSON
{
"type": "object",
"additionalProperties": false,
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"properties": {
"price_id": {
"type": "string",
"format": "uuid"
},
"revision": {
"type": "string",
"format": "uuid"
},
"version": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": [
"price_id",
"revision",
"version"
]
}
},
"required": [
"data"
]
}

Invalid exact amount, schedule, period or pagination

Authentication required

Explicit platform administration required

Stale version, conflicting key/period, unknown identity/customer or unsupported publication

Malformed JSON or unsupported schedule shape

Explicit platform administration required; ordinary customer/Provider membership does not grant access. Independent model/currency/text-or-media identity; standard prices are independent of Provider purchase offers. expected_version is zero for a new identity and the last management version for replacement. All changes are versioned and attributed. Global UUID idempotency keys preserve canonical intent; exact retries return the original publication version, which may be older than current configuration. New standards take effect at commit and do not revoke still-eligible finite promotions. Existing request prices remain pinned; balances, supply qualification and routes are unchanged. Rates are decimal integer strings; token rates are nanounits per million tokens, fixed charges are nanounits, media quantities are exact rationals. Published standards supply default customer prices; publication alone does not establish supply qualification or model access.

Supported scope: implemented