llm-router::ui-content
functionServe the llm-router worker's injected console UI assets (content function for its console:script / console:style triggers).
pathstring*required
The asset path from the trigger config (e.g. `state/page.js`).
contentstring*required
The asset source, verbatim.
content_typestring*required
MIME type the console should serve the asset with.
Abort an in-flight router::chat/complete by request_id; reports whether a live request was cancelled.
request_idstring*required
Stream a chat completion: route {model, provider?} to a provider, relay assistant frames to writer_ref, and return the terminal response.
max_output_tokensinteger· uint64min 0
writer_refall of*required
The caller's write channel (direction "write"); frames are relayed here.
all of (1)
variant 1
access_keystring*required
channel_idstring*required
directionstring*requiredenum: read, write
stop_reasonany of
any of (2)
variant 1
valuestringenum: end, length, function_call, aborted, error
usageany of
any of (2)
variant 1
cache_readinteger· uint64min 0
cache_writeinteger· uint64min 0
inputinteger· uint64min 0
outputinteger· uint64min 0
reasoninginteger· uint64min 0
Non-streaming convenience over router::chat: run the turn on an internal channel and return the final assistant message + usage.
max_output_tokensinteger· uint64min 0
messageobject*required
contentone of[]*required
one of (6)
variant 1
typestring*requiredenum: text
variant 2
typestring*requiredenum: image
variant 3
typestring*requiredenum: thinking
variant 4
typestring*requiredenum: redacted_thinking
variant 5
argumentsunknown*required
function_idstring*required
typestring*requiredenum: function_call
variant 6
contentunknown[]*required
function_call_idstring*required
typestring*requiredenum: function_result
error_kindany of
any of (2)
variant 1
valuestringenum: auth_expired, rate_limited, context_overflow, transient, permanent
rolestring*requiredenum: assistant
stop_reasonstring*requiredenum: end, length, function_call, aborted, error
timestampinteger· int64*required
usageany of
any of (2)
variant 1
cache_readinteger· uint64min 0
cache_writeinteger· uint64min 0
inputinteger· uint64min 0
outputinteger· uint64min 0
reasoninginteger· uint64min 0
usageany of
any of (2)
variant 1
cache_readinteger· uint64min 0
cache_writeinteger· uint64min 0
inputinteger· uint64min 0
outputinteger· uint64min 0
reasoninginteger· uint64min 0
Batch text embeddings through a provider's provider::<id>::embed surface. Names a provider or discovers the first embed-capable one from the live registry; one vector per input, order preserved.
inputstring[]*required
Texts to embed, one vector returned per input, order preserved.
modelstring
Embedding model id; the provider's default when omitted.
providerstring
Provider id (e.g. `openai`); the first embed-capable provider in the live registry when omitted.
embeddingsnumber[][]*required
One embedding per input, in input order.
router::models::budget
functionResolve the effective model output budget using the same precedence as router::chat.
idstring
Model id to budget.
max_output_tokensinteger· uint64min 0
Optional caller-requested output budget. When absent, the same provider and router defaults used by `router::chat` apply.
providerstring
Provider id that owns the model. Empty resolves an unambiguous model id.
any of (2)
variant 1
effective_max_output_tokensinteger· uint64*requiredmin 0
modelobject*required
The capability record (README § Model descriptor).
context_windowinteger· uint64*requiredmin 0
input_limitinteger· uint64min 0
max_output_tokensinteger· uint64*requiredmin 0
pricingany of
… expand 2 nestedcollapse
any of (2)
variant 1
cache_writenumber· double
reasoning_effortsobject[]
… expand 2 nestedcollapse
supports_structured_outputboolean
router::models::get
functionRead one catalog model by {provider, id}; null when the model is not registered.
idstring
Model id to look up.
providerstring
Provider id that owns the model.
any of (2)
variant 1
modelobject*required
The capability record (README § Model descriptor).
context_windowinteger· uint64*requiredmin 0
input_limitinteger· uint64min 0
max_output_tokensinteger· uint64*requiredmin 0
pricingany of
… expand 2 nestedcollapse
any of (2)
variant 1
cache_writenumber· double
reasoning_effortsobject[]
… expand 2 nestedcollapse
supports_structured_outputboolean
router::models::list
functionList catalog models, optionally filtered by provider and/or a capability flag.
capabilitystring
Keep only models that support this capability flag (optional).
providerstring
Filter to a single provider id (optional).
modelsobject[]*required
context_windowinteger· uint64*requiredmin 0
input_limitinteger· uint64min 0
max_output_tokensinteger· uint64*requiredmin 0
pricingany of
any of (2)
variant 1
cache_writenumber· double
reasoning_effortsobject[]
supports_structured_outputboolean
Replace a provider's catalog slice — the only catalog write path (token-gated).
modelsobject[]
The full replacement set of models for this provider.
context_windowinteger· uint64*requiredmin 0
input_limitinteger· uint64min 0
max_output_tokensinteger· uint64*requiredmin 0
pricingany of
any of (2)
variant 1
cache_writenumber· double
reasoning_effortsobject[]
supports_structured_outputboolean
providerstring
Provider whose catalog slice is being replaced.
tokenstring
Registration token gating the write (optional).
countinteger· uint*requiredmin 0
router::models::supports
functionCheck whether a model supports a capability flag (fails open for unknown models).
capabilitystring
Capability flag to check (e.g. `structured_output`, `vision`).
idstring
Model id to check.
providerstring
Provider id that owns the model.
supportedboolean*required
Internal: reactively reload the in-memory configuration snapshot and fan out provider model discovery after configuration changes.
idstring
Configuration id that changed (advisory).
router::provider::list
functionList registered providers with their configured/available status.
providersobject[]*required
availableboolean*required
configuredboolean*required
display_namestring*required
supports_model_listingboolean*required
Provider self-declaration at attach time (token-gated upsert); composes the configuration entry schema and reconciles static models.
defaultsany of
any of (2)
variant 1
max_tokensinteger· uint64min 0
modelsobject[]
context_windowinteger· uint64*requiredmin 0
input_limitinteger· uint64min 0
max_output_tokensinteger· uint64*requiredmin 0
pricingany of
any of (2)
variant 1
cache_writenumber· double
reasoning_effortsobject[]
supports_structured_outputboolean
supports_model_listingboolean
tokenstring
Registration token proving ownership on re-register (omit on first declare).
registration_tokenstring*required
Resolve a provider's effective credential + api_url + max_tokens (token-gated).
idstring
Provider id to resolve credentials/config for.
tokenstring
Registration token gating the resolve (optional).
configuredboolean*required
credentialany of
any of (2)
variant 1
one of (2)
variant 1
typestring*requiredenum: api_key
variant 2
access_tokenstring*required
typestring*requiredenum: oauth
max_tokensinteger· uint64min 0
sourcestring*requiredenum: config, env, none
OAuth write-back: store a provider credential in the configuration entry under the entry write lock (token-gated).
credentialunknown
The credential object to store (provider-specific shape).
idstring
Provider id whose credential slice is being written.
tokenstring
Registration token gating the write (optional).
Read-only routing preview: resolve {model, provider?} to the chosen provider + ordered candidates without streaming.
modelstring
Model id to route.
providerstring
Pin an explicit provider, bypassing heuristics (optional).
candidatesstring[]*required
Effective identity prompt for {provider?} (default_provider when omitted): operator override when set, else provider-declared; null when absent.