Skip to main content
The prompts client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.
A prompt is a versioned LLM prompt template that lives in a space. Each prompt has one or more immutable versions identified by commit hash; labels (e.g. production) point to a specific version. The Get, Update, Delete, ListVersions, CreateVersion, and GetVersionByLabel methods accept either a prompt name or an ID — when a name is passed, the parent Space (name or ID) is also required so the SDK can resolve the name to a unique ID. GetVersion, SetVersionLabels, and DeleteVersionLabel take strict version IDs only.

List Prompts

List returns a paginated list of prompts. When Space is a base64 resource ID, it is sent as the space_id filter (exact match); otherwise it is sent as the space_name filter (case-insensitive substring match). Signature:
Usage Example:

Get a Prompt

Get returns a single prompt (with one of its versions), resolving by name or ID. If VersionID or Label is set, the response carries that specific version; otherwise the latest version is returned. VersionID and Label are mutually exclusive. Signature:
Usage Example:

Create a Prompt

Create creates a new prompt with its initial version, resolving the parent space by name or ID. Signature:
Usage Example:

Update a Prompt

Update patches an existing prompt’s metadata, resolving the target by name or ID, and returns the updated prompt. Description is a pointer — nil preserves the existing value, a pointer to an empty string clears the field. Signature:
Usage Example:

Delete a Prompt

Delete removes a prompt, resolving by name or ID. It returns only an error. Signature:
Usage Example:

List Versions

ListVersions returns a paginated list of versions for a prompt, resolving the prompt by name or ID. Signature:
Usage Example:

Create a Version

CreateVersion creates a new version for an existing prompt, resolving the prompt by name or ID. Signature:
Usage Example:

Get a Version

GetVersion returns a single prompt version by its ID. Version IDs are strict IDs — no name resolution is performed. Signature:
Usage Example:

Get a Version by Label

GetVersionByLabel returns the prompt version pointed to by a label (e.g. "production"), resolving the prompt by name or ID. Signature:
Usage Example:

Set Version Labels

SetVersionLabels assigns one or more labels to a specific prompt version, replacing all existing labels, and returns the updated label set. Pass an empty slice to remove all labels. Version IDs are strict IDs. Signature:
Usage Example:

Delete a Version Label

DeleteVersionLabel removes a single label from a specific prompt version. It returns only an error. Version IDs are strict IDs. Signature:
Usage Example: