API Reference
Complete reference for the PromptOT public API. Authenticate with API keys, fetch compiled prompts, and integrate with your application.
Authentication
Authenticate requests using API keys passed in the Authorization header as a Bearer token. Keys are scoped to environments:
- Production keys (
pk_live_*) return the published version of your prompt. - Development keys (
pk_dev_*) return the latest draft.
Base URL
All API requests are made to the following base URL:
Available endpoints
/v1/prompts/:slug/compiledFetch a compiled prompt with variables resolved. Returns the full prompt string assembled from all enabled blocks.
Parameters
slug(path)requiredvariables(query)Request
Response
/v1/promptsList all prompts in the project associated with the API key.
Request
Response
Error Handling
All errors follow a consistent envelope format. The data field will be null and the error object will contain a code and message.
Common Error Codes
UNAUTHORIZEDMissing or invalid API keyNOT_FOUNDRequested resource does not existVALIDATION_ERRORRequest parameters failed validationRATE_LIMITEDToo many requests, slow downINTERNAL_ERRORUnexpected server errorRate Limits
API rate limits are based on your plan. Exceeding the limit returns a RATE_LIMITED error.
Free
1,000 requests/month
Pro
100,000 requests/month
Enterprise
Unlimited
Ready to integrate?
Create your first prompt and start fetching compiled prompts via the API in minutes.