08 — API Access
Prompts as infrastructure
REST API for prompt retrieval. Generate API keys. Fetch compiled prompts by slug in the format your app needs. Your prompt library becomes deployment-ready infrastructure.
Coming in Pro+
Why serve prompts via API
Prompts in code
Prompts hardcoded in your codebase. Every change requires a code commit, a PR review, and a deployment. Prompt iteration speed = deployment speed.
Prompts via API
Prompts served at runtime. Update a prompt in prompt-x, promote to production, and your app uses the new version immediately. No code changes required.
API endpoints
RESTful. JSON responses. Bearer token authentication. Rate-limited per plan.
/api/v1/prompts/{slug}Fetch a prompt by slug. Returns the compiled version for your specified platform. Only production-status prompts are accessible.
Params: slug (required), platform (optional, default: raw)
/api/v1/promptsList all production-status prompts in your library. Paginated, filterable by tags and platform.
Params: page, per_page, tags, platform
/api/v1/prompts/{slug}/compileCompile a prompt on-demand for a specific platform. Pass variable values in the request body.
Params: slug (required), platform (required), variables (optional)
Example request
curl -H "Authorization: Bearer px_key_..." \
"https://api.prompt-x.io/v1/prompts/onboarding-assistant?platform=claude"
{
"slug": "onboarding-assistant",
"platform": "claude",
"version": 12,
"status": "production",
"compiled": "<role>Customer success specialist...</role>\n<task>..."
}Use cases
Dynamic prompt serving
Your application fetches the latest production prompt at runtime. Update prompts without redeploying code. The API always returns the current production version.
Variable injection
Pass variable values in the API request. The compiled prompt returns with all variables replaced. Your app provides the context, prompt-x provides the structure.
Multi-platform routing
Request the same prompt compiled for different platforms. Route to Claude, GPT-4, or Gemini based on your application logic. One prompt, programmatic platform selection.
CI/CD integration
Validate prompt availability and status in your deployment pipeline. Ensure production prompts exist before deploying the code that depends on them.
Details
- Pro+ plan — API access included
- Generate and rotate API keys from the dashboard
- Only production-status prompts are accessible via API
- Variables can be passed at request time
- Rate limits based on plan tier
Works with
Your prompts, your API
Serve production prompts at runtime. Update without redeploying.
Start free.
prompt-x