Skip to main content

API Overview

Integrate PromptReports into your applications with our comprehensive REST API. Programmatically manage prompts, run evaluations, and automate workflows.

API Overview#

The PromptReports API provides programmatic access to all platform features. Use it to integrate prompt management into your existing tools, automate testing pipelines, or build custom applications on top of our infrastructure.

Authentication#

All API requests require authentication using an API key. Include your key in the Authorization header:

Authentication Header
bash
curl -X GET "https://api.promptreports.ai/v1/prompts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Generate API keys from your account settings. You can create multiple keys with different permissions for different use cases.

Base URL#

API Base URL
text
Production: https://api.promptreports.ai/v1
Development: https://api-staging.promptreports.ai/v1

All endpoints are versioned. The current stable version is v1. We follow semantic versioning and will communicate breaking changes well in advance.

Available Endpoints#

ResourceEndpointsDescription
PromptsGET, POST, PATCH, DELETE /promptsManage prompts and drafts
VersionsGET, POST /prompts/:id/versionsVersion control operations
EvaluationsGET, POST /evaluationsRun and retrieve evaluations
DatasetsGET, POST, PATCH, DELETE /datasetsManage test datasets
FoldersGET, POST, PATCH, DELETE /foldersOrganize prompts
ReportsGET, POST /reportsGenerate and retrieve reports
TemplatesGET /templatesBrowse report templates
WebhooksGET, POST, PATCH, DELETE /webhooksManage webhooks
Example: Create a Prompt
bash
curl -X POST "https://api.promptreports.ai/v1/prompts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "folderId": "fld_abc123",
    "name": "Customer Support Response",
    "content": "You are a helpful customer support agent for {{company}}. Respond to: {{question}}"
  }'
Example: Execute a Prompt
bash
curl -X POST "https://api.promptreports.ai/v1/prompts/prm_xyz789/execute" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "variables": {
      "company": "Acme Corp",
      "question": "What are your business hours?"
    },
    "model": "gpt-4",
    "temperature": 0.7
  }'

Rate Limits#

API requests are rate-limited to ensure fair usage and platform stability:

PlanRequests/MinuteRequests/Day
Free601,000
Pro30010,000
Enterprise1,000100,000

Rate limit headers are included in every response:

Rate Limit Headers
text
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1673456789

Error Handling#

The API uses conventional HTTP status codes and returns errors in a consistent format:

Error Response Format
json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid prompt content",
    "details": {
      "field": "content",
      "issue": "Content cannot be empty"
    }
  }
}
StatusMeaningCommon Causes
400Bad RequestInvalid parameters, validation errors
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Server ErrorInternal error (contact support)