API referencePrompt toolsTemplatize a prompt

Templatize a prompt

⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/prompts/templatize

Take a prompt with concrete values written into it and pull those values out into named {{variables}}, so the same prompt can be reused across requests and datasets.

For how this fits into a full workflow, see Prompt generator and improver.

Headers

HeaderRequiredValue
AuthorizationYesBearer <key>: a private inference key (sk_live_...). See Authentication.
syntic-betaYes, while in previewprompt-tools-2026-12-01. Without it the call fails with 400 beta_required. See Versioning.
Content-TypeYesapplication/json

Body parameters

ParameterTypeRequiredNotes
textstringYesA filled-in prompt.
max_variablesintegerNoDefault 10.

Response

200 OK, Content-Type: application/json

{
  "template": "Translate the following product description into {{target_language}} for our {{store_location}} store, keeping the brand name {{brand_name}} untranslated: '{{description}}'",
  "variables": {
    "target_language": "German",
    "store_location": "Berlin",
    "brand_name": "Lumen",
    "description": "A lamp that dims with the sunset."
  },
  "usage": {
    "input_tokens": 320,
    "output_tokens": 88
  }
}
FieldTypeDescription
templatestringThe prompt with variables.
variablesobjectThe values found in your text, ready to use as a first dataset item.

Examples

curl -sS "https://app.syntic.ai/v1/prompts/templatize" \
  -H "Authorization: Bearer $SYNTIC_API_KEY" \
  -H "syntic-beta: prompt-tools-2026-12-01" \
  -H "Content-Type: application/json" \
  -d '{
      "text": "Translate the following product description into German for our Berlin store, keeping the brand name Lumen untranslated: 'A lamp that dims with the sunset.'"
    }'

Errors

Errors use the error envelope and carry a request_id. Codes specific to this operation:

StatustypecodeWhen
400invalid_request_errorbeta_requiredThe syntic-beta header is missing.
401authentication_errorinvalid_api_keyThe key is missing, unknown, revoked or expired.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.
Was this page helpful?