JSON formats

The JSON that every language, the gateway and the database share is published as one JSON Schema (draft 2020-12): /schemas/criogenai.schema.json. Each type is under $defs, referenced as criogenai.schema.json#/$defs/<Type>. The test suite validates values written by the engine against it.

TypeWhat it is
Message, ContentBlock, MediaSourceOne message of a conversation and its parts
ToolSpec, ToolAnnotationsA tool the model may call
ModelRequest, Settings, OutputSpec, ToolChoice, ReasoningWhat a model is asked
ModelResponse, Usage, FinishReason, WarningWhat it answers
MessageDelta, BlockDeltaA piece of a streamed message
ModelErrorA classified provider failure
ApprovalRequest, DecisionA call waiting for a person, and the answer
AuditRecordOne audit trail record (no content)
UsageRecordThe gateway's record of one request (no content)
ErrorObjectAn error as the SDKs report it

The error codes are a separate file, /schemas/error-codes.json, shown on Error codes.

Readers of these formats should accept fields they do not know: new optional fields may be added in minor versions.