snake_case fields, and POST; readers ignore unknown fields but enforce all
required fields.
Route map
Cogni reserves no path prefix. The host supplies all three routes during initialization:Common identifiers
request_id identifies a batch; prediction_id follows one candidate. Timestamps use RFC 3339,
durations use integer milliseconds, and byte counts are non-negative integers.
Capabilities
The frontend first negotiates transports, representations, and limits. The request has no Cogni body; the response usesapplication/json:
Predictions
Predictions submit a bounded set of registered reads asapplication/json:
Resource names use lowercase letters and digits with single
., _, or - separators and are at
most 128 characters. cache_key is 1 to 512 characters; parameters are resource-defined JSON.
Event sequence
JSON returns an orderedevents array; NDJSON sends the same events one per line. Common fields are
at, protocol_version, request_id, and type; candidate events add prediction_id.
A resolved resource contains
name, cache_key, payload, media_type, optional expiry metadata,
and measured work.
Rejection reasons are below_quality_gate, budget_exhausted, invalid_parameters, queue_full,
unavailable, and unsupported_representation.
Candidate events may interleave, but resolution or failure must follow acceptance. Rejection is
terminal.
Delivery modes
Returnapplication/x-ndjson when the request accepts it and the implementation supports streaming.
Write every event as one complete JSON object followed by \n, flushing as results complete. Return
application/json with this envelope for buffered transport:
Outcome reporting
The frontend reports whether resolved data was actually consumed:
Success is HTTP 204. Foreground navigation never waits for outcome reporting.
Errors
Protocol failures use HTTP status codes andapplication/problem+json. Problems require status,
title, and type.
Use HTTP 400 for invalid messages, 401 or 403 for host authentication or authorization failures, 413
for a batch outside the wire limit, and 429 when predictive work is overloaded. A 429 response may
include Retry-After in seconds.
Candidate failures belong in prediction.failed; malformed requests, authentication failures, and
whole-request overload remain HTTP errors.
Conformance
A conforming backend must:- Authenticate the host request and resolve tenancy before predictive data access.
- Parse protocol version 1 while ignoring unknown fields and enforcing required fields.
- Apply advertised batch and horizon limits plus bounded concurrency and backpressure.
- Resolve only server-registered read-only resource names.
- Validate parameters and apply the same authorization as the foreground read.
- Propagate request cancellation and enforce each candidate deadline.
- Emit candidate terminal events in completion order while preserving per-candidate ordering.
- End every successful prediction response with one consistent
batch.completedevent. - Accept and persist outcome reports without making foreground navigation depend on them.
protocol/conformance contains canonical capability, prediction, event, and outcome fixtures.
Continue
- Node server quickstart uses the reference Node implementation.
- Bounded execution and streaming explains the Node executor’s batch behavior.
- Client API reference documents the TypeScript protocol binding.