Auth, limits, and how to call the API (REST + tRPC)
Kontext exposes both REST and tRPC-style HTTP endpoints. Use the SDK for the best experience; otherwise call the HTTP endpoints directly with your API key.
x-api-key
— required for all public endpoints/oauth/gmail
and /oauth/google/callback
(no API key on callback; uses signed state)Status | Description |
---|---|
200 | Successful request |
400 | Invalid request parameters |
401 | Missing or invalid API key |
403 | Forbidden - check your permissions |
404 | Resource not found |
429 | Rate limit exceeded |
500 | Internal server error |
X-RateLimit-Limit
X-RateLimit-Remaining
X-RateLimit-Reset
Code | Description |
---|---|
UNAUTHORIZED_USER | User hasn’t connected Gmail |
INVALID_API_KEY | API key is invalid or missing |
RATE_LIMITED | Too many requests |
INVALID_USER_ID | User ID format is invalid |
NOT_FOUND | Resource or facts not found |
INVALID_REQUEST | Validation error |
SERVER_ERROR | Internal server error |
x-api-key
for you (with sensible retries).{ "input": { ... } }
), parsing result.data
, and handling auth/retries yourself.DEFAULT_PRIVACY_LEVEL
(default strict
); any inbound privacy level from clients is ignored. Strict mode redacts common PII classes (emails, phone numbers, cards, addresses, medical IDs, etc.). User names are not redacted by default.