---
title: "Improve Prompt Endpoint"
method: POST
path: "/assist/improve-prompt"
tags: ["assist"]
---

# Improve Prompt Endpoint

`POST /assist/improve-prompt`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/assist/improve-prompt`
- Auth: none declared

## Request body

- ImprovePromptIn
  - `field` 'persona' | 'task' | 'greeting' | 'storyline_task' | 'storyline_opening' | 'storyline_ai_trigger' | 'storyline_ai_criteria' | 'skill_description' | 'skill_instructions' | 'kb_description' | 'kb_instructions', required: 在编辑哪个字段，决定改写目标（见 app/assist/prompt_helper.py 的 FIELDS）
  - `current` string: 该字段当前的文字；留空表示从零起草
  - `hint` string: 用户这次想要的方向/提示；留空则做通用打磨
  - `context` object

## Response `200`

Successful Response

- ImprovePromptOut
  - `improved` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
