{
  "id": "cbor-typed-codec",
  "name": "Typed deterministic CBOR codec",
  "description": "Encode typed values or decode a strictly admitted core-deterministic CBOR integer subset with bounded tokens and exact integer precision.",
  "category": "structured",
  "priceUsd": "0.005",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "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."
  },
  "intents": [
    "encode deterministic CBOR",
    "decode typed CBOR",
    "preserve exact CBOR integers and bytes",
    "inspect bounded core deterministic CBOR"
  ],
  "whenToUse": [
    "A declared consumer requires this specific binary format and exact integer/binary distinctions",
    "Create a bounded offline configuration or protocol fixture from supplied typed values"
  ],
  "whenNotToUse": [
    "Floating point, dates, timestamp/tag extensions, missing-value primitives, custom objects, streaming or arbitrary maps",
    "General CBOR, tags, indefinite lengths, unsorted keys or nonpreferred encodings",
    "Legacy length-first CBOR map ordering or dCBOR normalization",
    "Network transport, authentication, signatures, COSE/CWT/WebAuthn, consumer schema validation, or execution of decoded content"
  ],
  "capabilities": [
    "Canonical decimal input strings preserve the full profile integer domain",
    "Unicode scalar text and strict canonical standard padded base64",
    "Duplicate typed keys rejected; text and byte strings remain distinct",
    "Complete semantic computation and result admission before payment challenge and again during execution",
    "Networkless deterministic supplied-input-only artifacts; externalRequests=0",
    "RFC 8949 core bytewise key order; lazy upstream tokens with budgets before materialization, exact one-item consumption and byte-equality re-encoding"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 300000,
    "jsonNodes": 12000,
    "jsonDepth": 20,
    "wireBytes": 40000,
    "contentBytes": 32768,
    "valueNodes": 1024,
    "arrayItems": 512,
    "mapPairs": 128,
    "valueDepth": 5,
    "cborKeyBytes": 128,
    "messagepackKeyBytes": 64,
    "profile": "cbor-core-deterministic-integer-v1",
    "actions": "encode,decode",
    "integerMinimum": "-18446744073709551616",
    "integerMaximum": "18446744073709551615",
    "mapKeys": "Typed integers or scalar text <=128 UTF-8 bytes; reserved text names rejected",
    "determinismScope": "RFC8949-core-subset"
  },
  "related": [
    "messagepack-compose",
    "protobuf-message-compose",
    "zip-store-compose"
  ],
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "UNSAFE_KEY",
    "INVALID_INTEGER",
    "INTEGER_RANGE",
    "INVALID_KEY",
    "DUPLICATE_KEY",
    "INVALID_ENCODING",
    "UNSUPPORTED_TYPE",
    "NONDETERMINISTIC_ENCODING",
    "ENCODING_MISMATCH"
  ],
  "requirementsProfile": {
    "format": "declared-requirements-v1",
    "facts": {
      "execution.suppliedCode": false,
      "execution.remoteMutation": false,
      "execution.llmInference": false,
      "execution.paidMcp": false,
      "verification.semanticTruth": false,
      "verification.sourceAuthenticity": false,
      "verification.liveVulnerabilities": false,
      "numbers.arbitraryPrecisionJson": false,
      "numbers.model": "ieee754-binary64",
      "privacy.requestBodyPersisted": false,
      "execution.deterministic": true,
      "execution.networkAccess": false,
      "privacy.resultBodyPersisted": false,
      "payment.x402": true,
      "payment.mpp": true,
      "operation.id": "cbor-typed-codec",
      "operation.category": "structured",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 300000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "serialization.profile": "cbor-core-deterministic-integer-v1",
      "serialization.actions": "encode,decode",
      "serialization.integerMin": "-18446744073709551616",
      "serialization.integerMax": "18446744073709551615",
      "serialization.mapKeyPolicy": "exact-typed-integer-or-text-no-reserved-text-keys",
      "serialization.determinismScope": "rfc8949-core-deterministic-subset",
      "serialization.decoderAvailable": true,
      "serialization.decoderAcceptsNonDeterministic": false,
      "serialization.maxMapKeyBytes": 128,
      "serialization.exactDecimalStringIntegers": true,
      "serialization.unicodePolicy": "unicode-scalars-no-normalization",
      "serialization.base64Policy": "rfc4648-standard-padded-canonical",
      "serialization.consumerCompatibilityVerified": false,
      "serialization.maxValueDepth": 5,
      "serialization.maxSemanticNodes": 1024,
      "serialization.maxArrayItems": 512,
      "serialization.maxMapPairs": 128,
      "serialization.maxWireBytes": 40000,
      "serialization.maxContentBytes": 32768,
      "serialization.floatTypes": false,
      "serialization.tagsOrExtensions": false,
      "serialization.streaming": false,
      "serialization.fullFormatVocabulary": false
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/cbor-typed-codec.md",
  "serviceContract": "/reference/services/cbor-typed-codec.json",
  "errors": [
    {
      "status": 400,
      "meaning": "Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch",
      "retry": "Correct the request before payment"
    },
    {
      "status": 402,
      "meaning": "Payment challenge or rejected payment",
      "retry": "Use official protocol SDK; inspect payment outcome before another payment"
    },
    {
      "status": 409,
      "meaning": "Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN",
      "retry": "Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay"
    },
    {
      "status": 413,
      "meaning": "Input or generated output too large",
      "retry": "Reduce input; no payment attempted for validation failure"
    },
    {
      "status": 415,
      "meaning": "Unsupported media type or compression",
      "retry": "Send uncompressed application/json"
    },
    {
      "status": 422,
      "meaning": "Schema or service-specific semantic validation failure",
      "retry": "Correct input using returned error code; no payment attempted"
    },
    {
      "status": 429,
      "meaning": "Request/payment-attempt rate exceeded",
      "retry": "Wait for rate limit window; preserve existing payment identity"
    },
    {
      "status": 503,
      "meaning": "Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement",
      "retry": "Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation"
    }
  ],
  "numericPrecision": "JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.",
  "paymentWorkflow": {
    "discoveryOnly": false,
    "supportedProtocols": [
      "x402",
      "mpp"
    ],
    "x402": {
      "credentialHeader": "PAYMENT-SIGNATURE",
      "challengeHeader": "PAYMENT-REQUIRED",
      "receiptHeader": "PAYMENT-RESPONSE",
      "version": 2,
      "scheme": "exact",
      "paymentIdentifier": "payment-identifier extension MUST equal the HTTP Idempotency-Key",
      "sdk": "@x402/core with @x402/evm"
    },
    "mpp": {
      "supported": true,
      "credentialHeader": "Authorization",
      "challengeHeader": "WWW-Authenticate",
      "receiptHeader": "Payment-Receipt",
      "method": "tempo",
      "intent": "charge",
      "sdk": "mppx",
      "tokenDecimals": 6
    },
    "steps": [
      "Check configured readiness and the exact service schema",
      "Generate a fresh random Idempotency-Key for this operation; never use a discovery probe fixture for purchases",
      "Send valid input without a credential to obtain the official protocol challenge",
      "Use the official SDK and authorized wallet to fulfill the challenge",
      "Retry only with identical key, body, protocol and credential",
      "On PAYMENT_UNCERTAIN stop and request operator reconciliation; never blindly pay again"
    ],
    "versionedRetries": "Request fingerprint includes service release version. Retries across a version upgrade can conflict; coordinate upgrades outside the 24-hour replay window and reconcile pending attempts.",
    "docs": "/llms.txt"
  },
  "method": "POST",
  "paths": {
    "x402": "/v1/x402/cbor-typed-codec",
    "mpp": "/v1/mpp/cbor-typed-codec"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "const": "encode"
          },
          "value": {
            "$ref": "#/$defs/__schema0"
          }
        },
        "required": [
          "action",
          "value"
        ],
        "additionalProperties": false
      },
      {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "const": "decode"
          },
          "base64": {
            "type": "string",
            "maxLength": 53336
          }
        },
        "required": [
          "action",
          "base64"
        ],
        "additionalProperties": false
      }
    ],
    "$defs": {
      "__schema0": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "null"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "boolean"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "integer"
              },
              "value": {
                "type": "string",
                "maxLength": 21
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "text"
              },
              "value": {
                "type": "string",
                "maxLength": 32768
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "bytes"
              },
              "base64": {
                "type": "string",
                "maxLength": 43692
              }
            },
            "required": [
              "type",
              "base64"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "array"
              },
              "items": {
                "maxItems": 512,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema0"
                }
              }
            },
            "required": [
              "type",
              "items"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "map"
              },
              "entries": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "integer"
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 21
                            }
                          },
                          "required": [
                            "type",
                            "value"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "text"
                            },
                            "value": {
                              "type": "string",
                              "maxLength": 32768
                            }
                          },
                          "required": [
                            "type",
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "value": {
                      "$ref": "#/$defs/__schema0"
                    }
                  },
                  "required": [
                    "key",
                    "value"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "entries"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "cbor-typed-codec",
        "type": "string"
      },
      "version": {
        "const": "0.29.0",
        "type": "string"
      },
      "result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "profile": {
                "type": "string",
                "const": "cbor-core-deterministic-integer-v1"
              },
              "action": {
                "type": "string",
                "const": "encode"
              },
              "base64": {
                "type": "string",
                "maxLength": 53336
              },
              "byteLength": {
                "type": "integer",
                "minimum": 1,
                "maximum": 40000
              },
              "valueCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1024
              },
              "maxValueDepth": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              "deterministic": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "profile",
              "action",
              "base64",
              "byteLength",
              "valueCount",
              "maxValueDepth",
              "deterministic"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "profile": {
                "type": "string",
                "const": "cbor-core-deterministic-integer-v1"
              },
              "action": {
                "type": "string",
                "const": "decode"
              },
              "value": {
                "$ref": "#/properties/result/$defs/__schema0"
              },
              "byteLength": {
                "type": "integer",
                "minimum": 1,
                "maximum": 40000
              },
              "valueCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1024
              },
              "maxValueDepth": {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              "deterministic": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "profile",
              "action",
              "value",
              "byteLength",
              "valueCount",
              "maxValueDepth",
              "deterministic"
            ],
            "additionalProperties": false
          }
        ],
        "$defs": {
          "__schema0": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "null"
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "boolean"
                  },
                  "value": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "integer"
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 21
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "text"
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 32768
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bytes"
                  },
                  "base64": {
                    "type": "string",
                    "maxLength": 43692
                  }
                },
                "required": [
                  "type",
                  "base64"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "array"
                  },
                  "items": {
                    "maxItems": 512,
                    "type": "array",
                    "items": {
                      "$ref": "#/properties/result/$defs/__schema0"
                    }
                  }
                },
                "required": [
                  "type",
                  "items"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "map"
                  },
                  "entries": {
                    "maxItems": 128,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "integer"
                                },
                                "value": {
                                  "type": "string",
                                  "maxLength": 21
                                }
                              },
                              "required": [
                                "type",
                                "value"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "text"
                                },
                                "value": {
                                  "type": "string",
                                  "maxLength": 32768
                                }
                              },
                              "required": [
                                "type",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "value": {
                          "$ref": "#/properties/result/$defs/__schema0"
                        }
                      },
                      "required": [
                        "key",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type",
                  "entries"
                ],
                "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
  },
  "exampleInput": {
    "action": "encode",
    "value": {
      "type": "map",
      "entries": [
        {
          "key": {
            "type": "integer",
            "value": "24"
          },
          "value": {
            "type": "text",
            "value": "x"
          }
        },
        {
          "key": {
            "type": "integer",
            "value": "-1"
          },
          "value": {
            "type": "text",
            "value": "y"
          }
        }
      ]
    }
  },
  "exampleResponse": {
    "operation": "cbor-typed-codec",
    "version": "0.29.0",
    "result": {
      "profile": "cbor-core-deterministic-integer-v1",
      "action": "encode",
      "base64": "ohgYYXggYXk=",
      "byteLength": 8,
      "valueCount": 5,
      "maxValueDepth": 1,
      "deterministic": true
    },
    "provenance": {
      "inputSha256": "7b9af4d66effddb96c02ddd45a9d116696f260b408666efb5c2359edfca7a086",
      "outputSha256": "4178363f71c33a301c6ad2e9d333d706e7ddcd0a1a772cd6f1a9fa8e7b559ee1",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/cbor-typed-codec.json",
  "execution": {
    "deterministic": true,
    "externalRequests": 0,
    "maxExternalRequests": 0,
    "resultSnapshotPersisted": false,
    "fixedExampleIsIllustrativeSnapshot": false,
    "requiresPayment": true,
    "supportsMcpExecution": false
  },
  "releaseSnapshot": {
    "format": "static-release-reference-v1",
    "sourceVersion": "0.29.0",
    "sourceRegistrySha256": "a2b5ec09bf6c38b9d2879d746a4fded374f5928b445377b0270ef6aa8e6cac65",
    "generatedAt": "2026-10-06T15:38:00Z",
    "releaseAcceptance": "not-verified-by-generator",
    "runtimeReadiness": "not-evaluated",
    "livePaymentsVerified": false,
    "indexingVerified": false,
    "apiOrigin": null,
    "notice": "Build-time release reference. Runtime readiness, deployment, payment settlement and external indexing are not evaluated here. Prices are proposed; this file cannot authorize execution or payment."
  }
}
