Contrix runtime executes contract-defined endpoints through a stable HTTP interface.
Runtime routes use configured routePrefix (default configured value: /contrix).
Compatibility behavior:
- If configured prefix is not
/runtime, Contrix also registers/runtimeas a temporary legacy alias. - Route prefix changes require restart to apply.
Using {prefix} to represent effective route prefix:
POST /{prefix}/{namespace}/{pathSlug}POST /{prefix}/by-endpoint/{endpointId}GET /{prefix}/{namespace}/{pathSlug}/metaGET /{prefix}/{namespace}/{pathSlug}/preflightGET /{prefix}/by-endpoint/{endpointId}/preflightPOST /{prefix}/by-endpoint/{endpointId}/preview-request
{
"inputText": "for text-mode endpoints",
"inputJson": { "for": "json-mode endpoints" },
"overrideModel": "optional-model-override"
}Input rules:
- text mode requires
inputText - json mode requires
inputJsonobject matching input schema
- Resolve endpoint by route or endpoint id
- Run preflight (provider/spec/prompt/model/input checks)
- Render prompt from current prompt snapshot
- Call provider adapter
- Validate output schema
- Apply deterministic repair / repair retry / fallback as needed
- Return structured runtime response (+ attempts and trace metadata)
Runtime returns a contract response object with success flag.
Success response includes:
- endpoint/provider/model/spec/prompt identifiers
- final output (
finalOutputJson,finalOutputRawText) outputSource(provider direct, repaired, retry, fallback variants)- attempt traces and normalized usage
Failure response includes:
- normalized error (
type,stage, message, context) - attempts
- last raw output
- validation issues
Notes:
- Schema/request validation errors return HTTP
400. - Runtime route-level failures can be represented as
success: falsepayloads.
Use metadata/preflight routes to integrate safely before execution:
meta: runtime binding snapshot for endpointpreflight: readiness checks + issues listpreview-request: rendered prompt + provider payload preview
Enable at startup:
pnpm start -- --silent
# or
pnpm dev -- --silentBehavior:
- Web UI disabled (server only)
- Only
/healthand runtime routes are registered - Control-plane routes are unavailable
- Call log persistence disabled
- Server log level forced to
error
Silent mode cannot be toggled at runtime.