Catalog/llm-template-render

LLM

Prompt template render API

Renders a {{mustache}}-style prompt template with variable substitution, {{#if}} conditionals, {{#each}} loops, and dotted paths — no eval, fully deterministic — and reports which variables were used and which were referenced but missing. Answers 'how do I fill a prompt template with these variables?', 'which template variables am I missing?'.

Price$0.02per request
MethodPOST
Route/v1/llm/template-render
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
llmtemplatemustacherenderprompthandlebarsinterpolateagent
API URLhttps://x402.hexl.dev/v1/llm/template-render
Integration docs
Example request
{
  "template": "Hi {{name}}!{{#if items}} You have:{{#each items}} - {{this}}{{/each}}{{/if}}",
  "vars": {
    "name": "Ada",
    "items": [
      "x",
      "y"
    ]
  }
}
Example response
{
  "rendered": "Hi Ada! You have: - x - y",
  "usedVars": [
    "items",
    "this",
    "name"
  ],
  "missingVars": []
}
Input schema
{
  "type": "object",
  "required": [
    "template",
    "vars"
  ],
  "properties": {
    "template": {
      "type": "string",
      "examples": [
        "Hi {{name}}!{{#if items}} You have:{{#each items}} - {{this}}{{/each}}{{/if}}"
      ]
    },
    "vars": {
      "type": "object"
    },
    "htmlEscape": {
      "type": "boolean",
      "default": false
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}