The
prompts functions are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.List Prompts
Lists prompts available to the client, sorted by update date with the most recently updated prompts first. Returns a paginated list ofPrompt objects.
Create a Prompt
Creates a new prompt with an initial version. Returns aPromptWithVersion containing the created prompt and its initial version.
With Invocation Parameters
Get a Prompt
Gets a prompt by its name or ID. The response always includes a resolved version. By default the latest version is returned. UseversionId or label to resolve a specific version instead (mutually exclusive). Returns a PromptWithVersion.
Update a Prompt
Updates a prompt’s metadata by its name or ID. Currently supports updating the description (passnull to clear it). Returns the updated Prompt.
Delete a Prompt
Deletes a prompt by its name or ID. This operation is irreversible.Manage Versions
List Versions
Lists all versions of a prompt, sorted by creation date with the most recently created first. Returns a paginated list ofPromptVersion objects.
Create a New Version
Creates a new version of an existing prompt. Returns the createdPromptVersion.
Get a Version by ID
Gets a single prompt version by its ID. Version IDs are pure IDs with no name resolution. Returns thePromptVersion.
Manage Labels
Labels are mutable pointers to a specific version. Use them to decouple application code from version IDs — update the label when promoting a new version without changing any application code.Get a Version by Label
Resolves a label on a prompt to the version it points to. Returns the fullPromptVersion that the label currently references.
Set Labels on a Version
Sets (replaces) all labels on a prompt version. This is an idempotent operation. If a label already exists on another version of the same prompt, it will be moved to this version. Labels not included in the request will be removed from this version. Returns the updatedPromptVersion, whose labels field reflects the new set.