Compose an ASCII QR matrix or SVG
Encode 1–64 supplied printable ASCII bytes as a bounded Model 2 QR code using explicit version, error correction and mask; return unbordered module rows or inert black-and-white SVG with a four-module quiet zone.
structured · Operation ID: qr-code-compose
Choose this operation when
- Caller-selected version 1–5, ECC and mask for a short printable ASCII payload
Outside this profile
- Opening or judging encoded URLs, verifying destination safety, authenticating payloads or transferring funds
- Unicode/ECI, arbitrary binary, automatic segmentation/version/ECC, Kanji, micro-QR, logos, colors or camera/print reliability guarantees
- Rendering, printing, writing files, uploading, publishing, or changing remote state
- Supplying custom SVG, HTML, CSS, fonts, images, links, scripts or external resources
- Guaranteeing font appearance, printer alignment, source authenticity or accessibility compliance
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",
"minLength": 1,
"maxLength": 64,
"pattern": "^[\\x20-\\x7e]+$"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"errorCorrection": {
"type": "string",
"enum": [
"L",
"M",
"Q",
"H"
]
},
"mask": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"output": {
"type": "string",
"enum": [
"matrix",
"svg"
]
}
},
"required": [
"text",
"version",
"errorCorrection",
"mask",
"output"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "qr-code-compose",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "byte"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"errorCorrection": {
"type": "string",
"enum": [
"L",
"M",
"Q",
"H"
]
},
"mask": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"moduleCount": {
"anyOf": [
{
"type": "number",
"const": 21
},
{
"type": "number",
"const": 25
},
{
"type": "number",
"const": 29
},
{
"type": "number",
"const": 33
},
{
"type": "number",
"const": 37
}
]
},
"quietZone": {
"type": "number",
"const": 4
},
"matrix": {
"minItems": 21,
"maxItems": 37,
"type": "array",
"items": {
"type": "string",
"pattern": "^[01]{21,37}$"
}
}
},
"required": [
"mode",
"version",
"errorCorrection",
"mask",
"moduleCount",
"quietZone",
"matrix"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"const": "byte"
},
"version": {
"type": "integer",
"minimum": 1,
"maximum": 5
},
"errorCorrection": {
"type": "string",
"enum": [
"L",
"M",
"Q",
"H"
]
},
"mask": {
"type": "integer",
"minimum": 0,
"maximum": 7
},
"moduleCount": {
"anyOf": [
{
"type": "number",
"const": 21
},
{
"type": "number",
"const": 25
},
{
"type": "number",
"const": 29
},
{
"type": "number",
"const": 33
},
{
"type": "number",
"const": 37
}
]
},
"quietZone": {
"type": "number",
"const": 4
},
"svg": {
"type": "string"
}
},
"required": [
"mode",
"version",
"errorCorrection",
"mask",
"moduleCount",
"quietZone",
"svg"
],
"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",
"version": 1,
"errorCorrection": "M",
"mask": 0,
"output": "matrix"
}
Example response
{
"operation": "qr-code-compose",
"version": "0.29.0",
"result": {
"mode": "byte",
"version": 1,
"errorCorrection": "M",
"mask": 0,
"moduleCount": 21,
"quietZone": 4,
"matrix": [
"111111100111001111111",
"100000101011101000001",
"101110100010001011101",
"101110100100001011101",
"101110101100101011101",
"100000100010101000001",
"111111101010101111111",
"000000000001100000000",
"101010100011000010010",
"100111000100001000110",
"010000101110100010001",
"101010000110001000100",
"101001101010101010101",
"000000001111010101010",
"111111100001011101111",
"100000100101110111000",
"101110101101011101101",
"101110100000001000110",
"101110101100100010001",
"100000100110001000110",
"111111101000101010111"
]
},
"provenance": {
"inputSha256": "22c0c673c1ebd25bc94fdf4bd3a38024646b8f8d3ff9eb2bb358a9624bdf9d12",
"outputSha256": "89e8b2d4b7d5671b44b869934c159f4c635f627316c8f5cc8ef089d71ac07a28",
"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": "qr-model2-ascii-byte-v1",
"payloadAsciiBytes": 64,
"minimumVersion": 1,
"maximumVersion": 5,
"maximumModuleCount": 37,
"quietZoneModules": 4,
"maximumProjectedResultBytes": 20000
}
}
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/qr-code-compose",
"mpp": "/v1/mpp/qr-code-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.