sdk.traffical.io. SDKs use it to fetch config bundles, send events, and (in server evaluation mode) request resolutions. You can also call it directly for server-to-server integrations.
This section covers the SDK runtime endpoints only: config, resolve, decide, and events. Project and organization management — creating parameters, layers, and policies — happens through the dashboard, the CLI, and the MCP server.
Base URL
baseUrl option — useful for testing.
Authentication
All requests require an API key in theAuthorization header:
API key types
The prefix is the key’s type, and it is enforced server-side — a key of the wrong type is rejected before anything else is checked.
All four are 59 characters and end in a checksum, so a truncated or mistyped key is rejected without a lookup.
Both SDK keys do local resolution. The SDK fetches the config bundle once and resolves on-device — no per-decision network call, and it works offline. That is the default and the recommended mode.The difference is server-side resolution:
POST /v1/resolve and POST /v1/decide/* answer a per-unit question on the server, and those accept a server-side SDK key but not a publishable one.mk or ak key carrying the mcp:invoke permission gives AI agents a connection to the MCP server. Note mcp:invoke is not part of the default management-key preset — grant it explicitly.
Legacy keys
Keys minted before typed prefixes are 45 characters and all begintraffical_sk_. They keep working indefinitely and are governed by their original scopes, not by the type system above — so a legacy key beginning sk may in fact carry management scopes. Check a legacy key’s scopes before assuming it is SDK-only.
Managing keys
Create, rotate and revoke keys on your organization’s API Keys page in the dashboard (from the account menu). Keys can be scoped to a project and given an expiry — by default they do not expire. Rotating a key issues a replacement immediately and keeps the old one valid for 7 days, so you can roll it out gradually and watch the old key’s traffic fall to zero before it expires. Revoking takes effect immediately on the control plane. SDK endpoints are served from the edge, where revocation propagates within about a minute.Endpoints
Legacy keys are governed by their scopes instead:
sdk:read for config, resolve and decide; sdk:write for events.
Caching
GET /v1/config/:projectId is served with Cache-Control: public, max-age=60, must-revalidate and an ETag per bundle version. SDKs send If-None-Match on subsequent requests — unchanged bundles return 304 Not Modified with no body. Use the same pattern in any custom client that polls the bundle.
Error responses
All errors share a consistent shape — anerror object with a stable machine-readable code and a human-readable message:
503 responses are always safe to retry: they mean nothing was stored or served, so a retry cannot duplicate data.
Rate limits
Limits are generous for SDK traffic and scale with your plan. Rate-limited requests return429 with a RATE_LIMITED error code and a Retry-After header (currently 10 seconds). Two things to know:
GET /v1/config/:projectIdresponses are heavily cached at the edge — most SDK refreshes never reach an origin.POST /v1/eventsaccepts batches of up to 1000 events per request. Always batch; never send one event per request from a server.