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)requiredThe 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",
"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",
"current_version": "3"
}
],
"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

Versioning & Stability

The PromptOT public API follows a strict versioning policy to ensure your integrations remain stable.

Frozen response shape

The GET /v1/prompts/:id delivery endpoint returns a stable response shape that will not change within the v1 API.

FieldDescription
idPrompt UUID
namePrompt display name
compiled_promptFull compiled prompt string with variables resolved
model_configModel configuration snapshot (model, temperature, etc.)
variables[].keyVariable key name
variables[].default_valueVariable default value
versionVersion number (integer)
etagETag for conditional requests (If-None-Match)

Deprecation policy

  • Additive changes (new optional fields) may be added to v1 responses at any time. These are not breaking changes.
  • Breaking changes (removing or renaming fields, changing types) will only happen in a new API version (e.g., /api/v2).
  • Deprecation window — when a new version is released, the previous version will continue to work for at least 6 months with a Sunset header indicating the retirement date.
  • ETag support — use If-None-Match to avoid re-fetching unchanged prompts. A 304 response means the cached version is still current.

Ready to integrate?

Create your first prompt and start fetching compiled prompts via the API in minutes.