Skip to content
Back to Documentation
API Reference

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.
Header
Authorization: Bearer pk_live_abc123...

Base URL

All API requests are made to the following base URL:

URL
https://api.promptot.com/api/v1
Endpoints

Available endpoints

GET/v1/prompts/:slug/compiled

Fetch a compiled prompt with variables resolved. Returns the full prompt string assembled from all enabled blocks.

Parameters

slug(path)required
The prompt's URL slug
variables(query)
JSON object of variable key-value pairs

Request

bash
$ curl "https://api.promptot.com/api/v1/prompts/customer-support/compiled?variables=%7B%22user_name%22%3A%22Alex%22%7D" \
-H "Authorization: Bearer pk_live_abc123..."

Response

json
{
"data": {
"prompt": "## Role\nYou are a friendly customer support agent.\n\n## Context\nThe user's name is Alex...",
"version": "3",
"tokens": 142,
"variables_used": ["user_name", "tone"],
"prompt_id": "a1b2c3d4-e5f6-...",
"project_id": "f7e8d9c0-b1a2-..."
},
"error": null
}
GET/v1/prompts

List all prompts in the project associated with the API key.

Request

bash
$ curl "https://api.promptot.com/api/v1/prompts" \
-H "Authorization: Bearer pk_live_abc123..."

Response

json
{
"data": [
{
"id": "a1b2c3d4-e5f6-...",
"name": "Customer Support Agent",
"slug": "customer-support",
"description": "Handles customer inquiries with empathy...",
"current_version": "3",
"created_at": "2026-01-15T09:30:00Z"
}
],
"error": null
}

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.

json
{
"data": null,
"error": {
"code": "NOT_FOUND",
"message": "Prompt not found"
}
}

Common Error Codes

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDRequested resource does not exist
400VALIDATION_ERRORRequest parameters failed validation
429RATE_LIMITEDToo many requests, slow down
500INTERNAL_ERRORUnexpected server error

Rate 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.