Cyber Monday: 2XCYBER doubles your top-up, up to $2,000.Double my top-up

nc://openrouter

v0.1.0Pinned
Backnodecode-ai
pomterrecells: every folder under its kind -- providers/, tools/, rooms/ -- thirty-seven folders at the root read as a heap (operator, 2026-10-08). The repository's own scripts leave tools/ for .github/ (check.sh, check.lisp, deploy-keys.sh; the workflow follows), so tools/ is the kind alone. README: the one table is three, one a kind, and says cell where it said add-on (src/CELLS.md, src/cells/template/). Nothing inside a folder changes; the index follows in the next commit, every entry at this commit and its folder's new path.5055220· 8 Oct1 commit
test1 filecell.lisp4.5 KBmodels.json209.8 KBprovider.lisp7.6 KBsignin.lisp20.7 KB

nodecode-openrouter

A Nodecode cell for OpenRouter. models.dev already makes OpenRouter usable on the chat lane; this cell keeps that and adds what oh-my-pi does:

  • /openrouter login signs in from the browser and saves the key OpenRouter hands back where /connect saves keys (api_keys.openrouter)
  • /models lists omp's bundled OpenRouter rows beside models.dev's
  • every request names the app it comes from (HTTP-Referer, X-OpenRouter-Title, X-OpenRouter-Categories: cli-agent) and asks OpenRouter's cache to keep it an hour (X-OpenRouter-Cache, X-OpenRouter-Cache-TTL: 3600); the attribution names Nodecode
  • a routing variant, when one is chosen, rides the model id (openai/gpt-5.5:nitro), unless the id names one already
  • reasoning goes as OpenRouter's own reasoning: {"effort": ...}, and off as {"enabled": false}, never as reasoning_effort
  • no output cap the operator did not set: a catalog cap above an upstream's own makes OpenRouter skip that upstream
  • routing preferences (only, order) ride as the body's provider

Ported from oh-my-pi's openrouter provider. See NOTICE.

Sign in

/openrouter login

answers at once with the address to open, and listens on http://localhost:54549/callback (another port when that one is taken; OpenRouter accepts any loopback callback). The sign-in is OpenRouter's PKCE flow: no client registration, the S256 verifier is the proof. When the browser comes back, the code is exchanged for a key, the key is saved, and a notice says so. http://localhost:<port>/launch redirects to the sign-in page, for a terminal that cut the long address.

On another machine, paste the address the browser ended on, the code in it, or a key you made by hand:

/openrouter code <address, code or sk-or-... key>

A pasted key is checked against /api/v1/auth/key before it is saved. The key does not expire. /openrouter status says whether a key is saved, /openrouter logout forgets it.

Without the sign-in: make a key at https://openrouter.ai/settings/keys and save it with /connect, or set OPENROUTER_API_KEY. A saved key wins over the variable. No other provider's key is ever sent to OpenRouter: with neither, the round goes keyless and OpenRouter says why.

Install

Copy this folder into ~/.nodecode/cells/nodecode-openrouter/ and restart Nodecode, or run (restart-cells).

Configure

Optional. The section is on unless it says "enabled": false:

{
  "openrouter": {
    "base_url": "https://openrouter.ai/api/v1",
    // default, nitro, floor, online or exacto
    "variant": "nitro",
    "only": ["anthropic", "openai"],
    "order": ["anthropic"]
  }
}

Test

From this repository's root:

tools/test-cell.sh nodecode-openrouter

Not ported

  • omp's per-model compat (strict-tool retry on OpenRouter's Anthropic upstreams, reasoning-history filtering for Muse Spark, the cost OpenRouter reports per request): the core's chat lane has no seam for a retry without strict tools, and reads usage, not OpenRouter's billed cost.
  • omp's OpenRouter Responses, image, video, rerank and decisions transports: this cell serves the chat wire only.

MIT licensed.

Add nc://openrouter

  1. 1

    Install Nodecode

    Once per machine.

    $ curl -fsSL https://nodecode.ai/install.sh | sh
  2. 2

    Add the cell

    Pinned at 5055220.

    $ nodecode add nc://openrouter

    Or tell the agent add the openrouter cell.

  3. 3

    Sign in

    Run /openrouter login and follow what it says.