Troubleshooting
Common problems and their solutions.
Authentication
Section titled “Authentication”"invalid OSP" on login
Section titled “"invalid OSP" on login”401 response, invalid_credentials. The OSP sent does not match any account: a typo, or the OSP has been replaced since (/auth/rotate invalidates the old one). Solution:
- If you have a valid session token, use
/auth/rotateto generate a new OSP - Otherwise, create a new account with
/auth/register(the old account stays unreachable)
"invalid token" (expired token)
Section titled “"invalid token" (expired token)”The API answers 401 invalid token for an invalid or expired JWT access token (lifetime: 15 minutes). Use the refresh token:
curl -X POST https://ostrakon.example.com/api/v1/auth/refresh \ -H "Content-Type: application/json" \ -d '{"refresh_token": "your-refresh-token"}'Rate Limiting
Section titled “Rate Limiting”HTTP 429 "Too Many Requests"
Section titled “HTTP 429 "Too Many Requests"”You exceeded the request limit. The response carries error: "rate_limit_exceeded", and the headers X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix timestamp of the next reset, the limit is counted per minute) and X-RateLimit-Type. There is no Retry-After header: wait for X-RateLimit-Reset.
The limits for authenticated requests (JWT or API key) are per account and depend on the plan, in requests per minute:
| Type | Free | Premium | Enterprise |
|---|---|---|---|
Read (GET) |
120 | 6 000 | 30 000 |
Write (POST, PATCH, DELETE) |
60 | 3 000 | 15 000 |
Sending events (/events, /events/batch) |
300 | 10 000 | 50 000 |
| Statistics and reading events | 600 | 12 000 | 60 000 |
Public endpoints (/public/*) are limited per IP: 30 req/min in general, 120 req/min for statistics. Registration is limited to 5 per hour per IP. A public trigger also has an event quota per hour and per day (quota_exceeded, 429).
Solutions:
- Implement exponential backoff
- Batch events with
/events/batch - A JWT and an API key of the same account share the same counters: several keys do not raise the limit
SSE (Server-Sent Events)
Section titled “SSE (Server-Sent Events)”Connection closes immediately
Section titled “Connection closes immediately”- Check that the token is valid (not expired) and that it is sent in a header (
AuthorizationorX-API-Key), not in the URL - Check that you have the
trigger:statsscope on the trigger (trigger:stats:<id>, ortrigger:stats:*for/events/stream):trigger:readis not enough - For public triggers, use the
/public/events/stream/{id}endpoint - A
503too_many_connectionsmeans the limit of open streams is reached: close the ones you no longer use
No data received
Section titled “No data received”- Check that events are actually being emitted on the trigger
- The SSE connection can take a few seconds to establish
- Check that your client supports
text/event-stream - Messages are named (
connected,event,heartbeat): withEventSource,onmessagereceives nothing, useaddEventListener(see Real-time Events)
API Keys
Section titled “API Keys”"invalid API key"
Section titled “"invalid API key"”- The key may have been revoked: check in Settings > Developer > API keys
- Check the header:
X-API-Key: sk_... - Do the key's scopes cover the requested operation? A
403names the missing scope (required scope: ...)
Request Errors
Section titled “Request Errors”HTTP 400 unknown_field
Section titled “HTTP 400 unknown_field”The API rejects a JSON body that carries a field the endpoint does not know, and names it:
{"error": "unknown_field", "message": "unknown field \"descripton\""}It is usually a typo (descripton for description) or a field copied from another endpoint. Remove or rename it: the API reference lists the fields of each endpoint. Only the structure of the body is strict; the metadata object of an event stays free-form and accepts any key.
Performance
Section titled “Performance”Events slow to appear
Section titled “Events slow to appear”Events are buffered before being written to the database. Typical delay: about 1 second. For real time, use SSE.
Slow dashboard
Section titled “Slow dashboard”- Reduce the time range of the selector
- Filter by group to limit the data shown