Improve a prompt

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

Rewrite 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

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
systemstringYesThe current system prompt.
messagesarrayNoThe current user template.
feedbackstringYesWhat should change, up to 2,000 characters.
failing_examplesarrayNoUp to 10 {input, output, expected} cases.
target_modelstringNo

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
  }
}
FieldTypeDescription
changesarrayEach 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:

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?