Config & evaluate API
These endpoints power flag delivery and evaluation. Which key each takes matters: use the narrowest key that works for the surface.
Base URL: https://statskit.ai/api/v1
| Endpoint | Key |
|---|---|
GET/POST /client-config | csk_live_… (client) |
POST /exposures | csk_live_… (client) |
GET /config, GET /config/version, GET /config/stream | ssk_live_… or vsk_live_… (server) |
POST /evaluate | ssk_live_… or vsk_live_… (server) |
Client config (browser)
Section titled “Client config (browser)”Cacheable, pre-evaluated
Section titled “Cacheable, pre-evaluated”GET /client-config
The browser-safe path. The server evaluates flags for the given context and returns only the resulting values (never targeting rules or segments), so the response is CDN-cacheable.
Query params: key (the csk_live_… client key), env (default production), ck (context key), v (version).
curl "https://statskit.ai/api/v1/client-config?key=csk_live_...&env=production&ck=user_123&v=42"Uncacheable, context in body
Section titled “Uncacheable, context in body”POST /client-config
Same output, but the full context is sent in the body (uncacheable). Use when the context has attributes beyond a single key.
curl -X POST https://statskit.ai/api/v1/client-config \ -H "Authorization: Bearer csk_live_..." \ -H "Content-Type: application/json" \ -d '{ "env": "production", "context": { "key": "user_123", "attributes": { "plan": "pro" } } }'Server config
Section titled “Server config”Full compiled payload
Section titled “Full compiled payload”GET /config
Returns the full compiled config for an environment, including targeting rules and segments, for local evaluation on the server. Supports ETag for conditional requests. Takes ssk_ or vsk_.
curl "https://statskit.ai/api/v1/config?env=production" \ -H "Authorization: Bearer ssk_live_..."Version poll
Section titled “Version poll”GET /config/version
A cheap check for whether the config changed, without shipping the full payload. No key in the URL.
curl "https://statskit.ai/api/v1/config/version?env=production" \ -H "Authorization: Bearer ssk_live_..."Version stream (SSE)
Section titled “Version stream (SSE)”GET /config/stream
Server-Sent Events stream of version changes, so a long-running server can hot-swap config the moment you publish.
curl -N "https://statskit.ai/api/v1/config/stream?env=production" \ -H "Authorization: Bearer ssk_live_..."Remote evaluate
Section titled “Remote evaluate”POST /evaluate
Evaluate flags on the server for a supplied context and get back the resolved values. Pass ?withExposure=true to record an exposure at the same time. Takes ssk_ or vsk_.
curl -X POST "https://statskit.ai/api/v1/evaluate?withExposure=true" \ -H "Authorization: Bearer ssk_live_..." \ -H "Content-Type: application/json" \ -d '{ "env": "production", "context": { "key": "user_123", "attributes": { "plan": "pro" } } }'Exposures
Section titled “Exposures”POST /exposures
Record that a context was exposed to a flag/variation, so experiment analytics can attribute conversions. Takes the client key csk_live_….
curl -X POST https://statskit.ai/api/v1/exposures \ -H "Authorization: Bearer csk_live_..." \ -H "Content-Type: application/json" \ -d '{ "flag": "new_dashboard", "variation": 1, "context": { "key": "user_123" } }'