プロンプトを生成する
適切に記述されたプロンプトを生成する
プロンプトツールAPIは非公開の研究プレビュー段階にあります。非公開研究プレビューへの参加をリクエストする。
始める前に
プロンプトツールは、プロンプトを生成および改善するためのAPIセットです。他のAPIとは異なり、これは実験的なAPIです:アクセスをリクエストする必要があり、他のAPIと同レベルの長期的なサポートは保証されていません。
これらのAPIはAnthropic Workbenchで利用可能なものと同様で、他のプロンプトエンジニアリングプラットフォームやプレイグラウンドでの使用を想定しています。
プロンプトジェネレーターを使い始める
プロンプト生成APIを使用するには、以下が必要です:
- プロンプトツールAPIの非公開研究プレビューに参加していること
- SDKではなく、APIを直接使用すること
- ベータヘッダー
prompt-tools-2025-04-02
を追加すること
このAPIはSDKでは利用できません
プロンプトを生成する
Headers
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.
Body
Description of the prompt's purpose.
The task
parameter tells Claude what the prompt should do or what kind of role or functionality you want to create. This helps guide the prompt generation process toward your intended use case.
Example:
{"task": "a chef for a meal prep planning service"}
The model this prompt will be used for. This optional parameter helps us understand which models our prompt tools are being used with, but it doesn't currently affect functionality.
Example:
"claude-3-7-sonnet-20250219"
1 - 256
Response
The response contains a list of message objects in the same format used by the Messages API. Typically includes a user message with the complete generated prompt text, and may include an assistant message with a prefill to guide the model's initial response.
These messages can be used directly in a Messages API request to start a conversation with the generated prompt.
Example:
{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "You are a chef for a meal prep planning service..."
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "<recipe_planning>"
}
]
}
]
}
Currently, the system
field is always returned as an empty string (""). In future iterations, this field may contain generated system prompts.
Directions similar to what would normally be included in a system prompt are included in messages
when generating a prompt.
Usage information
Was this page helpful?