The Prompts API lets you store, version, and manage prompt templates centrally. Every template change creates an immutable version, giving you a full change history with the ability to roll back to any previous version at any time. Templates supportDocumentation Index
Fetch the complete documentation index at: https://docs.mka1.com/llms.txt
Use this file to discover all available pages before exploring further.
{{variable}} placeholders that are rendered server-side when you
retrieve a prompt, so you can reuse the same template across different contexts.
Create a prompt
Create a prompt with a name and template. The first version is created automatically.Retrieve a prompt with rendered variables
Passvariables as a query parameter to render the template with your values.
Unmatched placeholders are left as-is.
List prompts
Retrieve a paginated list of all prompts. Useafter for cursor-based pagination.
Update prompt metadata
Update the name, description, or metadata of a prompt. To change the template, create a new version instead.Create a new version
Each template change creates a new version. The new version automatically becomes the active version.View version history
List all versions of a prompt to see its full change history.Retrieve a specific version
Fetch a single version by its version number.Roll back to a previous version
Rollback sets an earlier version as the active version. All versions are preserved — rollback does not delete newer versions, so you can always roll forward again.Delete a prompt
Deleting a prompt removes it and all of its versions permanently.Full example: versioning and rollback workflow
This example demonstrates the complete lifecycle — creating a prompt, iterating on the template, reviewing history, and rolling back.Behavior details
| Aspect | Detail |
|---|---|
| Versioning | Immutable — each template change creates a new version that cannot be modified |
| Active version | New versions auto-activate; use rollback to switch to a different version |
| Rollback | Non-destructive — sets active_version without deleting newer versions |
| Pagination | Cursor-based for listing prompts — use after parameter with first_id/last_id from response |
| Template rendering | Server-side — pass variables query parameter; unmatched placeholders preserved |
| Ownership | Per API key — prompts are isolated by authentication context |
| Concurrency | Conflict detection — concurrent version creation returns 409 |
Next steps
- Generate a response — use rendered prompts as input to the Responses API
- Extract structured data — combine prompts with structured extraction
- Conversations — manage multi-turn exchanges with versioned system prompts