@aaronjmars/openroutercli 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/SKILL.md +4 -4
- package/package.json +1 -1
- package/src/commands/batches.js +3 -1
- package/src/commands/guardrails.js +10 -0
- package/src/commands/messages.js +3 -3
- package/src/commands/models.js +13 -3
package/README.md
CHANGED
|
@@ -132,15 +132,15 @@ openrouter tools list
|
|
|
132
132
|
openrouter chat "What's new today?" -m openai/gpt-4o-mini --server-tool web_search
|
|
133
133
|
|
|
134
134
|
# Batches at about half price
|
|
135
|
-
openrouter batches create --endpoint chat -m openai/gpt-4o-mini --file reqs.jsonl
|
|
135
|
+
openrouter batches create --endpoint chat -m openai/gpt-4o-mini --file reqs.jsonl --callback-url https://example.com/webhook
|
|
136
136
|
openrouter batches wait <id> && openrouter batches results <id> -o out.jsonl
|
|
137
137
|
|
|
138
138
|
# Discovery
|
|
139
139
|
openrouter models --filter claude --sort prompt
|
|
140
|
+
openrouter models user --order newest
|
|
140
141
|
openrouter models show anthropic/claude-sonnet-4.5
|
|
141
142
|
openrouter models endpoints anthropic/claude-sonnet-4.5 --sort throughput --best
|
|
142
143
|
openrouter providers
|
|
143
|
-
|
|
144
144
|
# Spend / runs
|
|
145
145
|
openrouter credits
|
|
146
146
|
openrouter whoami
|
package/SKILL.md
CHANGED
|
@@ -191,11 +191,11 @@ openrouter chat -i -m openrouter/auto
|
|
|
191
191
|
openrouter messages "..." -m anthropic/claude-sonnet-4.5 --thinking-budget 2000
|
|
192
192
|
openrouter messages "..." -m anthropic/claude-sonnet-4.5 --thinking adaptive --effort high --speed fast
|
|
193
193
|
openrouter messages "..." -m anthropic/claude-sonnet-4.5 --provider '{"order":["Anthropic"]}' --plugins @plugins.json
|
|
194
|
-
openrouter responses "..." -m openai/gpt-4o-mini --store --include reasoning.encrypted_content
|
|
194
|
+
openrouter responses "..." -m openai/gpt-4o-mini --stop "END,STOP" --store --include reasoning.encrypted_content
|
|
195
195
|
openrouter responses "..." -m openai/gpt-5-mini --verbosity low --truncation auto
|
|
196
196
|
|
|
197
197
|
# Batches: async jobs at ~half price (chat, responses, messages, embeddings)
|
|
198
|
-
openrouter batches create --endpoint chat -m openai/gpt-4o-mini --file reqs.jsonl # {custom_id, body} per line
|
|
198
|
+
openrouter batches create --endpoint chat -m openai/gpt-4o-mini --file reqs.jsonl --callback-url https://example.com/webhook # {custom_id, body} per line
|
|
199
199
|
openrouter batches wait <id> && openrouter batches results <id> -o out.jsonl
|
|
200
200
|
|
|
201
201
|
# Embeddings (text or images), rerank
|
|
@@ -235,8 +235,8 @@ openrouter models --order intelligence-high-to-low # server-side ranking
|
|
|
235
235
|
openrouter models --free # only :free models
|
|
236
236
|
openrouter models --input-modalities image # image-INPUT (vision) models
|
|
237
237
|
openrouter models --output-modalities image # image-OUTPUT models
|
|
238
|
+
openrouter models user --order newest # account-filtered models, server-side sort
|
|
238
239
|
openrouter models --supported tools # filter by capability
|
|
239
|
-
|
|
240
240
|
# Full detail for one model: pricing breakdown, architecture, supported params,
|
|
241
241
|
# reasoning config, supported voices
|
|
242
242
|
openrouter models show anthropic/claude-sonnet-4.5
|
|
@@ -311,8 +311,8 @@ openrouter guardrails list
|
|
|
311
311
|
openrouter guardrails create "no-paid-models" --allowed-providers "" --enforce-zdr
|
|
312
312
|
openrouter guardrails update <id> --limit-usd 10 --reset-interval daily --include-byok
|
|
313
313
|
openrouter guardrails update <id> --regions europe --builtin-filters email:redact,secrets:block --no-paid-training
|
|
314
|
+
openrouter guardrails update <id> --allow-safety-retention-google --no-allow-safety-retention-other
|
|
314
315
|
openrouter guardrails assign-key <id> <key-hash> # up to 500 hashes per call
|
|
315
|
-
openrouter guardrails delete <id>
|
|
316
316
|
|
|
317
317
|
openrouter workspaces list
|
|
318
318
|
openrouter workspaces create "staging" --slug staging --default-text-model openai/gpt-4o-mini
|
package/package.json
CHANGED
package/src/commands/batches.js
CHANGED
|
@@ -30,6 +30,7 @@ create options:
|
|
|
30
30
|
(a line without "body" is used as the body itself and
|
|
31
31
|
gets custom_id req-<n>). Reads stdin when omitted.
|
|
32
32
|
--completion-window <w> Default: 24h
|
|
33
|
+
--callback-url <url> Webhook URL called on terminal status events
|
|
33
34
|
--provider <json|@file> Routing: {"only": [...], "allow_fallbacks": false}
|
|
34
35
|
--only <csv> Shortcut for provider.only
|
|
35
36
|
--no-fallbacks Shortcut for provider.allow_fallbacks = false
|
|
@@ -228,6 +229,7 @@ export async function batchesCommand(argv) {
|
|
|
228
229
|
endpoint: { type: "string" },
|
|
229
230
|
file: { type: "string" },
|
|
230
231
|
"completion-window": { type: "string" },
|
|
232
|
+
"callback-url": { type: "string" },
|
|
231
233
|
provider: { type: "string" },
|
|
232
234
|
only: { type: "string" },
|
|
233
235
|
"no-fallbacks": { type: "boolean" },
|
|
@@ -257,8 +259,8 @@ export async function batchesCommand(argv) {
|
|
|
257
259
|
const body = { endpoint: resolveEndpoint(values.endpoint), model: values.model };
|
|
258
260
|
if (provider) body.provider = provider;
|
|
259
261
|
if (values["completion-window"]) body.completion_window = values["completion-window"];
|
|
262
|
+
if (values["callback-url"]) body.callback_url = values["callback-url"];
|
|
260
263
|
body.requests = requests;
|
|
261
|
-
|
|
262
264
|
const data = await api("POST", "/batches", { auth: authFromValues(values), body });
|
|
263
265
|
printBatch(data);
|
|
264
266
|
info(`Submitted ${requests.length} request(s). Next: openrouter batches wait ${data.id}`);
|
|
@@ -53,6 +53,10 @@ create / update options:
|
|
|
53
53
|
--free-publication / --no-free-publication Allow free endpoints that publish prompts
|
|
54
54
|
--free-training / --no-free-training Allow free endpoints that train on data
|
|
55
55
|
--paid-training / --no-paid-training Allow paid endpoints that train on data
|
|
56
|
+
--allow-safety-retention-google / --no-allow-safety-retention-google
|
|
57
|
+
Allow ZDR requests to google/* to use endpoints that retain for safety
|
|
58
|
+
--allow-safety-retention-other / --no-allow-safety-retention-other
|
|
59
|
+
Allow ZDR requests to other models to use endpoints that retain for safety
|
|
56
60
|
--include-byok / --no-include-byok Count BYOK spend toward the budget
|
|
57
61
|
--workspace <uuid> (create only)
|
|
58
62
|
--extra <json|@file> Extra body fields, merged last (e.g. enforce_zdr_xai:false)
|
|
@@ -145,6 +149,8 @@ async function buildBody(values) {
|
|
|
145
149
|
["enable_free_model_publication", "free-publication"],
|
|
146
150
|
["enable_free_model_training", "free-training"],
|
|
147
151
|
["enable_paid_model_training", "paid-training"],
|
|
152
|
+
["allow_safety_retention_google", "allow-safety-retention-google"],
|
|
153
|
+
["allow_safety_retention_other", "allow-safety-retention-other"],
|
|
148
154
|
];
|
|
149
155
|
for (const [field, flag] of toggles) {
|
|
150
156
|
const v = toggle(values, flag, `no-${flag}`);
|
|
@@ -182,6 +188,10 @@ const COMMON_FIELDS = {
|
|
|
182
188
|
"no-free-training": { type: "boolean" },
|
|
183
189
|
"paid-training": { type: "boolean" },
|
|
184
190
|
"no-paid-training": { type: "boolean" },
|
|
191
|
+
"allow-safety-retention-google": { type: "boolean" },
|
|
192
|
+
"no-allow-safety-retention-google": { type: "boolean" },
|
|
193
|
+
"allow-safety-retention-other": { type: "boolean" },
|
|
194
|
+
"no-allow-safety-retention-other": { type: "boolean" },
|
|
185
195
|
extra: { type: "string" },
|
|
186
196
|
};
|
|
187
197
|
|
package/src/commands/messages.js
CHANGED
|
@@ -71,8 +71,8 @@ Options:
|
|
|
71
71
|
--temperature <n>
|
|
72
72
|
--top-p <n>
|
|
73
73
|
--seed <n>
|
|
74
|
+
--stop <text> Stop sequence (repeatable via comma, max 4)
|
|
74
75
|
--reasoning <effort> none|minimal|low|medium|high|xhigh|max
|
|
75
|
-
--verbosity <v> low | medium | high | xhigh | max (text.verbosity)
|
|
76
76
|
--truncation <t> auto | disabled
|
|
77
77
|
--models <csv> Fallback models
|
|
78
78
|
--provider <json|@file> Provider routing (order, only, sort, ...;
|
|
@@ -308,9 +308,9 @@ export async function responsesCommand(argv) {
|
|
|
308
308
|
temperature: { type: "string" },
|
|
309
309
|
"top-p": { type: "string" },
|
|
310
310
|
seed: { type: "string" },
|
|
311
|
+
stop: { type: "string" },
|
|
311
312
|
reasoning: { type: "string" },
|
|
312
313
|
models: { type: "string" },
|
|
313
|
-
provider: { type: "string" },
|
|
314
314
|
plugins: { type: "string" },
|
|
315
315
|
metadata: { type: "string" },
|
|
316
316
|
"parallel-tools": { type: "boolean" },
|
|
@@ -349,8 +349,8 @@ export async function responsesCommand(argv) {
|
|
|
349
349
|
"top-p": "top_p",
|
|
350
350
|
seed: "seed",
|
|
351
351
|
});
|
|
352
|
+
if (values.stop) body.stop = values.stop.includes(",") ? values.stop.split(",") : values.stop;
|
|
352
353
|
if (values.reasoning) body.reasoning = { effort: values.reasoning };
|
|
353
|
-
if (values.verbosity) body.text = { verbosity: values.verbosity };
|
|
354
354
|
if (values.truncation) body.truncation = values.truncation;
|
|
355
355
|
if (values.models) body.models = csv(values.models);
|
|
356
356
|
if (values.provider) body.provider = await loadJson(values.provider, "--provider");
|
package/src/commands/models.js
CHANGED
|
@@ -424,13 +424,15 @@ export async function modelsCommand(argv) {
|
|
|
424
424
|
parsed = parseArgs(rest, {
|
|
425
425
|
...PAGINATION_OPTIONS,
|
|
426
426
|
"output-modalities": { type: "string" },
|
|
427
|
+
order: { type: "string" },
|
|
428
|
+
sort: { type: "string" },
|
|
427
429
|
});
|
|
428
430
|
} catch (err) {
|
|
429
431
|
// `models user` used to forward every list filter; the endpoint only
|
|
430
|
-
// takes these
|
|
432
|
+
// takes these, so say so instead of a bare "Unknown option".
|
|
431
433
|
if (err.code === "ERR_PARSE_ARGS_UNKNOWN_OPTION") {
|
|
432
434
|
throw new Error(
|
|
433
|
-
`${err.message.split(".")[0]}. models user only supports --output-modalities, --limit and --offset; use \`openrouter models list\` for search filters.`,
|
|
435
|
+
`${err.message.split(".")[0]}. models user only supports --output-modalities, --order/--sort, --limit and --offset; use \`openrouter models list\` for search filters.`,
|
|
434
436
|
);
|
|
435
437
|
}
|
|
436
438
|
throw err;
|
|
@@ -438,13 +440,20 @@ export async function modelsCommand(argv) {
|
|
|
438
440
|
const { values } = parsed;
|
|
439
441
|
if (values.help) {
|
|
440
442
|
process.stdout.write(
|
|
441
|
-
"Usage: openrouter models user [
|
|
443
|
+
"Usage: openrouter models user [options]\n\n" +
|
|
442
444
|
"List models filtered by your provider preferences, privacy settings, and\n" +
|
|
443
445
|
"guardrails. Uses your API key; on a regional host (eu/us) only models that\n" +
|
|
444
446
|
"can route in-region are returned.\n\n" +
|
|
445
447
|
"Options:\n" +
|
|
446
448
|
" --output-modalities <csv> text,image,embeddings,audio,video,rerank,decisions,\n" +
|
|
447
449
|
' speech,transcription (or "all"). Default: text\n' +
|
|
450
|
+
" --order <sort> Server-side sort: most-popular|newest|top-weekly|\n" +
|
|
451
|
+
" pricing-low-to-high|pricing-high-to-low|\n" +
|
|
452
|
+
" context-high-to-low|throughput-high-to-low|\n" +
|
|
453
|
+
" latency-low-to-high|intelligence-high-to-low|\n" +
|
|
454
|
+
" coding-high-to-low|agentic-high-to-low|\n" +
|
|
455
|
+
" design-arena-elo-high-to-low\n" +
|
|
456
|
+
" --sort <sort> Alias for --order\n" +
|
|
448
457
|
" --limit <n> Max rows (1-1000). Omit limit and offset for all\n" +
|
|
449
458
|
" --offset <n> Rows to skip\n",
|
|
450
459
|
);
|
|
@@ -452,6 +461,7 @@ export async function modelsCommand(argv) {
|
|
|
452
461
|
}
|
|
453
462
|
const query = paginationQuery(values);
|
|
454
463
|
if (values["output-modalities"]) query.output_modalities = values["output-modalities"];
|
|
464
|
+
if (values.order || values.sort) query.sort = values.order || values.sort;
|
|
455
465
|
const data = await api("GET", "/models/user", {
|
|
456
466
|
auth: authFromValues(values),
|
|
457
467
|
query,
|