Browse operation contracts · Static machine index · OpenAPI release reference · Build manifest

Render literal templates

Use to fill deterministic text templates without evaluating code. Replaces only exact {{name}} placeholders, where names use ASCII letters/digits/underscore/dot/hyphen and start with a letter or underscore. Values are literal strings and are never re-expanded or escaped for HTML/SQL. All recognized variables must exist; other brace syntax stays literal. At most 1,000 variables, 5,000 replacements, 200,000 value units, and 500,000 output units.

text · Operation ID: template-render

Choose this operation when

Outside this profile

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": {
    "template": {
      "type": "string",
      "maxLength": 100000
    },
    "variables": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,63}$"
      },
      "additionalProperties": {
        "type": "string",
        "maxLength": 100000
      }
    }
  },
  "required": [
    "template",
    "variables"
  ],
  "additionalProperties": false
}

Complete output-envelope schema

{
  "type": "object",
  "required": [
    "operation",
    "version",
    "result",
    "provenance"
  ],
  "properties": {
    "operation": {
      "const": "template-render",
      "type": "string"
    },
    "version": {
      "const": "0.29.0",
      "type": "string"
    },
    "result": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 500000
        },
        "replacements": {
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        },
        "usedVariables": {
          "maxItems": 1000,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,63}$"
          }
        },
        "unusedVariables": {
          "maxItems": 1000,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_.-]{0,63}$"
          }
        }
      },
      "required": [
        "text",
        "replacements",
        "usedVariables",
        "unusedVariables"
      ],
      "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

{
  "template": "Hello {{name}}. Job {{job.id}} is {{status}}.",
  "variables": {
    "name": "Agent",
    "job.id": "42",
    "status": "ready"
  }
}

Example response

{
  "operation": "template-render",
  "version": "0.29.0",
  "result": {
    "text": "Hello Agent. Job 42 is ready.",
    "replacements": 3,
    "usedVariables": [
      "name",
      "job.id",
      "status"
    ],
    "unusedVariables": []
  },
  "provenance": {
    "inputSha256": "74c5341f54ebf864062d826d738704c9fe696c156245de26dc47c5706e153e36",
    "outputSha256": "d560ec304b0aa814026d40d835fd6f23ee29f356291f0cfdca3296cd2cfda8d7",
    "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": {
    "requestBytes": 131072,
    "responseBytes": 524288,
    "jsonDepth": 32
  }
}

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/template-render",
  "mpp": "/v1/mpp/template-render"
}

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

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.

Related contracts