Literal-boundary UTF-8 windows
Create source-preserving UTF-8-byte-bounded text windows with literal double-LF, LF and ASCII-space cut priority, scalar-safe overlap, exact UTF-16/UTF-8 spans and an aggregate duplication budget.
text · Operation ID: text-boundary-segment
Choose this operation when
- Creating scalar-safe UTF-8 payload windows from supplied Unicode text
- Favoring literal double-LF, LF and ASCII-space boundaries with exact core reconstruction
- Bounding aggregate source-byte duplication independently of per-chunk overlap
Outside this profile
- Model tokenizer limits, token costs, embedding or semantic retrieval
- Sentence, grapheme, word, CommonMark or Unicode line segmentation
- Source authenticity, linguistic understanding, normalization or privacy redaction
- Fetching sources, writing files, model calls, target execution or changing external state
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": {
"text": {
"type": "string",
"maxLength": 60000
},
"maxChunkBytes": {
"type": "integer",
"minimum": 8,
"maximum": 8192
},
"overlapBytes": {
"type": "integer",
"minimum": 0,
"maximum": 2048
},
"maxDuplicatedBytes": {
"type": "integer",
"minimum": 0,
"maximum": 60000
}
},
"required": [
"text",
"maxChunkBytes",
"overlapBytes",
"maxDuplicatedBytes"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "text-boundary-segment",
"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": "literal-boundary-utf8-windows-v1"
},
"sourceBytes": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"returnedTextBytes": {
"type": "integer",
"minimum": 0,
"maximum": 120000
},
"duplicatedBytes": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"chunks": {
"maxItems": 512,
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"end": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"startByte": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"endByte": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"coreStart": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"coreEnd": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"coreStartByte": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"coreEndByte": {
"type": "integer",
"minimum": 0,
"maximum": 60000
},
"text": {
"type": "string",
"maxLength": 8192
},
"utf8Bytes": {
"type": "integer",
"minimum": 1,
"maximum": 8192
},
"overlapBytes": {
"type": "integer",
"minimum": 0,
"maximum": 2048
},
"boundary": {
"type": "string",
"enum": [
"double-lf",
"lf",
"ascii-space",
"scalar-limit",
"end"
]
}
},
"required": [
"start",
"end",
"startByte",
"endByte",
"coreStart",
"coreEnd",
"coreStartByte",
"coreEndByte",
"text",
"utf8Bytes",
"overlapBytes",
"boundary"
],
"additionalProperties": false
}
}
},
"required": [
"profile",
"sourceBytes",
"returnedTextBytes",
"duplicatedBytes",
"chunks"
],
"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
{
"text": "A😀 B C",
"maxChunkBytes": 8,
"overlapBytes": 2,
"maxDuplicatedBytes": 1
}
Example response
{
"operation": "text-boundary-segment",
"version": "0.29.0",
"result": {
"profile": "literal-boundary-utf8-windows-v1",
"sourceBytes": 9,
"returnedTextBytes": 10,
"duplicatedBytes": 1,
"chunks": [
{
"start": 0,
"end": 4,
"startByte": 0,
"endByte": 6,
"coreStart": 0,
"coreEnd": 4,
"coreStartByte": 0,
"coreEndByte": 6,
"text": "A😀 ",
"utf8Bytes": 6,
"overlapBytes": 0,
"boundary": "ascii-space"
},
{
"start": 3,
"end": 7,
"startByte": 5,
"endByte": 9,
"coreStart": 4,
"coreEnd": 7,
"coreStartByte": 6,
"coreEndByte": 9,
"text": " B C",
"utf8Bytes": 4,
"overlapBytes": 1,
"boundary": "end"
}
]
},
"provenance": {
"inputSha256": "96f0ba6f9e9528c0885e699141905fb70393489c27189f4aecbc5c5ec38c1602",
"outputSha256": "6f7758dd5b440e564c1865a1407a6a63ed19a29762fb88f4f85adb4c4f1d82f1",
"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": 300000,
"jsonNodes": 10000,
"depth": 20,
"profile": "literal-boundary-utf8-windows-v1",
"textUtf8Bytes": 60000,
"textUtf16Units": 60000,
"maxChunkBytes": 8192,
"minChunkBytes": 8,
"overlapBytes": 2048,
"minimumCoreCapacity": 4,
"maxDuplicatedBytes": 60000,
"chunks": 512,
"returnedTextUtf8Bytes": 120000,
"boundarySearchProbes": 20000
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.004",
"sixDecimalTokenBaseUnits": "4000",
"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/text-boundary-segment",
"mpp": "/v1/mpp/text-boundary-segment"
}
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.