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
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
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
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
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: configuration-change handler (paste-a-key) that refreshes settings and fans out provider model discovery.
idstring
Configuration id; the handler only acts on `llm-router`.
new_valueunknown
The new authoritative configuration value.
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
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