POST
/
v1
/
experimental
/
improve_prompt
cURL
curl -X POST https://api.anthropic.com/v1/experimental/improve_prompt \
     --header "x-api-key: $ANTHROPIC_API_KEY" \
     --header "anthropic-version: 2023-06-01" \
     --header "anthropic-beta: prompt-tools-2025-04-02" \
     --header "content-type: application/json" \
     --data \
'{
    "messages": [{"role": "user", "content": [{"type": "text", "text": "Create a recipe for {{food}}"}]}],
    "system": "You are a professional chef",
    "feedback": "Make it more detailed and include cooking times",
    "target_model": "claude-3-7-sonnet-20250219"
}'
{
  "messages": [
    {
      "content": [
        {
          "text": "<improved prompt>",
          "type": "text"
        }
      ],
      "role": "user"
    },
    {
      "content": [
        {
          "text": "<assistant prefill>",
          "type": "text"
        }
      ],
      "role": "assistant"
    }
  ],
  "system": "",
  "usage": [
    {
      "input_tokens": 490,
      "output_tokens": 661
    }
  ]
}
프롬프트 도구 API는 비공개 연구 미리보기 단계에 있습니다. 비공개 연구 미리보기 참여 요청.

시작하기 전에

프롬프트 도구는 프롬프트를 생성하고 개선하는 API 세트입니다. 다른 API와 달리, 이것은 실험적 API입니다: 액세스를 요청해야 하며, 다른 API와 같은 수준의 장기 지원 약속이 없습니다. 이러한 API는 Anthropic Workbench에서 사용할 수 있는 것과 유사하며, 다른 프롬프트 엔지니어링 플랫폼과 플레이그라운드에서 사용하기 위한 것입니다.

프롬프트 개선기 시작하기

프롬프트 생성 API를 사용하려면 다음이 필요합니다:
  1. 프롬프트 도구 API의 비공개 연구 미리보기에 참여했을 것
  2. SDK가 아닌 API를 직접 사용할 것
  3. 베타 헤더 prompt-tools-2025-04-02 추가할 것
이 API는 SDK에서 사용할 수 없습니다

프롬프트 개선하기

Headers

anthropic-beta
string[]

Optional header to specify the beta version(s) you want to use.

To use multiple betas, use a comma separated list like beta1,beta2 or specify the header multiple times for each beta.

x-api-key
string
required

Your unique API key for authentication.

This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the Console. Each key is scoped to a Workspace.

Body

application/json

Response

Successful Response

The response is of type object.