Endpoints
All
/v1 endpoints require an API key. See Authentication.
The API also serves GET /health for liveness checks and GET /openapi.json, both without authentication.
OpenAPI specification
The API reference pages are generated from the live OpenAPI 3.1 specification:Request ids
Every response has anX-Request-ID header. Successful /v1/decide responses don’t repeat it in the body, and error bodies include it as error.request_id.
You can send your own X-Request-ID with a request: 1 to 128 characters of letters, digits, ., _, : and -. Krun keeps it and returns it. Otherwise it generates one like req_0cf5441281f640ffbf0111c5a3ed9e50.
Use the request id to send feedback and when you contact support.
Conventions
- Request and response bodies are JSON. Send
Content-Type: application/json. - Field names are
snake_case. Your question ids and option ids are returned exactly as sent. - Unknown fields in a request are rejected with
400 INVALID_REQUEST. - Request bodies are limited to 256 KiB.
- Errors share one format. See Errors.
Versioning
The major version is part of the path (/v1). Changes that could break existing clients will ship under a new version. New optional fields can be added to /v1 responses, so ignore fields you don’t recognize.
The current specification version is 1.0.0-beta: the API is in closed beta.