API Reference
Complete reference for the Enprompta REST API. Build powerful prompt management into your applications.
Overview
Base URL
https://enprompta.com/api/v1All API requests must use HTTPS
Request and response bodies are JSON
Request Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEYAuthentication
Enprompta uses API keys to authenticate requests. The API supports both API keys and OAuth2 client credentials for machine-to-machine authentication — manage both from your dashboard under API Keys (OAuth clients live in the OAuth Clients section there).
REST API requires a paid plan
Creating API keys and OAuth clients is free — but using the REST API (prompts, executions, teams) requires an active Pro or Enterprise subscription. Every member of a paid workspace is covered: editor seats read/write, free viewer seats read-only. Recording observability traces via the SDK works on any plan (5,000/month on Free).
View pricing plansKeep your API keys secure
Never expose API keys in client-side code. Use environment variables and server-side requests.
Getting Your API Key
- Log in to your Enprompta Dashboard
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy and securely store your key
Using Your API Key
curl https://enprompta.com/api/v1/prompts \
-H "Authorization: Bearer ep_your_api_key" \
-H "Content-Type: application/json"import { Enprompta } from '@enprompta/sdk'
const client = new Enprompta({
apiKey: process.env.ENPROMPTA_API_KEY
})
// All requests are now authenticated
const prompts = await client.prompts.list()Ready to integrate with the API?
Upgrade to Pro to create API keys and start building. Pro includes a 14-day free trial.
Rate Limits
Rate limits are applied per API key. Limits reset at the top of each minute. Note: keys are free to create; using the REST API requires a Pro or Enterprise plan.
| Plan | API Access | Requests/Minute | Requests/Day |
|---|---|---|---|
| Free | Trace ingestion only | — | — |
| Pro | Full Access | 60 (standard key) · 300 (premium key) | 10,000 · 100,000 |
| Enterprise | Full Access | Custom (up to 1,000+) | Custom |
Note: Free accounts get unlimited prompt enhancements through the browser extension and web dashboard, plus 5,000 observability traces/month via SDK ingestion. Upgrade to Pro for full programmatic API access.
Rate Limit Headers
Every API response includes rate limit information in the headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705492800Handling Rate Limits
When you exceed your rate limit, the API returns a 429 Too Many Requests status. Our SDKs automatically handle retries with exponential backoff.
Prompts
Create, manage, and execute prompts. Prompts support variables using {{variable}} syntax.
Templates
Browse and use pre-built prompt templates from the community.
Teams
Manage team access and collaboration.
Webhooks
Receive real-time notifications when events occur.
Available Events
| Event | Description |
|---|---|
prompt.executed | Prompt execution completed |
team.member_added | New team member joined |
team.member_removed | Team member removed |
Webhook Payload
{
"id": "evt_abc123",
"event": "prompt.executed",
"created_at": "2024-01-17T10:15:00Z",
"api_version": "2024-01-01",
"data": {
"execution_id": "exe_xyz789",
"prompt_id": "pmt_abc123",
"status": "completed",
"tokens_used": 568,
"cost": 0.0284
}
}Signature Verification
Verify webhook authenticity using HMAC-SHA256:
const crypto = require('crypto')
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex')
return `sha256=${expected}` === signature
}
// In your webhook handler
app.post('/webhook', (req, res) => {
const signature = req.headers['x-enprompta-signature']
if (!verifySignature(req.body, signature, WEBHOOK_SECRET)) {
return res.status(401).send('Invalid signature')
}
// Process webhook
const { event, data } = req.body
console.log(`Received ${event}:`, data)
res.status(200).send('OK')
})Error Handling
The API uses standard HTTP status codes and returns detailed error information.
Error Response Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": [
{
"field": "temperature",
"message": "Must be between 0 and 2"
}
]
}
}HTTP Status Codes
| Code | Status | Description |
|---|---|---|
200 | OK | Request successful |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Invalid or missing API key |
403 | Forbidden | Insufficient permissions |
404 | Not Found | Resource not found |
402 | Payment Required | Insufficient tokens |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Error | Server error |
Official SDKs
Use our official SDKs for the best developer experience with automatic retries, type safety, and convenient helpers.
Try the API Workbench
Test endpoints interactively with your account. See real responses and debug your integration.
Ready to get started?
Create your free account and start building with the Enprompta API in minutes.