Retime and convert literal captions
Convert a strict plain SRT/WebVTT caption file with caller-supplied rational time scaling and offset, returning canonical caption text and an exact cue timing map.
text · Operation ID: captions-retime-convert
Choose this operation when
- Supplied literal caption text with explicit hour timestamps and a known affine millisecond transform
Outside this profile
- Transcription, translation, speaker identification, media access, inferred sync anchors or guaranteed audiovisual alignment
- Rich captions, markup, entities, whitespace-only cue lines, cue settings, STYLE, REGION, NOTE or arbitrary WebVTT identifiers
- Fetching, uploading, sending, writing files, accessing media 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": {
"from": {
"type": "string",
"enum": [
"srt",
"webvtt"
]
},
"to": {
"type": "string",
"enum": [
"srt",
"webvtt"
]
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 60000
},
"timing": {
"type": "object",
"properties": {
"scaleNumerator": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"scaleDenominator": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"offsetMs": {
"type": "integer",
"minimum": -359999999,
"maximum": 359999999
}
},
"required": [
"scaleNumerator",
"scaleDenominator",
"offsetMs"
],
"additionalProperties": false
}
},
"required": [
"from",
"to",
"text",
"timing"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "captions-retime-convert",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"format": {
"type": "string",
"enum": [
"srt",
"webvtt"
]
},
"text": {
"type": "string",
"maxLength": 100000
},
"byteLength": {
"type": "integer",
"minimum": 1,
"maximum": 100000
},
"cues": {
"minItems": 1,
"maxItems": 1000,
"type": "array",
"items": {
"type": "object",
"properties": {
"inputIndex": {
"type": "integer",
"minimum": 0,
"maximum": 999
},
"startMs": {
"type": "integer",
"minimum": 0,
"maximum": 359999999
},
"endMs": {
"type": "integer",
"minimum": 0,
"maximum": 359999999
},
"sourceStartMs": {
"type": "integer",
"minimum": 0,
"maximum": 359999999
},
"sourceEndMs": {
"type": "integer",
"minimum": 0,
"maximum": 359999999
}
},
"required": [
"inputIndex",
"startMs",
"endMs",
"sourceStartMs",
"sourceEndMs"
],
"additionalProperties": false
}
},
"rounding": {
"type": "string",
"const": "nearest-ties-even"
}
},
"required": [
"format",
"text",
"byteLength",
"cues",
"rounding"
],
"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
{
"from": "srt",
"to": "webvtt",
"text": "1\n00:00:01,000 --> 00:00:02,500\nHello\n\n",
"timing": {
"scaleNumerator": 1,
"scaleDenominator": 1,
"offsetMs": 250
}
}
Example response
{
"operation": "captions-retime-convert",
"version": "0.29.0",
"result": {
"format": "webvtt",
"text": "WEBVTT\n\n1\n00:00:01.250 --> 00:00:02.750\nHello\n\n",
"byteLength": 47,
"cues": [
{
"inputIndex": 0,
"startMs": 1250,
"endMs": 2750,
"sourceStartMs": 1000,
"sourceEndMs": 2500
}
],
"rounding": "nearest-ties-even"
},
"provenance": {
"inputSha256": "86618830933272d3a6509644a192dbec754392cc7a3882ed00cd19de4dc7ce88",
"outputSha256": "9963ea0da9e0b915bf16503d12e7c6db4c9cc690b3ec6d64f95b28f9ccc5a2cc",
"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,
"profile": "literal-captions-affine-ms-v1",
"sourceBytes": 60000,
"cues": 1000,
"totalCueTextBytes": 40000,
"linesPerCue": 20,
"captionOutputBytes": 100000,
"maximumTimeMs": 359999999,
"maximumScalePart": 1000000,
"scaleRange": "1/1000 through 1000",
"webvttIds": "all absent or all contiguous numeric 1..N"
}
}
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/captions-retime-convert",
"mpp": "/v1/mpp/captions-retime-convert"
}
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.