API Reference

Complete reference for the Enprompta REST API. Build powerful prompt management into your applications.

Overview

Base URL

https://enprompta.com/api/v1
HTTPS Only

All API requests must use HTTPS

JSON Format

Request and response bodies are JSON

Request Headers

Required Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

Authentication

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 plans

Keep your API keys secure

Never expose API keys in client-side code. Use environment variables and server-side requests.

Getting Your API Key

  1. Log in to your Enprompta Dashboard
  2. Navigate to Settings → API Keys
  3. Click Generate New Key
  4. Copy and securely store your key

Using Your API Key

cURL Example
curl https://enprompta.com/api/v1/prompts \
  -H "Authorization: Bearer ep_your_api_key" \
  -H "Content-Type: application/json"
TypeScript Example
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.

TierAPI AccessRequests/MinuteRequests/DayMonthly Tokens
FreeNo API Access15
Pro✓ Full Access6010,000200
Team✓ Full Access300100,000Unlimited
Enterprise✓ Full Access1,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:

Response Headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705492800

Handling 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

EventDescription
prompt.executedPrompt execution completed
workflow.completedWorkflow execution finished
workflow.failedWorkflow execution failed
team.member_addedNew team member joined
team.member_removedTeam member removed

Webhook Payload

Example 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:

Node.js Verification
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 Response
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": [
      {
        "field": "temperature",
        "message": "Must be between 0 and 2"
      }
    ]
  }
}

HTTP Status Codes

CodeStatusDescription
200OKRequest successful
201CreatedResource created successfully
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions
404Not FoundResource not found
402Payment RequiredInsufficient tokens
429Too Many RequestsRate limit exceeded
500Internal ErrorServer 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.

Open Workbench

Ready to get started?

Create your free account and start building with the Enprompta API in minutes.

Additional Resources

Enprompta - AI Prompt Intelligence Platform