Templatize a prompt
⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/prompts/templatizeTake 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
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <key>: a private inference key (sk_live_...). See Authentication. |
syntic-beta | Yes, while in preview | prompt-tools-2026-12-01. Without it the call fails with 400 beta_required. See Versioning. |
Content-Type | Yes | application/json |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
text | string | Yes | A filled-in prompt. |
max_variables | integer | No | Default 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
}
}| Field | Type | Description |
|---|---|---|
template | string | The prompt with variables. |
variables | object | The 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:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 401 | authentication_error | invalid_api_key | The key is missing, unknown, revoked or expired. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Was this page helpful?