API Documentation

Access your prompts programmatically via the PromptAssay REST API. All endpoints require authentication via API key.

Tier requirement: Public API access requires the Solo tier or higher. Free-tier workspaces can generate API keys but calls return 403 API_NOT_ALLOWED. Upgrade at /billing.

Authentication

Generate an API key from Settings > API Keys. Include it in every request as a Bearer token.

curl -H "Authorization: Bearer pa_live_..." \
  https://promptassay.ai/api/v1/prompts
Security: API keys are shown only once at creation. Store them securely. If compromised, revoke immediately in Settings.

Rate Limits

Per Key

100 req/min

Global

500 req/min

When rate-limited, the API returns HTTP 429 with a Retry-After header in seconds.

Response Format

All responses are JSON. Success responses wrap data in a data field. Paginated responses include a meta field.

Success

{
  "data": { ... },
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 42
  }
}

Error

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

Endpoints

GET/api/v1/prompts

List all prompts with optional filtering and pagination.

Query params:

  • page (default 1)
  • per_page (default 20, max 100)
  • folder_id - filter by folder UUID
  • tag - filter by tag name
  • type - filter by prompt type (system, user, assistant, template, few-shot, chain-of-thought)
GET/api/v1/prompts/:id

Get a single prompt with full content, metadata, and tags.

GET/api/v1/prompts/:id/versions

List all versions of a prompt (summaries only, no content). Paginated.

Query params: page, per_page

GET/api/v1/prompts/:id/versions/:version

Get a specific version by number, including full content.

GET/api/v1/prompts/:id/resolved

Get the fully resolved prompt with all fragment insertions assembled into the final content.

SDK Quickstart

Use the official TypeScript SDK for a type-safe, zero-dependency client.

npm install promptassay-sdk
import { PromptAssay } from "promptassay-sdk";

const client = new PromptAssay({
  apiKey: "pa_live_...",
  baseUrl: "https://promptassay.ai",
});

// List prompts
const { data: prompts } = await client.prompts.list({
  page: 1,
  per_page: 10,
  type: "system",
});

// Get a single prompt
const { data: prompt } = await client.prompts.get("uuid");

// Get resolved prompt with fragments
const { data: resolved } = await client.prompts.getResolved("uuid");
console.log(resolved.resolved_content);