Render supplied message variants
Render bounded literal/argument/select/plural message trees for explicit cases using fixed CLDR47 integer cardinal rules for en/de/ja/ar/pt-BR/pt-PT. Exact branches precede categories; other is required. Returns selected branches and finite case coverage. No translation, escaping, ICU syntax or runtime Intl dependency.
text · Operation ID: message-variants-render
Choose this operation when
- Render supplied plural/select messages into concrete localized preview strings
- Preview fixed integer cardinal branches and finite case coverage for supplied message trees
Outside this profile
- Translate or verify language quality; parse full ICU MessageFormat; decimal/ordinal plurals; format dates/numbers; send messages; escape HTML or SQL
- Network calls, external actions, supplied-evidence authenticity or factual correctness certification
Exact release references
Static JSON contract · Markdown reference · Fixed example response
Complete input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"locale": {
"type": "string",
"enum": [
"en",
"de",
"ja",
"ar",
"pt-BR",
"pt-PT"
]
},
"root": {
"maxItems": 512,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 511
}
},
"nodes": {
"maxItems": 512,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "text"
},
"text": {
"type": "string",
"maxLength": 60000
}
},
"required": [
"kind",
"text"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "arg"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
}
},
"required": [
"kind",
"name"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "select"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
},
"options": {
"minItems": 1,
"maxItems": 16,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"nodes": {
"maxItems": 512,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 511
}
}
},
"required": [
"key",
"nodes"
],
"additionalProperties": false
}
}
},
"required": [
"kind",
"name",
"options"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "plural"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
},
"exact": {
"default": [],
"maxItems": 16,
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000
},
"nodes": {
"maxItems": 512,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 511
}
}
},
"required": [
"value",
"nodes"
],
"additionalProperties": false
}
},
"categories": {
"minItems": 1,
"maxItems": 6,
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": [
"zero",
"one",
"two",
"few",
"many",
"other"
]
},
"nodes": {
"maxItems": 512,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 511
}
}
},
"required": [
"category",
"nodes"
],
"additionalProperties": false
}
}
},
"required": [
"kind",
"name",
"categories"
],
"additionalProperties": false
}
]
}
},
"cases": {
"minItems": 1,
"maxItems": 128,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"variables": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 60000
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
]
}
}
},
"required": [
"id",
"variables"
],
"additionalProperties": false
}
}
},
"required": [
"locale",
"root",
"nodes",
"cases"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "message-variants-render",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"advisoryOnly": {
"type": "boolean",
"const": true
},
"externalRequests": {
"type": "number",
"const": 0
},
"profile": {
"type": "string",
"const": "bounded-message-tree-cldr47-integer-v1"
},
"locale": {
"type": "string",
"enum": [
"en",
"de",
"ja",
"ar",
"pt-BR",
"pt-PT"
]
},
"cases": {
"maxItems": 128,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"text": {
"type": "string",
"maxLength": 20000
},
"branches": {
"maxItems": 512,
"type": "array",
"items": {
"type": "object",
"properties": {
"node": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"selected": {
"type": "string",
"maxLength": 100
}
},
"required": [
"node",
"selected"
],
"additionalProperties": false
}
}
},
"required": [
"id",
"text",
"branches"
],
"additionalProperties": false
}
},
"coverage": {
"maxItems": 512,
"type": "array",
"items": {
"type": "object",
"properties": {
"node": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"visited": {
"maxItems": 16,
"type": "array",
"items": {
"type": "string",
"maxLength": 100
}
},
"unvisited": {
"maxItems": 16,
"type": "array",
"items": {
"type": "string",
"maxLength": 100
}
}
},
"required": [
"node",
"visited",
"unvisited"
],
"additionalProperties": false
}
},
"translationVerified": {
"type": "boolean",
"const": false
},
"escaped": {
"type": "boolean",
"const": false
}
},
"required": [
"advisoryOnly",
"externalRequests",
"profile",
"locale",
"cases",
"coverage",
"translationVerified",
"escaped"
],
"additionalProperties": false
},
"provenance": {
"type": "object",
"required": [
"inputSha256",
"outputSha256",
"deterministic",
"externalRequests"
],
"properties": {
"inputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"outputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"deterministic": {
"const": true
},
"externalRequests": {
"const": 0
}
}
}
},
"additionalProperties": false
}
Fixed example
One accepted fixed example, not a custom-input trial. No operation runs when this static page is requested.
Example input
{
"locale": "en",
"root": [
0,
1,
2,
3
],
"nodes": [
{
"kind": "text",
"text": "Hello "
},
{
"kind": "arg",
"name": "name"
},
{
"kind": "text",
"text": ", "
},
{
"kind": "plural",
"name": "count",
"exact": [
{
"value": 0,
"nodes": [
4
]
}
],
"categories": [
{
"category": "one",
"nodes": [
5
]
},
{
"category": "other",
"nodes": [
6,
7
]
}
]
},
{
"kind": "text",
"text": "no files"
},
{
"kind": "text",
"text": "one file"
},
{
"kind": "arg",
"name": "count"
},
{
"kind": "text",
"text": " files"
}
],
"cases": [
{
"id": "none",
"variables": {
"name": "Ana",
"count": 0
}
},
{
"id": "several",
"variables": {
"name": "Ana",
"count": 2
}
}
]
}
Example response
{
"operation": "message-variants-render",
"version": "0.29.0",
"result": {
"advisoryOnly": true,
"externalRequests": 0,
"profile": "bounded-message-tree-cldr47-integer-v1",
"locale": "en",
"cases": [
{
"id": "none",
"text": "Hello Ana, no files",
"branches": [
{
"node": 3,
"selected": "=0"
}
]
},
{
"id": "several",
"text": "Hello Ana, 2 files",
"branches": [
{
"node": 3,
"selected": "other"
}
]
}
],
"coverage": [
{
"node": 3,
"visited": [
"=0",
"other"
],
"unvisited": [
"one"
]
}
],
"translationVerified": false,
"escaped": false
},
"provenance": {
"inputSha256": "9c6f1456c7c70aec965865d71fcd320490baa18b73493f18455d3a7dde5e7d88",
"outputSha256": "1097155c3e335474e79c1efb7ed8ed6d15ad7d54090e1723725e2d191324b07c",
"deterministic": true,
"externalRequests": 0
}
}
Bounds and precision
JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.
{
"global": {
"requestBytes": 131072,
"responseBytes": 524288,
"jsonDepth": 32,
"jsonNodes": 20000,
"requestsPerMinute": 60,
"paidAttemptsPerMinute": 20,
"idempotencyHours": 24
},
"operation": {
"inputBytes": 100000,
"outputBytes": 400000,
"jsonNodes": 12000,
"depth": 20,
"nodes": 512,
"branchDepth": 8,
"branchesPerChoice": 16,
"variables": 128,
"cases": 128,
"literalValueBytes": 60000,
"caseTextBytes": 20000,
"totalTextBytes": 200000,
"renderNodeVisits": 65536,
"pluralCountMaximum": 1000000000,
"cldrVersion": "47"
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.005",
"sixDecimalTokenBaseUnits": "5000",
"subscription": false,
"includesPayerWalletOrNetworkFees": false,
"liveQuoteVerified": false,
"condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
}
Protocol definitions: x402, mpp. MPP uses Tempo charge. Paid MCP execution is unsupported. All runtime readiness is not evaluated in this build.
API path templates, not endpoints on this documentation host
{
"x402": "/v1/x402/message-variants-render",
"mpp": "/v1/mpp/message-variants-render"
}
Required headers
{
"Content-Type": "application/json",
"Idempotency-Key": "random 16–128 character operation identifier"
}
Actual SDK challenge amount, asset, network, recipient and wallet costs must pass independent authorization. Preserve identical key, body, protocol and credential on retries; on PAYMENT_UNCERTAIN stop and reconcile.
Execution profile and provider conditions
{
"deterministic": true,
"externalRequests": 0,
"maxExternalRequests": 0,
"resultSnapshotPersisted": false,
"fixedExampleIsIllustrativeSnapshot": false,
"requiresPayment": true,
"supportsMcpExecution": false
}
Deterministic supplied-input operation with no external requests or stored request/result bodies. Payment infrastructure retains payment metadata and hashes.
Failure handling
- HTTP 400: Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch Correct the request before payment
- HTTP 402: Payment challenge or rejected payment Use official protocol SDK; inspect payment outcome before another payment
- HTTP 409: Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay
- HTTP 413: Input or generated output too large Reduce input; no payment attempted for validation failure
- HTTP 415: Unsupported media type or compression Send uncompressed application/json
- HTTP 422: Schema or service-specific semantic validation failure Correct input using returned error code; no payment attempted
- HTTP 429: Request/payment-attempt rate exceeded Wait for rate limit window; preserve existing payment identity
- HTTP 503: Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation
Declared requirements
Before any paid call, refresh the live operation contract and POST the complete bounded budgeted plan to the separate API's /preflight. Unknown requirements block selection; compatible preflight is not permission to spend.