Skip to main content
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 of Prompt objects.

Create a Prompt

Creates a new prompt with an initial version. Returns a PromptWithVersion 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. Use versionId 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 (pass null 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 of PromptVersion objects.

Create a New Version

Creates a new version of an existing prompt. Returns the created PromptVersion.

Get a Version by ID

Gets a single prompt version by its ID. Version IDs are pure IDs with no name resolution. Returns the PromptVersion.

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 full PromptVersion 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 updated PromptVersion, whose labels field reflects the new set.

Promote a New Version

Delete a Label

Removes a specific label from a prompt version.