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

Estimate a configured text-video request without submission

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

POST /v1/video/estimate

Checks current key/model, route, capability, tariff and policy access. Performs no upstream request, job creation, reservation or debit. Estimates are not binding quotes, final charges or admission guarantees. Submission rechecks current configuration and available funds. Owner-funded amounts remain null; missing output estimators and unqualified contracts are unavailable.

Operation: estimateVideoGeneration.

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

JSON
[
{
"bearerAuth": []
},
{
"niuApiKeyAuth": []
}
]

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.

Authentication alternative: bearerAuth.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/v1/video/estimate" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
--data @request.json

Authentication alternative: niuApiKeyAuth.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/v1/video/estimate" \
-H "X-Niu-API-Key: $NIU_API_KEY" \
-H 'Content-Type: application/json' \
--data @request.json

No path, query, or header parameters are declared.

Required.

JSON
{
"type": "object",
"required": [
"model",
"content"
],
"additionalProperties": true,
"properties": {
"model": {
"type": "string"
},
"content": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"type",
"text"
],
"properties": {
"type": {
"const": "text"
},
"text": {
"type": "string",
"minLength": 1
}
}
}
}
}
}

Nonbinding estimate and independently reviewed maximum charge

Content type: application/json.

JSON
{
"type": "object",
"additionalProperties": false,
"required": [
"object",
"model",
"mode",
"effective_output",
"estimate",
"maximum_charge_nanos",
"selected_at"
],
"properties": {
"object": {
"const": "video.estimate"
},
"model": {
"type": "string"
},
"mode": {
"type": "string",
"enum": [
"owner_funded",
"customer"
]
},
"effective_output": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"description": "Saved estimated quantity priced using the original customer tariff. Neither confirmed usage, maximum liability nor a final charge. Owner-funded or unpriceable amounts remain null.",
"required": [
"meter",
"quantity",
"provenance",
"currency",
"amount_nanos"
],
"properties": {
"meter": {
"type": "string"
},
"quantity": {
"type": "object",
"additionalProperties": false,
"required": [
"numerator",
"denominator"
],
"properties": {
"numerator": {
"type": "string",
"pattern": "^[0-9]+$"
},
"denominator": {
"type": "string",
"pattern": "^[1-9][0-9]*$"
}
}
},
"provenance": {
"type": "string",
"enum": [
"Estimate"
]
},
"currency": {
"type": [
"string",
"null"
]
},
"amount_nanos": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"unit_code": {
"type": [
"string",
"null"
]
},
"amount_atoms": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
}
}
},
"estimate": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"description": "Saved estimated quantity priced using the original customer tariff. Neither confirmed usage, maximum liability nor a final charge. Owner-funded or unpriceable amounts remain null.",
"required": [
"meter",
"quantity",
"provenance",
"currency",
"amount_nanos"
],
"properties": {
"meter": {
"type": "string"
},
"quantity": {
"type": "object",
"additionalProperties": false,
"required": [
"numerator",
"denominator"
],
"properties": {
"numerator": {
"type": "string",
"pattern": "^[0-9]+$"
},
"denominator": {
"type": "string",
"pattern": "^[1-9][0-9]*$"
}
}
},
"provenance": {
"type": "string",
"enum": [
"Estimate"
]
},
"currency": {
"type": [
"string",
"null"
]
},
"amount_nanos": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
},
"unit_code": {
"type": [
"string",
"null"
]
},
"amount_atoms": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$"
}
}
},
"unit_code": {
"type": [
"string",
"null"
]
},
"maximum_charge_nanos": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$",
"description": "Customer maximum from separately reviewed liability; not funds reserved by this read."
},
"maximum_charge_atoms": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$",
"description": "Customer maximum in Credits atoms from separately reviewed liability; not funds reserved by this read."
},
"selected_at": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]+$",
"description": "Customer tariff selection time in Unix seconds; does not guarantee future availability."
}
}
}

Request violates configured capabilities

Invalid credential

Policy cannot be satisfied

Model access denied

Unsupported channel, meter, estimator, media or callback contract

Qualified route or original tariff binding unavailable

Checks current key/model, route, capability, tariff and policy access. Performs no upstream request, job creation, reservation or debit. Estimates are not binding quotes, final charges or admission guarantees. Submission rechecks current configuration and available funds. Owner-funded amounts remain null; missing output estimators and unqualified contracts are unavailable.