Boomerangz/dsh-openrouter-live ↗★ 0

dsh-openrouter-live

接入OpenRouter服务商并获取实时模型列表 适合需要使用OpenRouter提供的各类模型,并获取上下文大小、价格等实时信息的用户。

套件
dsh-openrouter-live
相容性
待驗證
Harness 依賴範圍
>=0.1.6-alpha.2 <0.1.8-0 || >=0.1.7-0 <0.1.8-0
Cordis 依賴範圍
^4.0.1
版本
0.2.2
授權
MIT
最近更新
2026年9月23日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Boomerangz/dsh-openrouter-live

Configuration

Every field is optional. Set fields in the profile's patch layer, ~/.dsh/profiles/ /cordis.patch.yml, under the plugin's entry id openrouter-live:

- id: openrouter-live
  config:
    models: ['deepseek/*', 'anthropic/claude-*', 'openai/gpt-5*']
    extraBody:
      provider:
        sort: throughput
FieldDefaultMeaning
models[]Glob patterns over model ids. An empty list lists every model. Ids outside the filter still work when typed.
toolsOnlytrueList only models whose OpenRouter entry accepts tools. Agent turns need tools.
priceInNametrueAppend input/output prices per 1M tokens to model names, such as DeepSeek: DeepSeek V4.1 Flash ($0.15/$0.60), because the pickers show names but not descriptions. The price then also appears in the composer's model button.
apiKeyEnvOPENROUTER_API_KEYCredential reference: a credential-store entry or environment variable.
provideropenrouter-liveRoute id. Give each instance its own id to run several side by side, for example one with a *:free filter.
displayNameOpenRouter (live)Provider name in the picker.
baseURLhttps://openrouter.ai/api/v1API root.
modelListTtlMs600000How long one fetched model list is reused.
maxTokens32768Output cap for requests that set none. A lower model limit wins.
defaultContextWindow262144Context size assumed for an id the list does not describe.
streamIdleTimeoutMs300000Longest silence inside a response stream before failing with TIMEOUT.
maxRequestImageBytes20971520Base64 image budget per request. Older images are offloaded beyond it.
requestImagePixelBudget4194304Pixel budget of one request image.
requestImageMaxBytes1048576Encoded-byte target of one request image.
appTitle / appUrlDeepSeek Harness / unsetOpenRouter app attribution headers (X-OpenRouter-Title, HTTP-Referer).
extraBody{}Fields merged into every request body, such as provider routing. Fields the plugin sets take precedence.
costLedgerPath$DSH_HOME/openrouter-live/costs.jsonlSpend ledger file. An empty string keeps spend in memory for the current process only.
costCommandcostSlash command that reports spend. Leave it empty on a second instance that shares the ledger, so the command is registered once.
costIndicatortrueServe the Web UI spend indicator's data route (/openrouter-live/spend). Disable it on a second instance, which would otherwise claim the same route.
retryPolicyharness defaultThe harness's provider retry policy for this route: {mode: normal, maxRetries, retryableCodes, backoff} or {mode: always}.