{"_id":"@elizaos/plugin-openrouter-root","_rev":"4-1edb4d74b6a06f360b6d504d564f9736","name":"@elizaos/plugin-openrouter-root","dist-tags":{"next":"2.0.0-alpha.1","latest":"2.0.0-alpha.1"},"versions":{"2.0.0-alpha.1":{"name":"@elizaos/plugin-openrouter-root","version":"2.0.0-alpha.1","keywords":[],"author":{"name":"elizaOS"},"license":"MIT","_id":"@elizaos/plugin-openrouter-root@2.0.0-alpha.1","maintainers":[{"name":"shawticus","email":"shawmakesmagic@gmail.com"},{"name":"shakkernerd","email":"shakkerdroid@gmail.com"},{"name":"wtfsayo","email":"hi@sayo.wtf"},{"name":"odilitime","email":"janesmith@airmail.cc"},{"name":"cjft","email":"cjft@trimboli.io"}],"homepage":"https://github.com/elizaos-plugins/plugin-openrouter#readme","bugs":{"url":"https://github.com/elizaos-plugins/plugin-openrouter/issues"},"dist":{"shasum":"abe3fec355577b76f1b06038010e9a48a7576dda","tarball":"https://registry.npmjs.org/@elizaos/plugin-openrouter-root/-/plugin-openrouter-root-2.0.0-alpha.1.tgz","fileCount":51,"integrity":"sha512-lU54qkmhEXqVcXND4fcTMuGyaBXrn51+7PXEjMduRvOUWv71xCnbAyDjdrCqE+qEWf/uJei8/vCUSrvqnTo/fw==","signatures":[{"sig":"MEQCIC66UbA8I7fMtGPMQVsi5VDPYD4leYGPXztoJICPrdpVAiA4CTtwl68Kvi4ixxxgGJqDTEbvm0o5zBEp5Y8bCyqT+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":354852},"main":"typescript/dist/index.js","type":"module","types":"typescript/dist/index.d.ts","exports":{".":{"types":"./typescript/dist/index.d.ts","import":"./typescript/dist/index.js","default":"./typescript/dist/index.js"},"./rust":{"import":"./rust/pkg/node/elizaos_plugin_plugin_openrouter.js"},"./package.json":"./package.json"},"gitHead":"05d4ca11d769db8c7f54a722ee24b2ce2b951543","scripts":{"dev":"cd typescript && bun --hot build.ts","lint":"bunx @biomejs/biome check --write ./typescript","test":"bun run test:ts && bun run test:rust && bun run test:python","build":"bun run build:ts && bun run build:rust && bun run build:python","clean":"rm -rf typescript/dist python/dist rust/target .turbo node_modules","test:ts":"cd typescript && vitest run || echo 'TypeScript tests skipped - no tests found'","build:ts":"cd typescript && bun run build.ts","lint:rust":"test -d rust && cd rust && cargo clippy --all-targets --fix --allow-dirty --allow-staged -- -D warnings && cargo fmt || echo 'Rust lint skipped'","test:rust":"test -d rust && cd rust && cargo test || echo 'Rust tests skipped'","typecheck":"tsc --noEmit -p typescript/tsconfig.json","build:rust":"test -d rust && cd rust && cargo build --release || echo 'Rust build skipped - no rust directory'","lint:check":"bunx @biomejs/biome check ./typescript","lint:python":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint skipped'","test:python":"test -d python && cd python && pytest -p no:anchorpy --asyncio-mode=auto || echo 'Python tests skipped'","build:python":"test -d python && cd python && (python3 -m build 2>/dev/null || pyproject-build) || echo 'Python build skipped - no python directory'","lint:python:fix":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint fix skipped'"},"_npmUser":{"name":"shawticus","email":"shawmakesmagic@gmail.com"},"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-openrouter.git","type":"git"},"_npmVersion":"lerna/9.0.3/node@v22.20.0+arm64 (darwin)","agentConfig":{"pluginType":"elizaos:plugin:1.0.0","pluginParameters":{"IMAGE_MODEL":{"type":"string","default":"x-ai/grok-2-vision-1212","required":false,"sensitive":false,"description":"General fallback environment variable for the image model name when OPENROUTER_IMAGE_MODEL is not set."},"LARGE_MODEL":{"type":"string","default":"google/gemini-2.5-flash","required":false,"sensitive":false,"description":"General fallback environment variable for the large model name when OPENROUTER_LARGE_MODEL is not set."},"SMALL_MODEL":{"type":"string","default":"google/gemini-2.0-flash-001","required":false,"sensitive":false,"description":"General fallback environment variable for the small model name when OPENROUTER_SMALL_MODEL is not set."},"EMBEDDING_MODEL":{"type":"string","default":"openai/text-embedding-3-small","required":false,"sensitive":false,"description":"General fallback environment variable for the embedding model name when OPENROUTER_EMBEDDING_MODEL is not set."},"OPENROUTER_API_KEY":{"type":"string","required":true,"sensitive":true,"description":"API key used by the OpenRouter plugin for authenticating requests."},"OPENROUTER_BASE_URL":{"type":"string","default":"https://openrouter.ai/api/v1","required":false,"sensitive":false,"description":"Base URL for the OpenRouter API endpoints."},"EMBEDDING_DIMENSIONS":{"type":"number","default":1536,"required":false,"sensitive":false,"description":"General fallback environment variable for the embedding dimensions when OPENROUTER_EMBEDDING_DIMENSIONS is not set."},"IMAGE_GENERATION_MODEL":{"type":"string","default":"google/gemini-2.5-flash-image-preview","required":false,"sensitive":false,"description":"General fallback environment variable for the image generation model name when OPENROUTER_IMAGE_GENERATION_MODEL is not set."},"OPENROUTER_IMAGE_MODEL":{"type":"string","required":false,"sensitive":false,"description":"Overrides the default image description model used by the OpenRouter plugin."},"OPENROUTER_LARGE_MODEL":{"type":"string","default":"google/gemini-2.5-flash","required":false,"sensitive":false,"description":"Overrides the default large language model used for text/object generation."},"OPENROUTER_SMALL_MODEL":{"type":"string","default":"google/gemini-2.0-flash-001","required":false,"sensitive":false,"description":"Overrides the default small language model used for text/object generation."},"OPENROUTER_EMBEDDING_MODEL":{"type":"string","default":"openai/text-embedding-3-small","required":false,"sensitive":false,"description":"Overrides the default text embedding model used by the OpenRouter plugin."},"OPENROUTER_BROWSER_BASE_URL":{"type":"string","required":false,"sensitive":false,"description":"Browser-only proxy endpoint base URL for OpenRouter requests (no secrets in the client)."},"OPENROUTER_AUTO_CLEANUP_IMAGES":{"type":"boolean","default":false,"required":false,"sensitive":false,"description":"Whether to automatically cleanup generated images after a short delay."},"OPENROUTER_EMBEDDING_DIMENSIONS":{"type":"number","default":1536,"required":false,"sensitive":false,"description":"Number of dimensions for embedding vectors. Supported values: 256, 384, 512, 768, 1024, 1536, 2048, 3072."},"OPENROUTER_IMAGE_GENERATION_MODEL":{"type":"string","default":"google/gemini-2.5-flash-image-preview","required":false,"sensitive":false,"description":"Overrides the default image generation model used by the OpenRouter plugin."},"OPENROUTER_TOOL_EXECUTION_MAX_STEPS":{"type":"number","default":15,"required":false,"sensitive":false,"description":"Maximum number of steps for multi-step tool execution. Allows the AI to generate descriptive text after calling tools in AI SDK v5."}}},"description":"This plugin provides integration with various models available through the OpenRouter API via the ElizaOS platform.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.5","typescript":"^5.9.3","@types/node":"^25.0.3","@biomejs/biome":"^2.3.11"},"peerDependencies":{"@elizaos/core":"2.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/plugin-openrouter-root_2.0.0-alpha.1_1769034080735_0.02446918054503322","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-01-21T22:21:20.623Z","modified":"2026-06-16T05:14:58.634Z","2.0.0-alpha.1":"2026-01-21T22:21:20.899Z"},"bugs":{"url":"https://github.com/elizaos-plugins/plugin-openrouter/issues"},"author":{"name":"elizaOS"},"license":"MIT","homepage":"https://github.com/elizaos-plugins/plugin-openrouter#readme","keywords":[],"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-openrouter.git","type":"git"},"description":"This plugin provides integration with various models available through the OpenRouter API via the ElizaOS platform.","maintainers":[{"email":"shawmakesmagic@gmail.com","name":"shawticus"},{"email":"janesmith@airmail.cc","name":"odilitime"}],"readme":"# @elizaos/plugin-openrouter\n\nThis plugin provides integration with various models available through the OpenRouter API via the ElizaOS platform.\n\n## Usage\n\nAdd the plugin to your character configuration:\n\n```json\n\"plugins\": [\"@elizaos/plugin-openrouter\"]\n```\n\n## Configuration\n\nThe plugin requires the OpenRouter API key and can be configured via environment variables or character settings.\n\n**Character Settings Example:**\n\n```json\n\"settings\": {\n  \"OPENROUTER_API_KEY\": \"your_openrouter_api_key\",\n  \"OPENROUTER_BASE_URL\": \"https://openrouter.ai/api/v1\", // Optional: Default is OpenRouter endpoint\n  \"OPENROUTER_SMALL_MODEL\": \"google/gemini-flash\", // Optional: Overrides default small model\n  \"OPENROUTER_LARGE_MODEL\": \"google/gemini-pro\", // Optional: Overrides default large model\n  \"OPENROUTER_IMAGE_MODEL\": \"x-ai/grok-2-vision-1212\", // Optional: Overrides default image model\n  \"OPENROUTER_IMAGE_GENERATION_MODEL\": \"google/gemini-2.5-flash-image-preview\", // Optional: Overrides default image generation model\n  \"OPENROUTER_EMBEDDING_MODEL\": \"openai/text-embedding-3-small\", // Optional: Overrides default embedding model\n  \"OPENROUTER_EMBEDDING_DIMENSIONS\": \"1536\", // Optional: Sets embedding vector dimensions (256, 384, 512, 768, 1024, 1536, 2048, 3072)\n  \"OPENROUTER_BROWSER_BASE_URL\": \"https://your-proxy.example.com/openrouter\"\n  // Fallbacks if specific OPENROUTER models are not set\n  \"SMALL_MODEL\": \"google/gemini-flash\",\n  \"LARGE_MODEL\": \"google/gemini-pro\",\n  \"IMAGE_MODEL\": \"x-ai/grok-2-vision-1212\",\n  \"IMAGE_GENERATION_MODEL\": \"google/gemini-2.5-flash-image-preview\",\n  \"EMBEDDING_MODEL\": \"openai/text-embedding-3-small\",\n  \"EMBEDDING_DIMENSIONS\": \"1536\"\n}\n```\n\n**`.env` File Example:**\n\n```\nOPENROUTER_API_KEY=your_openrouter_api_key\n# Optional overrides:\nOPENROUTER_BASE_URL=https://openrouter.ai/api/v1\nOPENROUTER_SMALL_MODEL=google/gemini-flash\nOPENROUTER_LARGE_MODEL=google/gemini-pro\nOPENROUTER_IMAGE_MODEL=x-ai/grok-2-vision-1212\nOPENROUTER_IMAGE_GENERATION_MODEL=google/gemini-2.5-flash-image-preview\nOPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-small\nOPENROUTER_EMBEDDING_DIMENSIONS=1536\n# Browser proxy (frontend builds only)\nOPENROUTER_BROWSER_BASE_URL=https://your-proxy.example.com/openrouter\n# Fallbacks if specific OPENROUTER models are not set\nSMALL_MODEL=google/gemini-flash\nLARGE_MODEL=google/gemini-pro\nIMAGE_MODEL=x-ai/grok-2-vision-1212\nIMAGE_GENERATION_MODEL=google/gemini-2.5-flash-image-preview\nEMBEDDING_MODEL=openai/text-embedding-3-small\nEMBEDDING_DIMENSIONS=1536\n```\n\n### Configuration Options\n\n- `OPENROUTER_API_KEY` (required): Your OpenRouter API key.\n- `OPENROUTER_BASE_URL`: Custom API endpoint (default: https://openrouter.ai/api/v1).\n- `OPENROUTER_BROWSER_BASE_URL`: Browser-only base URL to a proxy endpoint that forwards requests to OpenRouter without exposing keys.\n\n### Browser mode and proxying\n\nWhen bundled for the browser, this plugin avoids sending Authorization headers. Set `OPENROUTER_BROWSER_BASE_URL` to a server-side proxy you control that injects the OpenRouter API key. This prevents exposing secrets in frontend builds.\n\nExample minimal proxy (Express):\n\n```ts\nimport express from \"express\";\nimport fetch from \"node-fetch\";\n\nconst app = express();\napp.use(express.json());\n\napp.post(\"/openrouter/*\", async (req, res) => {\n  const url = `https://openrouter.ai/api/v1/${req.params[0]}`;\n  const r = await fetch(url, {\n    method: \"POST\",\n    headers: {\n      Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify(req.body),\n  });\n  res\n    .status(r.status)\n    .set(Object.fromEntries(r.headers))\n    .send(await r.text());\n});\n\napp.listen(3000);\n```\n\n- `OPENROUTER_SMALL_MODEL`: Specific model to use for `TEXT_SMALL` and `OBJECT_SMALL`. Overrides `SMALL_MODEL` if set.\n- `OPENROUTER_LARGE_MODEL`: Specific model to use for `TEXT_LARGE` and `OBJECT_LARGE`. Overrides `LARGE_MODEL` if set.\n- `OPENROUTER_IMAGE_MODEL`: Specific model to use for `IMAGE_DESCRIPTION`. Overrides `IMAGE_MODEL` if set.\n- `OPENROUTER_IMAGE_GENERATION_MODEL`: Specific model to use for `IMAGE` generation. Overrides `IMAGE_GENERATION_MODEL` if set.\n- `OPENROUTER_EMBEDDING_MODEL`: Specific model to use for `TEXT_EMBEDDING`. Overrides `EMBEDDING_MODEL` if set.\n- `OPENROUTER_EMBEDDING_DIMENSIONS`: Number of dimensions for embedding vectors. Supported values: 256, 384, 512, 768, 1024, 1536, 2048, 3072. Defaults to 1536.\n- `OPENROUTER_AUTO_CLEANUP_IMAGES`: Whether to automatically delete generated images after 30 seconds (default: \"false\"). Set to \"true\" to enable auto-cleanup.\n- `SMALL_MODEL`: Fallback model for small tasks (default: \"google/gemini-2.0-flash-001\"). Used if `OPENROUTER_SMALL_MODEL` is not set.\n- `LARGE_MODEL`: Fallback model for large tasks (default: \"openai/gpt-4.1-nano\"). Used if `OPENROUTER_LARGE_MODEL` is not set.\n- `IMAGE_MODEL`: Fallback model for image analysis (default: \"x-ai/grok-2-vision-1212\"). Used if `OPENROUTER_IMAGE_MODEL` is not set.\n- `IMAGE_GENERATION_MODEL`: Fallback model for image generation (default: \"google/gemini-2.5-flash-image-preview\"). Used if `OPENROUTER_IMAGE_GENERATION_MODEL` is not set.\n- `EMBEDDING_MODEL`: Fallback model for text embeddings (default: \"openai/text-embedding-3-small\"). Used if `OPENROUTER_EMBEDDING_MODEL` is not set.\n- `EMBEDDING_DIMENSIONS`: Fallback dimension setting for embeddings (default: \"1536\"). Used if `OPENROUTER_EMBEDDING_DIMENSIONS` is not set.\n\n## Provided Models\n\nThe plugin currently provides these model types:\n\n- `TEXT_SMALL`: Optimized for fast, cost-effective text generation using the configured small model.\n- `TEXT_LARGE`: For more complex text generation tasks requiring larger models, using the configured large model.\n- `OBJECT_SMALL`: Generates structured JSON objects based on a prompt, using the configured small model.\n- `OBJECT_LARGE`: Generates structured JSON objects based on a prompt, using the configured large model.\n- `IMAGE_DESCRIPTION`: Analyzes images and provides descriptive text and titles, using the configured image model.\n- `IMAGE`: Generates images from text prompts using the configured image generation model (e.g., Gemini 2.5 Flash Image Preview).\n- `TEXT_EMBEDDING`: Generates vector embeddings for text input, supporting configurable dimensions from 256 to 3072, using the configured embedding model.\n\n_Note: Audio Transcription is not currently implemented in this specific OpenRouter plugin._\n","readmeFilename":"README.md"}