create_prompt
Create a new prompt template and initial version. Accepts plain text or structured chat messages, returns prompt id, slug, and version id.
Instructions
Create a new prompt template and initial version. Use this for first-time setup; use migrate_prompt for idempotent CI/CD flows. Accepts plain text or structured chat messages, creates a new version immediately, and returns the prompt id, slug, and version id. For multi-message chat prompts pass messages (preferred) or a JSON-encoded array as string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Display name for the prompt | |
| collection_id | Yes | Collection ID to organize the prompt in (use list_collections to find) | |
| string | No | Legacy prompt template string. Use plain text for single-message prompts, or a JSON-encoded messages array string for multi-message chat prompts. | |
| messages | No | Structured chat template alias. Serialized to the legacy string format before creation. | |
| parameters | Yes | Default values for template variables | |
| virtual_key | Yes | Virtual key slug for model access | |
| model | No | Model identifier (e.g., 'gpt-4', 'claude-3-opus'). Required unless ai_model_id or finetune_id is provided | |
| ai_model_id | No | AI model ID (alternative to model). Required unless model or finetune_id is provided | |
| finetune_id | No | Fine-tune ID (alternative to model). Required unless model or ai_model_id is provided | |
| version_description | No | Description for this prompt version | |
| template_metadata | No | Custom metadata (app, env, source_file, etc.) | |
| functions | No | Function definitions for function calling | |
| tools | No | Tool definitions for tool use | |
| tool_choice | No | Tool choice strategy | |
| dry_run | No | When true, validate without creating |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |