{
  "id": "http-structured-fields-compose",
  "name": "Typed HTTP structured-field composer",
  "description": "Compose separate exact RFC 8941-compatible structured field values from explicit typed Items, Lists and Dictionaries; preserve decimal types without floating-point rounding.",
  "category": "structured",
  "priceUsd": "0.003",
  "pricingStatus": "proposed-unverified",
  "pricing": {
    "unit": "one successful operation call",
    "proposedNominalUsd": "0.003",
    "sixDecimalTokenBaseUnits": "3000",
    "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": [
    "compose typed HTTP structured fields",
    "serialize RFC 8941 items lists dictionaries",
    "preserve HTTP structured decimal and integer distinction",
    "prepare offline structured header field fixtures"
  ],
  "whenToUse": [
    "Composing caller-declared structured field name/value pairs for offline protocol fixtures",
    "Preserving ordered dictionaries and parameters with explicit string/token/bytes/integer/decimal/boolean types",
    "Rejecting decimal rounding, injection and duplicate keys before handoff"
  ],
  "whenNotToUse": [
    "Parsing existing fields, combining repeated lines or normalizing arbitrary headers",
    "Full RFC 9651 Date and Display String types; this explicit RFC 8941 vocabulary profile excludes them",
    "HTTP Message Signatures, signing, digest verification, authentication, cookies, header policy or application field semantics",
    "Raw HTTP header blocks, requests or transmission",
    "Network requests, writing files, live configuration changes, authentication, publishing or deployment"
  ],
  "capabilities": [
    "Profile http-sf-rfc8941-compose-v1; RFC 9651 supersedes RFC 8941 without silently expanding this vocabulary",
    "Exact decimal-string formatting without rounding; signed zero normalized within its selected integer or decimal type",
    "Preserved field, dictionary and parameter order; boolean-true elision; padded canonical base64",
    "Empty List/Dictionary returns omitted true and null value/hash; caller must omit that field",
    "Deterministic supplied-input-only artifact; no network, clock or randomness",
    "Exact artifact UTF-8 byte lengths and SHA-256 hashes"
  ],
  "related": [
    "content-digest",
    "json-schema-check"
  ],
  "limits": {
    "inputBytes": 100000,
    "outputBytes": 300000,
    "jsonNodes": 12000,
    "depth": 20,
    "fields": 16,
    "fieldValueBytes": 8192,
    "totalValueBytes": 16384,
    "topLevelMembers": 128,
    "innerListItems": 32,
    "parameters": 16,
    "bareItems": 512,
    "keyAsciiBytes": 64,
    "tokenBytes": 256,
    "stringBytes": 1024,
    "decodedByteValueBytes": 2048,
    "profile": "http-sf-rfc8941-compose-v1"
  },
  "errorCodes": [
    "INPUT_LIMIT",
    "OUTPUT_LIMIT",
    "COMPLEXITY_LIMIT",
    "INVALID_JSON",
    "INVALID_NUMBER",
    "INVALID_UNICODE",
    "INVALID_INPUT",
    "UNSAFE_KEY",
    "SF_KEY",
    "SF_ITEM_LIMIT",
    "SF_INTEGER",
    "SF_DECIMAL",
    "SF_STRING",
    "SF_TOKEN",
    "SF_BYTES",
    "SF_BYTES_LIMIT",
    "SF_DUPLICATE_KEY",
    "SF_FIELD_NAME",
    "SF_DUPLICATE_FIELD",
    "SF_FIELD_LIMIT",
    "SF_TOTAL_LIMIT"
  ],
  "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": "http-structured-fields-compose",
      "operation.category": "structured",
      "limit.httpRequestBytes": 131072,
      "limit.requestBytes": 100000,
      "limit.responseBytes": 524288,
      "limit.resultBytes": 300000,
      "limit.jsonDepth": 20,
      "limit.jsonNodes": 12000,
      "serialization.profile": "http-sf-rfc8941-compose-v1",
      "serialization.actions": "compose",
      "serialization.integerMin": "-999999999999999",
      "serialization.integerMax": "999999999999999",
      "serialization.exactDecimalStringIntegers": true,
      "serialization.consumerCompatibilityVerified": false,
      "serialization.determinismScope": "rfc8941-typed-serialization",
      "structuredFields.vocabulary": "rfc8941",
      "structuredFields.maxFields": 16,
      "structuredFields.maxFieldValueBytes": 8192,
      "structuredFields.maxTotalValueBytes": 16384,
      "structuredFields.maxMembersPerField": 128,
      "structuredFields.maxInnerListItems": 32,
      "structuredFields.maxParameters": 16,
      "structuredFields.maxBareItems": 512,
      "structuredFields.exactDecimalStrings": true,
      "structuredFields.decimalFractionDigits": 3,
      "structuredFields.numberRounding": false,
      "structuredFields.preservesDeclaredOrder": true,
      "structuredFields.emptyListDictionaryOmitted": true,
      "structuredFields.parsesExistingFields": false,
      "structuredFields.rfc9651DateDisplayString": false,
      "structuredFields.fieldSemanticsVerified": false,
      "structuredFields.signsMessages": false,
      "structuredFields.sendsRequests": false,
      "input.fields.maxItems": 16
    },
    "unknownPolicy": "Undeclared requirements are unknown, never compatible. Matching declared facts does not establish semantic fit or input validity.",
    "preflight": "/preflight"
  },
  "documentation": "/reference/tools/http-structured-fields-compose.md",
  "serviceContract": "/reference/services/http-structured-fields-compose.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/http-structured-fields-compose",
    "mpp": "/v1/mpp/http-structured-fields-compose"
  },
  "inputSchema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "fields": {
        "maxItems": 16,
        "type": "array",
        "items": {
          "$ref": "#/$defs/__schema0"
        }
      }
    },
    "required": [
      "fields"
    ],
    "additionalProperties": false,
    "$defs": {
      "__schema0": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "kind": {
                "type": "string",
                "const": "item"
              },
              "value": {
                "$ref": "#/$defs/__schema1"
              }
            },
            "required": [
              "name",
              "kind",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "kind": {
                "type": "string",
                "const": "list"
              },
              "value": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema5"
                }
              }
            },
            "required": [
              "name",
              "kind",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "kind": {
                "type": "string",
                "const": "dictionary"
              },
              "value": {
                "maxItems": 128,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema6"
                }
              }
            },
            "required": [
              "name",
              "kind",
              "value"
            ],
            "additionalProperties": false
          }
        ]
      },
      "__schema1": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "item"
          },
          "value": {
            "$ref": "#/$defs/__schema2"
          },
          "parameters": {
            "$ref": "#/$defs/__schema3"
          }
        },
        "required": [
          "kind",
          "value",
          "parameters"
        ],
        "additionalProperties": false
      },
      "__schema2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "integer"
              },
              "value": {
                "type": "string",
                "maxLength": 16
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "decimal"
              },
              "value": {
                "type": "string",
                "maxLength": 17
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "string"
              },
              "value": {
                "type": "string",
                "maxLength": 1024
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "token"
              },
              "value": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "bytes"
              },
              "base64": {
                "type": "string",
                "maxLength": 2732
              }
            },
            "required": [
              "type",
              "base64"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "boolean"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "value"
            ],
            "additionalProperties": false
          }
        ]
      },
      "__schema3": {
        "maxItems": 16,
        "type": "array",
        "items": {
          "$ref": "#/$defs/__schema4"
        }
      },
      "__schema4": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "value": {
            "$ref": "#/$defs/__schema2"
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      },
      "__schema5": {
        "anyOf": [
          {
            "$ref": "#/$defs/__schema1"
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "inner-list"
              },
              "items": {
                "maxItems": 32,
                "type": "array",
                "items": {
                  "$ref": "#/$defs/__schema1"
                }
              },
              "parameters": {
                "$ref": "#/$defs/__schema3"
              }
            },
            "required": [
              "kind",
              "items",
              "parameters"
            ],
            "additionalProperties": false
          }
        ]
      },
      "__schema6": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "value": {
            "$ref": "#/$defs/__schema5"
          }
        },
        "required": [
          "key",
          "value"
        ],
        "additionalProperties": false
      }
    }
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "operation",
      "version",
      "result",
      "provenance"
    ],
    "properties": {
      "operation": {
        "const": "http-structured-fields-compose",
        "type": "string"
      },
      "version": {
        "const": "0.29.0",
        "type": "string"
      },
      "result": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "const": "http-sf-rfc8941-compose-v1"
          },
          "fields": {
            "maxItems": 16,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "item",
                    "list",
                    "dictionary"
                  ]
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 8192
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "byteLength": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8192
                },
                "sha256": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "omitted": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "kind",
                "value",
                "byteLength",
                "sha256",
                "omitted"
              ],
              "additionalProperties": false
            }
          },
          "totalValueBytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 16384
          }
        },
        "required": [
          "profile",
          "fields",
          "totalValueBytes"
        ],
        "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": {
    "fields": [
      {
        "name": "example-field",
        "kind": "dictionary",
        "value": [
          {
            "key": "demo",
            "value": {
              "kind": "inner-list",
              "items": [
                {
                  "kind": "item",
                  "value": {
                    "type": "string",
                    "value": "@method"
                  },
                  "parameters": []
                },
                {
                  "kind": "item",
                  "value": {
                    "type": "string",
                    "value": "@path"
                  },
                  "parameters": []
                }
              ],
              "parameters": [
                {
                  "key": "created",
                  "value": {
                    "type": "integer",
                    "value": "1700000000"
                  }
                },
                {
                  "key": "keyid",
                  "value": {
                    "type": "string",
                    "value": "test-key"
                  }
                }
              ]
            }
          }
        ]
      }
    ]
  },
  "exampleResponse": {
    "operation": "http-structured-fields-compose",
    "version": "0.29.0",
    "result": {
      "profile": "http-sf-rfc8941-compose-v1",
      "fields": [
        {
          "name": "example-field",
          "kind": "dictionary",
          "value": "demo=(\"@method\" \"@path\");created=1700000000;keyid=\"test-key\"",
          "byteLength": 60,
          "sha256": "9549594186c7d71f2acc27b9af7465a6e8702825b92cc5d7a196a689a83f256a",
          "omitted": false
        }
      ],
      "totalValueBytes": 60
    },
    "provenance": {
      "inputSha256": "cb932c2bbf36d20dfa385ebc42387e41d8319f351e288e39c4a77589a100fd87",
      "outputSha256": "6dbcf72ffb8b18b3d6fdc44a3a79541f0f2b2134575242028789cb33f8823e8f",
      "deterministic": true,
      "externalRequests": 0
    }
  },
  "requiredHeaders": {
    "Content-Type": "application/json",
    "Idempotency-Key": "random 16–128 character operation identifier"
  },
  "fixedExample": "/reference/examples/http-structured-fields-compose.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."
  }
}
