Common types
Primitives and envelopes shared by every other schema.
Every schema below is exported from @novaterra/contracts and validated on both sides of the wire. Source: packages/contracts/src/common.ts.
Id
string (min 1)
ISODate
string
Json
any
ModelTier
A tier is a JOB, not a model. packages/llm/src/models.ts is the one place a tier is bound to a model id, so swapping a model is one line there and nothing else in the tree moves. The first five are text-shaped and all go through /chat/completions (or /embeddings). The last four are not: video, transcribe and speech each have their own OpenRouter endpoint (POST /videos, POST /audio/transcriptions, POST /audio/speech) and their own price unit — see ModelSpec.unit, because “USD per 1M tokens” is meaningless for a video second. ocr IS an ordinary chat tier: OpenRouter has no OCR model class, it has a file-parser plugin that turns a scanned PDF into markdown before any model sees it, so the tier only names which model reads the result.
'cheap' | 'standard' | 'strong' | 'image' | 'embed' | 'video' | 'transcribe' | 'speech' | 'ocr'
ApiError
| Field | Type | Notes |
|---|---|---|
error | string | |
message | string | |
details | Json | optional |
Ok
| Field | Type | Notes |
|---|---|---|
ok | true |