Improve a prompt
⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/prompts/improveRewrite an existing prompt against feedback you give and, optionally, examples where it went wrong. The response returns the new prompt and a list of what changed and why, so you can review the diff before adopting it, then compare both with an evaluation run.
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 |
|---|---|---|---|
system | string | Yes | The current system prompt. |
messages | array | No | The current user template. |
feedback | string | Yes | What should change, up to 2,000 characters. |
failing_examples | array | No | Up to 10 {input, output, expected} cases. |
target_model | string | No |
Response
200 OK, Content-Type: application/json
{
"system": "You answer customer questions for Acme's online shop.\n\nRules:\n- Keep replies under 120 words.\n- Only state policies listed in <policies>. If a question is not covered, say you will pass it to a colleague.\n…",
"changes": [
{
"change": "Added a length limit",
"reason": "Feedback: answers too long."
},
{
"change": "Restricted claims to listed policies",
"reason": "Failing example promised a refund that is not offered."
}
],
"usage": {
"input_tokens": 2210,
"output_tokens": 712
}
}| Field | Type | Description |
|---|---|---|
changes | array | Each edit with the reason for it. |
Examples
curl -sS "https://app.syntic.ai/v1/prompts/improve" \
-H "Authorization: Bearer $SYNTIC_API_KEY" \
-H "syntic-beta: prompt-tools-2026-12-01" \
-H "Content-Type: application/json" \
-d '{
"system": "You are a helpful support agent. Answer the customer.",
"feedback": "Answers are too long and sometimes promise refunds we do not offer.",
"failing_examples": [
{
"input": "Can I return a sale item?",
"output": "Of course! We'll refund you in full…",
"expected": "Sale items are exchange-only within 14 days."
}
]
}'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?