Compose HTTP byte-range bodies
Compose exact inert single-range or multipart/byteranges 206 bodies, or an empty 416 artifact, from supplied nonempty Base64 bytes and a strict Range field. Byte-preserving order, offsets, fields and SHA-256; no conditional-request checks or transmission.
protocol-assurance · Operation ID: http-byte-ranges-compose
Choose this operation when
- Create bounded partial-content test artifacts from inline bytes without decoding or contacting a server
Outside this profile
- No remote fetching, request transmission, filesystem access, caching, content decoding or authenticity verification
- No server policy, method, conditional request or If-Range enforcement; callers must check applicability separately
- Not a full HTTP parser: unsupported units, empty list members, inner whitespace and numbers over 20 digits are rejected by this bounded profile
- Empty representations, media-type parameters, automatic boundary generation or boundary tokens appearing anywhere in selected payloads
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": {
"representationBase64": {
"type": "string",
"maxLength": 10924,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$(?![\\s\\S])"
},
"range": {
"type": "string",
"minLength": 1,
"maxLength": 2048,
"pattern": "^[\\x09\\x20-\\x7e]+$(?![\\s\\S])"
},
"mediaType": {
"type": "string",
"minLength": 3,
"maxLength": 127,
"pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$(?![\\s\\S])"
},
"boundary": {
"type": "string",
"minLength": 1,
"maxLength": 60,
"pattern": "^[A-Za-z0-9_-]+$(?![\\s\\S])"
}
},
"required": [
"representationBase64",
"range",
"mediaType"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "http-byte-ranges-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-byte-ranges-body-v1"
},
"representationByteLength": {
"type": "integer",
"minimum": 1,
"maximum": 8192
},
"representationSha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$(?![\\s\\S])"
},
"normalizedRange": {
"type": "string",
"maxLength": 2048
},
"disposition": {
"type": "string",
"enum": [
"single",
"multipart",
"unsatisfiable"
]
},
"statusCode": {
"anyOf": [
{
"type": "number",
"const": 206
},
{
"type": "number",
"const": 416
}
]
},
"headers": {
"minItems": 2,
"maxItems": 3,
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": [
"content-type",
"content-range",
"content-length"
]
},
"value": {
"type": "string",
"maxLength": 256
}
},
"required": [
"name",
"value"
],
"additionalProperties": false
}
},
"bodyBase64": {
"type": "string",
"maxLength": 10924,
"pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$(?![\\s\\S])"
},
"bodyByteLength": {
"type": "integer",
"minimum": 0,
"maximum": 8192
},
"bodySha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$(?![\\s\\S])"
},
"parts": {
"maxItems": 8,
"type": "array",
"items": {
"type": "object",
"properties": {
"rangeIndex": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"sourceStart": {
"type": "integer",
"minimum": 0,
"maximum": 8192
},
"sourceEndExclusive": {
"type": "integer",
"minimum": 0,
"maximum": 8192
},
"contentRange": {
"type": "string",
"maxLength": 80
},
"headerStart": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 8192
},
{
"type": "null"
}
]
},
"bodyStart": {
"type": "integer",
"minimum": 0,
"maximum": 8192
},
"bodyEndExclusive": {
"type": "integer",
"minimum": 0,
"maximum": 8192
}
},
"required": [
"rangeIndex",
"sourceStart",
"sourceEndExclusive",
"contentRange",
"headerStart",
"bodyStart",
"bodyEndExclusive"
],
"additionalProperties": false
}
},
"unsatisfiedIndexes": {
"maxItems": 8,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 7
}
}
},
"required": [
"profile",
"representationByteLength",
"representationSha256",
"normalizedRange",
"disposition",
"statusCode",
"headers",
"bodyBase64",
"bodyByteLength",
"bodySha256",
"parts",
"unsatisfiedIndexes"
],
"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
{
"representationBase64": "MDEyMzQ1Njc4OQ==",
"range": "bytes=0-1,-2",
"mediaType": "application/octet-stream",
"boundary": "asm-demo"
}
Example response
{
"operation": "http-byte-ranges-compose",
"version": "0.29.0",
"result": {
"profile": "http-byte-ranges-body-v1",
"representationByteLength": 10,
"representationSha256": "84d89877f0d4041efb6bf91a16f0248f2fd573e6af05c19f96bedb9f882f7882",
"normalizedRange": "bytes=0-1,-2",
"disposition": "multipart",
"statusCode": 206,
"headers": [
{
"name": "content-type",
"value": "multipart/byteranges; boundary=asm-demo"
},
{
"name": "content-length",
"value": "188"
}
],
"bodyBase64": "LS1hc20tZGVtbw0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NCkNvbnRlbnQtUmFuZ2U6IGJ5dGVzIDAtMS8xMA0KDQowMQ0KLS1hc20tZGVtbw0KQ29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0NCkNvbnRlbnQtUmFuZ2U6IGJ5dGVzIDgtOS8xMA0KDQo4OQ0KLS1hc20tZGVtby0tDQo=",
"bodyByteLength": 188,
"bodySha256": "8c00af0e0d042f38edfe820ff6f399dcab6d90ad91374fd25e639051eda0086a",
"parts": [
{
"rangeIndex": 0,
"sourceStart": 0,
"sourceEndExclusive": 2,
"contentRange": "bytes 0-1/10",
"headerStart": 0,
"bodyStart": 83,
"bodyEndExclusive": 85
},
{
"rangeIndex": 1,
"sourceStart": 8,
"sourceEndExclusive": 10,
"contentRange": "bytes 8-9/10",
"headerStart": 87,
"bodyStart": 170,
"bodyEndExclusive": 172
}
],
"unsatisfiedIndexes": []
},
"provenance": {
"inputSha256": "4f0beb8da86b883826c74719cf6ad2da918d9beb0b5d2fd192f42c8a0bf448f9",
"outputSha256": "f7d4001ede91f24739c26320a912ad4afa297647361157d6eb32f5e2e7075864",
"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": 16384,
"outputBytes": 24576,
"jsonNodes": 128,
"depth": 4,
"rangeBytes": 2048,
"ranges": 8,
"composeRanges": 8,
"integerDigits": 20,
"representationBytes": 8192,
"bodyBytes": 8192,
"mediaTypeBytes": 127,
"boundaryBytes": 60,
"profile": "http-byte-ranges-body-v1"
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.006",
"sixDecimalTokenBaseUnits": "6000",
"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/http-byte-ranges-compose",
"mpp": "/v1/mpp/http-byte-ranges-compose"
}
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.