| name | openrouter-embeddings |
| description | Generate text embeddings via OpenRouter using Qwen3-Embedding-8B. |
openrouter-embeddings
Text → embedding vector via OpenRouter. Default model: qwen/qwen3-embedding-8b.
Usage
Resolve TOOL_DIR = the directory containing this SKILL.md. Commands below use TOOL_DIR as a symbolic placeholder; replace it with the resolved, quoted path before running Bash.
Single text
export OPENROUTER_API_KEY=sk-or-v1-...
python3 TOOL_DIR/scripts/embed.py \
--text "The quick brown fox jumps over the lazy dog" \
--output vec.json
Batch from JSONL
Input records.jsonl (one JSON per line):
{"id": "row_0", "text": "Every place name in the United States."}
{"id": "row_1", "text": "Nearby stars and potential exoplanets."}
Run:
python3 TOOL_DIR/scripts/embed.py \
--jsonl records.jsonl \
--output records_with_embeddings.jsonl \
--batch-size 32
Output is the same JSONL with an added embedding field per line.
Flags
| Flag | Default | Description |
|---|
--text | — | Embed one string (mutually exclusive with --jsonl) |
--jsonl | — | Embed many; each line must have a text field |
--output | required |