Authentication
All API requests require a valid API key sent via the Authorization header.
Key types
pk_live_...Live keys hit real generation providers. Credits are consumed.
pk_test_...Test keys return mock data. No credits consumed.
Including your API key
Authorization header
curl https://api.princemarketing.ai/v1/generate/image \
-H "Authorization: Bearer pk_live_YOUR_API_KEY" \
-H "Content-Type: application/json"Key management
Create key
# Create a new key
curl -X POST https://api.princemarketing.ai/v1/keys \
-H "Authorization: Bearer pk_live_YOUR_KEY" \
-d '{ "name": "Production", "environment": "live" }'Revoke key
# Revoke a key
curl -X DELETE "https://api.princemarketing.ai/v1/keys?id=key_abc123" \
-H "Authorization: Bearer pk_live_YOUR_KEY"Security
- API keys are hashed (SHA-256) before storage. We never store raw keys.
- Full keys are shown exactly once at creation. Copy and store securely.
- Revoked keys are rejected immediately.
- Never expose API keys in client-side code.