You can also perform all of these actions (creating prompts, managing template versions, and promoting versions to live) directly through the user-friendly px0 Web Console at http://localhost:8000. If you prefer configuring your prompt infrastructure programmatically using our API, you can follow the detailed step-by-step instructions below.
Prerequisites
Before starting, ensure you have:- Started local services and created an account. See Run px0 Locally for details.
- Retrieved your organization and team IDs and generated a programmatic API key. See Get an Access Key for details.
1. Create a Prompt Container
A prompt container groups different versions of a prompt under your team. Creating a prompt requires a name. Specifying a slug is optional; if omitted, px0 automatically generates and normalizes a slug from the prompt name. For example, “Greeting Prompt” automatically resolves to the sluggreeting_prompt.
Run the following request to create a prompt with an explicit slug of greeting:
2. Create a Prompt Version
Create a template version inside your prompt container. Templates use a powerful syntax to insert dynamic variables. See the Template Syntax guide for complete formatting and structures. Run the following request to create your first draft template version:1):
3. Render Your Prompt Template
px0 offers two main approaches to rendering prompt templates. You can render any draft or specific version directly, or promote a version to live and render the default live endpoint.Option A: Render a Specific Version Directly
You can render any specific version (including raw drafts) directly by specifying the version number. This is useful for testing templates during development before promoting them. Execute the render request by supplying values for the variables specified in your template:Option B: Promote the Version and Render the Live Endpoint
In production, you usually want to render the current active version without hardcoding version numbers in your application. This allows you to update prompt strings on the fly without making code changes. To enable this, promote your prompt version through the lifecycle stages:draft to stable, and then stable to live.
Step 1: Promote to Stable
Step 2: Promote to Live
Step 3: Render the Live Prompt
Once promoted tolive, render the default live prompt endpoint without supplying a version number:
/render endpoint and automatically receives the latest live prompt template with zero downtime.

