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. You can manage your API keys from your dashboard. The API supports both API keys and OAuth2 client credentials for machine-to-machine authentication.
Paid Subscription Required
API access requires an active Pro, Team, or Enterprise subscription. Free tier users can use the Chrome extension and web dashboard but cannot access the REST API programmatically.
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?
Subscribe to Pro or higher to create API keys and start building. Free trial includes 200 tokens.
Rate Limits
Rate limits vary by subscription tier. Limits reset at the top of each minute. Note: API access requires a Pro, Team, or Enterprise subscription.
| Tier | API Access | Requests/Minute | Requests/Day | Monthly Tokens |
|---|---|---|---|---|
| Free | No API Access | — | — | 15 |
| Pro | ✓ Full Access | 60 | 10,000 | 200 |
| Team | ✓ Full Access | 300 | 100,000 | Unlimited |
| Enterprise | ✓ Full Access | 1,000+ | 1,000,000+ | Unlimited |
Note: Free tier users can use prompts through the Chrome extension and web dashboard (15 tokens/month). Upgrade to Pro or higher for 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.
Workflows
Chain multiple prompts together into automated workflows.
Teams
Manage team access and collaboration.
Webhooks
Receive real-time notifications when events occur.
Available Events
| Event | Description |
|---|---|
prompt.executed | Prompt execution completed |
workflow.completed | Workflow execution finished |
workflow.failed | Workflow execution failed |
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')
})Usage & Billing
Monitor your token usage and billing information.
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.