packages/river (@magpie-community/opencode-river-auth 0.1.0, provider `river`):
River's OpenAI-compatible inference API with the user's API key. Models come
from GET /v1/models, limits, image input and reasoning efforts come from
docs.river.ai, and live prices come from River's public pricing endpoint
(BOOT_PRICES as the fallback). Unknown ids are text-only. A 401 or 403 marks
the sign-in expired. The usage card says "Pay as you go". It adds River's
rows to registry.json and the README.
River runs open-weight models on its own GPU fleet (river.ai). It is not a
relay of other vendors' APIs.
Run at the reviewed head 751e502, merged onto main c0a0fd1, on mote (Bun 1.4.2):
- HOME=$(mktemp -d) bun test: 2975 pass, 8 skip, 0 fail across 250 files.
- bun test packages/river: 25 pass. bun scripts/check.mjs: ok.
- A probe with a fake fetch built from River's documented shapes and today's
real /api/public/pricing body (ids GLM-5.3, Kimi-K3, DeepSeek-V4.1-Flash):
- The rows have the documented limits. GLM-5.3 is text-only, the others take images.
- Each variant carries { reasoningEffort } with the documented levels.
- The costs come from the live prices.
- 401 throws signIn "expired" from models and from usage.
- A 503 or a network failure keeps the previous list.
- An empty list replaces the bootstrap rows.
- A provider the user configured is kept.
- RiverPlugin is the only exported function.
- Today's docs.river.ai/guides/inference-models and inference-controls
match LIMITS, IMAGES and VARIANTS.
- An earlier review round (at 233919f) broke the code by hand and saw the
river tests go red.
Not tried: a live River key (I don't have one; the author ran one).
Known gap: GLM-5.3 (pricing id "GLM-5.3") has no LIMITS or VARIANTS row, so
it lists with unknown limits and no efforts. It is text-only, so this is
safe.
63 lines
2.3 KiB
Markdown
63 lines
2.3 KiB
Markdown
# river
|
||
|
||
River ([river.ai](https://river.ai)) with your API key, in
|
||
[OpenCode](https://opencode.ai) and [magpie](https://usemagpie.ai). River serves an
|
||
OpenAI-compatible inference API at `https://api.river.ai/v1`; this plugin signs every
|
||
request with your key, so agents reach its models like any other provider —
|
||
multi-account, fallback, quotas and all.
|
||
|
||
**Provider id:** `river`
|
||
|
||
## Sign-in
|
||
|
||
A River API key, created on the [API Keys](https://console.river.ai/keys) page of the
|
||
River Console (`rv_…`). The key is stored as `{ "type": "api", "key": "rv_…" }` in
|
||
OpenCode's `auth.json` and magpie's `plugin-auth.json` (permissions 600); a key River
|
||
refuses marks the account for sign-in again.
|
||
|
||
## Models
|
||
|
||
The models your key can use, listed per account from `GET /v1/models`. Context and
|
||
output limits come from [River's docs](https://docs.river.ai/guides/inference-models/),
|
||
prices from [River's public pricing endpoint](https://console.river.ai/api/public/pricing)
|
||
(the same rates billing uses), and the documented reasoning efforts
|
||
(`reasoning_effort`) from [API controls](https://docs.river.ai/guides/inference-controls/):
|
||
|
||
| Model | Efforts |
|
||
| --- | --- |
|
||
| DeepSeek-V4.1-Flash(-1017) | `none` / `low` / `high` / `max` |
|
||
| Kimi-K3 | `none` / `max` |
|
||
| Nemotron-3.5-Super-VL | `none` / `high` |
|
||
| GLM-5.3-Flash | `low` / `high` / `max` (reasoning required) |
|
||
| Qwen3.8-27B-FP8 | `none` / `low` / `medium` / `xhigh` |
|
||
|
||
Every inference model streams, reasons and calls tools. Image input is limited to
|
||
the models the docs list for it (Kimi-K3, DeepSeek ×2, Nemotron, GLM-5.3-Flash,
|
||
Qwen3.8-27B-FP8); GLM-5.3 is text-only, and a model the docs don't list yet
|
||
defaults to text-only rather than being assumed to see images.
|
||
|
||
## Usage
|
||
|
||
River meters a prepaid balance per request and publishes no endpoint that reads it,
|
||
so the usage card shows the sign-in state and "Pay as you go" rather than invented
|
||
numbers; spend and balance live in the [River Console](https://console.river.ai/).
|
||
|
||
## Install
|
||
|
||
```sh
|
||
magpie plugin add @magpie-community/opencode-river-auth
|
||
magpie plugin login river
|
||
magpie provider test river
|
||
```
|
||
|
||
In OpenCode, add the same package under `plugin` and sign in with `opencode auth login`.
|
||
|
||
## Development
|
||
|
||
```sh
|
||
bun test
|
||
bun scripts/check.mjs river
|
||
```
|
||
|
||
MIT. Not affiliated with River.
|