Getting Started with the API
Authenticate and make your first API request in under 5 minutes
Getting Started with the API
This guide walks you through obtaining an API key, making your first authenticated request, and understanding rate limits. By the end, you'll be ready to integrate the Pixelated Empathy API into your application.
Table of Contents
- Prerequisites
- Create an API Key
- Make Your First Request
- Authentication Methods
- Rate Limits & Quotas
- Error Handling
- Next Steps
Prerequisites
- A Pixelated Empathy account with developer access
- Node.js 18+ or Python 3.9+ installed (for SDK usage)
curlor any HTTP client for testing
Create an API Key
API keys are managed through the admin dashboard. Keys are scoped to specific permissions and have per-key rate limits.
- Navigate to the API Key Management dashboard
- Click "Create New Key"
- Select the scopes your application needs:
read— Read access to non-PHI endpointswrite— Create/update resourcesdeveloper:manage— Manage API keys (rotation, revocation)analytics:read— Access analytics endpointsmemory:read/memory:write— Memory API accessadmin— Full admin access (use with caution)
- Set a name and optional expiration date
- Copy the generated key — it's shown only once
Make Your First Request
Once you have an API key, make a test request:
curl -X GET https://api.pixelatedempathy.com/api/v1/health \
-H "X-API-Key: dev_your_api_key_here"Expected response:
{
"status": "healthy",
"version": "1",
"timestamp": "2026-07-23T00:00:00Z"
}The response includes the X-API-Version header indicating the API version that served your request.
Authentication Methods
API Key (Recommended for Server-Side)
Include your API key in the X-API-Key header on every request. This is the simplest method for server-to-server integrations.
curl -X GET https://api.pixelatedempathy.com/api/v1/search?q=anxiety \
-H "X-API-Key: dev_your_api_key_here"JWT Bearer Token (Session-Based)
For applications using user login flows, use the JWT bearer token from the authentication endpoint. This is useful for browser-based applications.
# First, authenticate to get a JWT
curl -X POST https://api.pixelatedempathy.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "..."}'
# Then use the token
curl -X GET https://api.pixelatedempathy.com/api/v1/profile \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..."Scopes
Each API key has assigned scopes. Requests requiring a scope your key doesn't have will return 403 Forbidden. Check theAPI reference for required scopes per endpoint.
Rate Limits & Quotas
Every API response includes rate limit headers:
X-RateLimit-Limit— Maximum requests per minute for your tierX-RateLimit-Remaining— Requests remaining in the current windowX-RateLimit-Reset— Unix timestamp when the window resetsX-RateLimit-Daily-Remaining— Daily quota remainingX-RateLimit-Monthly-Remaining— Monthly quota remaining
When you exceed a limit, the API returns:
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
Retry-After: 12
{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded. Retry after 12 seconds.",
"remaining": 0,
"resetTimeMs": 180000
}Error Handling
The API uses standard HTTP status codes:
200— Success201— Created400— Bad request (validation error)401— Unauthorized (missing or invalid key)403— Forbidden (insufficient scopes)404— Not found429— Rate limit exceeded500— Internal server error
Error responses include a message field with details:
{
"error": "validation_error",
"message": "Query parameter 'q' is required",
"details": { "field": "q", "issue": "required" }
}