Quick answer
Kairos APIs accept two credential types: API keys, sent as X-Client-Id, X-Api-Key, and X-Api-Secret headers and created in the Kairos dashboard, and JWT bearer tokens for user-facing sessions. Read-only market data on the Market Data API's free tier needs neither.
API key authentication
| Header | Description |
|---|---|
| X-Client-Id | Your client ID, formatted like kairos_ck_... |
| X-Api-Key | Your API key |
| X-Api-Secret | Your client secret |
API key auth works on all read-only data endpoints (candles, trades, search, markets, discover, PnL providers) and on the Order Execution API, gated by scope. Market data, discover, search, and candle endpoints require no specific scope. Any active key grants access.
Scopes
| Scope | Access |
|---|---|
| trade:execute | Submit and cancel orders |
| trade:read | View trade history and metrics (/trades/*) |
| position:read | View PnL and portfolio data (/pnl/*) |
No anonymous execution
Every execution.kairos.trade endpoint requires a credential or session JWT. There is no unauthenticated path, since this service moves money. The Data API's free reads do not extend here.
IP whitelisting and key security
- Keys can be restricted to specific IP addresses. Requests from a non-whitelisted IP receive 403 Forbidden.
- Keys and secrets are SHA-256 hashed before storage, never stored raw.
- Credential comparisons run in constant time to resist timing attacks.
JWT bearer tokens
User-facing sessions authenticate with an HS256-signed JWT in the Authorization: Bearer header, or a ?token= query parameter for WebSocket compatibility. Tokens are issued by kairos.trade for the kairos-api audience and expire after 24 hours. A missing or invalid credential returns 401 with a detail message; the Order Execution API uses its own error envelope.
Protection levels
| Level | Requirement | Examples |
|---|---|---|
| Public | No auth | GET /providers/configs, GET /sports/matching-markets |
| Data (read-only) | JWT or API key | GET /candles, GET /trades/history, GET /search/markets |
| User auth | JWT with user identity | GET /pnl/{user_id} |