REST API
REST API overview
Understand base URLs, request conventions, response envelopes, idempotency, and the available resource families.
Verified against the implementation ·
Request conventions
- Send requests to https://api.promptessor.com/v1.
- Send JSON request bodies with Content-Type: application/json.
- Authenticate with a Bearer API key or OAuth access token.
- Send X-Request-Id when you want to correlate your identifier with PrompTessor logs; otherwise PrompTessor generates one.
- Send a unique Idempotency-Key on every credit-consuming AI operation.
- Send Prefer: respond-async when an AI endpoint supports deferred processing.
POST /v1/prompts/analyze HTTP/1.1
Host: api.promptessor.com
Authorization: Bearer pt_live_YOUR_API_KEY
Content-Type: application/json
X-Request-Id: req_from_your_system_123
Idempotency-Key: analysis-job-123
{"prompt":"Summarize the customer interview notes","targetModel":"Claude"}Response conventions
Read requests return a data envelope. AI requests return an operation-shaped result. All API responses set X-Request-Id and no-store cache control. Rate-limited responses use HTTP 429.
{
"data": { "object": "list", "data": [] },
"requestId": "req_..."
}| Header | Purpose |
|---|---|
| X-Request-Id | Correlation identifier generated by PrompTessor or copied from your request |
| RateLimit-Limit | Maximum requests in the current one-minute class window |
| RateLimit-Remaining | Requests remaining after the current request |
| RateLimit-Reset | Unix time in seconds when the current window resets |
| Retry-After | Seconds to wait when the current rate-limit window is exhausted |
| Idempotent-Replayed | true when a stored AI-operation response was safely replayed |
| Location | Operation URL returned with an asynchronous 202 response |
| Preference-Applied | respond-async when deferred processing was accepted |
Resource families
| Family | Purpose |
|---|---|
| Prompts | Generate, analyze, optimize, refine, reverse, and estimate tokens |
| Prompt presets | Store values for reusable prompt templates and render completed prompts |
| Uploads | Upload temporary assets through presigned URLs |
| Operations | Track and cancel asynchronous work |
| History | Read, rename, and delete generated workflow history |
| Prompt Library | Manage private items and interact with community prompts |
| Account | Read capabilities, models, and unified usage |
| Webhooks | Manage signed event destinations |