@aaronjmars/openroutercli 0.2.0 → 0.2.1
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/SKILL.md +79 -14
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: openrouter-cli
|
|
3
|
-
description: Use the `openrouter` CLI to call any OpenRouter API endpoint from the shell - chat / messages / responses, embeddings, rerank,
|
|
3
|
+
description: Use the `openrouter` CLI to call any OpenRouter API endpoint from the shell - chat / messages / responses (with web search, PDF input, prompt caching, reasoning budgets, tools), embeddings, rerank, text-to-speech, speech-to-text, image + video generation, model + provider discovery, generation lookup, credits, activity, and full key / BYOK / guardrail / workspace / files / presets management. Pass `--json` on every command for machine-parseable output.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# openrouter-cli skill
|
|
@@ -18,8 +18,12 @@ TRIGGER when the user asks to:
|
|
|
18
18
|
- check credits, per-key spend, daily/weekly/monthly usage, or rate limits
|
|
19
19
|
- inspect or audit a specific generation (`gen-...` id) - input, output, cost,
|
|
20
20
|
latency, finish reason
|
|
21
|
+
- run chat with web search, a PDF/file attachment, prompt caching, a reasoning
|
|
22
|
+
budget, tools, or structured output
|
|
23
|
+
- generate an image, transcribe audio to text (STT), or synthesize speech (TTS)
|
|
21
24
|
- create / list / disable / delete OpenRouter API keys programmatically
|
|
22
|
-
- manage guardrails, workspaces,
|
|
25
|
+
- manage BYOK provider integrations, guardrails, workspaces, files, presets, or
|
|
26
|
+
organization members
|
|
23
27
|
- log in to OpenRouter from a fresh machine (OAuth PKCE in the browser)
|
|
24
28
|
|
|
25
29
|
SKIP when the user is already using the OpenAI / Anthropic / Cohere SDKs
|
|
@@ -72,8 +76,8 @@ command automatically.
|
|
|
72
76
|
|
|
73
77
|
| Slot | Used by | How to obtain |
|
|
74
78
|
| --- | --- | --- |
|
|
75
|
-
| **User key** | `chat`, `messages`, `responses`, `embed`, `rerank`, `speech`, `video`, `generation`, `credits`, `whoami` | OAuth (`openrouter login`) or paste from dashboard |
|
|
76
|
-
| **Management key** | `keys`, `guardrails`, `workspaces`, `activity`, `org members`, `auth-code` | Dashboard only - <https://openrouter.ai/settings/provisioning-keys>. Cannot be obtained via OAuth. Save with `openrouter login --management`. |
|
|
79
|
+
| **User key** | `chat`, `messages`, `responses`, `embed`, `rerank`, `speech`, `transcribe`, `image`, `video`, `files`, `presets`, `generation`, `credits`, `whoami` | OAuth (`openrouter login`) or paste from dashboard |
|
|
80
|
+
| **Management key** | `keys`, `byok`, `guardrails`, `workspaces`, `activity`, `org members`, `auth-code` | Dashboard only - <https://openrouter.ai/settings/provisioning-keys>. Cannot be obtained via OAuth. Save with `openrouter login --management`. |
|
|
77
81
|
|
|
78
82
|
You can store both - they live side by side in the config file. `--key sk-or-...`
|
|
79
83
|
always wins over both. Inference commands prefer the user key; management
|
|
@@ -129,8 +133,26 @@ openrouter chat "What is 2+2?" -m openai/gpt-4o-mini \
|
|
|
129
133
|
--tool '{"name":"add","parameters":{"type":"object","properties":{"a":{"type":"number"},"b":{"type":"number"}},"required":["a","b"]}}' \
|
|
130
134
|
--tool-choice required --raw
|
|
131
135
|
|
|
132
|
-
# Reasoning effort
|
|
136
|
+
# Reasoning: effort level, an explicit token budget, or reason-but-hide
|
|
133
137
|
openrouter chat "tricky question" -m anthropic/claude-sonnet-4.5 --reasoning high
|
|
138
|
+
openrouter chat "prove it" -m openai/gpt-5-mini --reasoning-max-tokens 2000
|
|
139
|
+
openrouter chat "quick" -m openai/gpt-5-mini --reasoning-exclude
|
|
140
|
+
|
|
141
|
+
# Web search plugin (also works via the :online model suffix)
|
|
142
|
+
openrouter chat "what shipped in the news today?" -m openai/gpt-4o-mini --web --web-max-results 3
|
|
143
|
+
|
|
144
|
+
# Attach a PDF / file and parse it
|
|
145
|
+
openrouter chat "summarize this" -m google/gemini-2.5-flash --file ./report.pdf --pdf-engine mistral-ocr
|
|
146
|
+
|
|
147
|
+
# Prompt caching: mark the system (or user) prompt as a cache breakpoint
|
|
148
|
+
openrouter chat "answer from the doc" -m anthropic/claude-sonnet-4.5 -s "$(cat big-context.txt)" --cache-system
|
|
149
|
+
|
|
150
|
+
# Sampling / output controls
|
|
151
|
+
openrouter chat "..." -m openai/gpt-4o-mini --top-a 0.2 --logprobs --top-logprobs 5
|
|
152
|
+
|
|
153
|
+
# Escape hatch: merge extra body fields, or send a fully-formed body
|
|
154
|
+
openrouter chat "..." -m openai/gpt-4o-mini --extra '{"transforms":["middle-out"]}'
|
|
155
|
+
openrouter chat --body @request.json
|
|
134
156
|
|
|
135
157
|
# Provider routing / fallback models
|
|
136
158
|
openrouter chat "..." -m primary/model --models fallback1/m,fallback2/m
|
|
@@ -141,13 +163,19 @@ openrouter chat -i -m openrouter/auto
|
|
|
141
163
|
# Inside the REPL: /model <id>, /reset, /exit
|
|
142
164
|
|
|
143
165
|
# Anthropic-format and OpenAI Responses API are also available
|
|
144
|
-
openrouter messages "..." -m anthropic/claude-sonnet-4.5
|
|
145
|
-
openrouter responses "..." -m openai/gpt-4o-mini
|
|
166
|
+
openrouter messages "..." -m anthropic/claude-sonnet-4.5 --thinking-budget 2000
|
|
167
|
+
openrouter responses "..." -m openai/gpt-4o-mini --store --include reasoning.encrypted_content
|
|
146
168
|
|
|
147
|
-
# Embeddings, rerank
|
|
169
|
+
# Embeddings, rerank
|
|
148
170
|
openrouter embed -m openai/text-embedding-3-small "hello" "world"
|
|
149
171
|
openrouter rerank -m cohere/rerank-v3.5 --query "italian food" -d pizza -d sushi -d pasta
|
|
172
|
+
|
|
173
|
+
# Text to speech (audio out) and speech to text (audio in)
|
|
150
174
|
openrouter speech "Hello there" -m elevenlabs/eleven-turbo-v2 --voice alloy -o out.mp3
|
|
175
|
+
openrouter transcribe ./clip.wav -m openai/gpt-4o-transcribe # alias: stt
|
|
176
|
+
|
|
177
|
+
# Image generation (writes image-0.png, ...); and video jobs
|
|
178
|
+
openrouter image "a red bike on a beach" -m google/gemini-2.5-flash-image -o bike.png
|
|
151
179
|
openrouter video create "a sunset over mountains" -m google/veo-3
|
|
152
180
|
openrouter video wait <jobId> && openrouter video download <jobId> -o out.mp4
|
|
153
181
|
```
|
|
@@ -156,16 +184,22 @@ openrouter video wait <jobId> && openrouter video download <jobId> -o out.mp4
|
|
|
156
184
|
|
|
157
185
|
```bash
|
|
158
186
|
# Browse / filter / sort the catalog
|
|
159
|
-
openrouter models # all (~
|
|
160
|
-
openrouter models --filter sonnet --sort prompt # cheapest first
|
|
187
|
+
openrouter models # all (~430)
|
|
188
|
+
openrouter models --filter sonnet --sort prompt # local sort, cheapest first
|
|
189
|
+
openrouter models --order intelligence-high-to-low # server-side ranking
|
|
161
190
|
openrouter models --free # only :free models
|
|
162
|
-
openrouter models --
|
|
191
|
+
openrouter models --input-modalities image # image-INPUT (vision) models
|
|
192
|
+
openrouter models --output-modalities image # image-OUTPUT models
|
|
163
193
|
openrouter models --supported tools # filter by capability
|
|
164
194
|
|
|
165
|
-
# Full detail for one model: pricing breakdown, architecture, supported params
|
|
195
|
+
# Full detail for one model: pricing breakdown, architecture, supported params,
|
|
196
|
+
# reasoning config, supported voices
|
|
166
197
|
openrouter models show anthropic/claude-sonnet-4.5
|
|
167
198
|
|
|
168
|
-
#
|
|
199
|
+
# Supported params + popularity analytics (p10/p50/p90 per parameter)
|
|
200
|
+
openrouter models parameters openai/gpt-4o --provider openai
|
|
201
|
+
|
|
202
|
+
# Compare provider variants for one model - find the best one (status column too)
|
|
169
203
|
openrouter models endpoints anthropic/claude-sonnet-4.5 --sort throughput --best
|
|
170
204
|
openrouter models endpoints openai/gpt-4o-mini --sort latency
|
|
171
205
|
openrouter models endpoints openai/gpt-4o-mini --sort prompt
|
|
@@ -173,6 +207,7 @@ openrouter models endpoints openai/gpt-4o-mini --sort prompt
|
|
|
173
207
|
# Supporting metadata
|
|
174
208
|
openrouter providers # all providers
|
|
175
209
|
openrouter embed models # embedding models
|
|
210
|
+
openrouter image models # image gen models
|
|
176
211
|
openrouter video models # video gen models
|
|
177
212
|
openrouter zdr # ZDR-eligible endpoints
|
|
178
213
|
```
|
|
@@ -217,7 +252,7 @@ response - capture it then.
|
|
|
217
252
|
```bash
|
|
218
253
|
openrouter guardrails list
|
|
219
254
|
openrouter guardrails create "no-paid-models" --allowed-providers "" --enforce-zdr
|
|
220
|
-
openrouter guardrails update <id> --limit-usd 10 --reset-interval daily
|
|
255
|
+
openrouter guardrails update <id> --limit-usd 10 --reset-interval daily --include-byok
|
|
221
256
|
openrouter guardrails assign-key <id> <key-hash>
|
|
222
257
|
openrouter guardrails delete <id>
|
|
223
258
|
|
|
@@ -229,6 +264,36 @@ openrouter workspaces delete <id|slug>
|
|
|
229
264
|
openrouter org members
|
|
230
265
|
```
|
|
231
266
|
|
|
267
|
+
### BYOK provider integrations (management key required)
|
|
268
|
+
|
|
269
|
+
Bring-your-own-key: register upstream provider secrets so OpenRouter routes
|
|
270
|
+
through your own provider accounts.
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
openrouter byok list
|
|
274
|
+
openrouter byok create --provider anthropic --api-key sk-ant-... --name "my anthropic" --fallback
|
|
275
|
+
openrouter byok update <id> --allowed-models "anthropic/claude-sonnet-4.5" --disabled
|
|
276
|
+
openrouter byok get <id>
|
|
277
|
+
openrouter byok delete <id>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The `--api-key` flag is the upstream provider secret (never echoed back).
|
|
281
|
+
|
|
282
|
+
### Files, presets (user key)
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# Files - backing store for file/PDF inputs
|
|
286
|
+
openrouter files upload ./report.pdf --purpose user_data
|
|
287
|
+
openrouter files list
|
|
288
|
+
openrouter files download <file_id> -o report.pdf
|
|
289
|
+
openrouter files delete <file_id>
|
|
290
|
+
|
|
291
|
+
# Presets - saved config profiles (read-only). Invoke via @preset/<slug> as a model.
|
|
292
|
+
openrouter presets list
|
|
293
|
+
openrouter presets get <slug>
|
|
294
|
+
openrouter presets versions <slug>
|
|
295
|
+
```
|
|
296
|
+
|
|
232
297
|
### Raw escape hatch
|
|
233
298
|
|
|
234
299
|
For any endpoint that doesn't have a first-class subcommand yet (or new
|