Authentication
How to authenticate with the Picture Optimizer API.
API Key Authentication
All API requests must include a valid API key in the X-API-Key header.
Obtaining an API Key
- Log in to your SerpTransformer dashboard
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy the key immediately — it is only shown once
See API Keys for full details on key management.
Authentication Flow
Error Responses
| Status Code | Meaning | Example Response |
|---|---|---|
401 | Missing or invalid API key | { "error": "Invalid API key" } |
402 | Insufficient credits | { "error": "Insufficient credits. You have 0 but need 5." } |
403 | Key is deactivated | { "error": "API key is inactive" } |
Rate Limiting
The API does not currently enforce rate limits per key, but excessive usage may be throttled. Process images in reasonable batch sizes (under 100 per request).
Base URL
All API endpoints are prefixed with your API gateway URL:
The WordPress plugin constructs this from the API URL setting. For direct API usage, use the same base URL.
