ai
OpenRouter MCP, CLI, and Lua Integration for AI Agents
OpenRouter integration docs for AI agents: MCP gateway setup, OpenRouter CLI commands, Lua API reference, credentials, and function schemas.
7 functions 6 read 1 write API key auth
OpenRouter for agents
Credentials can be configured manually in web or CLI hosts.
Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.
Machine-Readable Metadata
- integration_slug
openrouter- route_slug
openrouter- package
openrouter- auth_strategy
api_keyAPI key- cli_setup_supported
true- cli_runtime_supported
true- mcp_gateway_supported
true- lua_supported
true- supports_multi_account
true
Quick Links
Lua APIAgent-facing namespace and function reference. OpenRouter CLIHeadless setup and direct function calls. OpenRouter MCPMCP gateway setup for external clients. Submit feedbackReport missing tools, auth problems, wrong docs, or runtime issues. ContributeAdd tools or improve metadata in the integrations repo.
OpenRouter MCP Client Matrix
Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for OpenRouter.
Claude Code OpenRouter MCP setup for Claude Code. Cursor OpenRouter MCP setup for Cursor. Codex OpenRouter MCP setup for Codex. OpenAI Agents OpenRouter MCP setup for OpenAI Agents SDK. Claude Agent SDK OpenRouter MCP setup for Claude Agent SDK. Vercel AI SDK OpenRouter MCP setup for Vercel AI SDK. LangChain OpenRouter MCP setup for LangChain. LangGraph OpenRouter MCP setup for LangGraph. CrewAI OpenRouter MCP setup for CrewAI. MCP clients OpenRouter MCP setup for Generic MCP Clients.
OpenRouter CLI Matrix
Use these pages for direct OpenRouter CLI workflows in scripts, CI, cron, and agent wrappers.
CI OpenRouter CLI for CI. Cron Jobs OpenRouter CLI for cron jobs. Shell Scripts OpenRouter CLI for shell scripts. Headless Automation OpenRouter CLI for headless automation. Coding Agents OpenRouter CLI for coding agents.
Function Catalog
| Function | Type | Parameters | Description |
|---|---|---|---|
openrouter.openrouter_list_models | Read read | 0 | List available AI models on OpenRouter. Returns model identifiers, names, pricing, context lengths, and capabilities. |
openrouter.openrouter_create_completion | Write write | 7 | Create a chat completion using any model available on OpenRouter. Supports multi-turn conversations, system prompts, temperature control, and configurable output length. |
openrouter.openrouter_list_generations | Read read | 3 | List generation records from OpenRouter. Returns generation IDs, models used, token counts, and costs. |
openrouter.openrouter_get_generation | Read read | 1 | Get details for a specific OpenRouter generation, including token usage, costs, and latency. |
openrouter.openrouter_list_api_keys | Read read | 0 | List API keys for the OpenRouter account. Returns key names, creation dates, and usage limits. |
openrouter.openrouter_get_usage | Read read | 1 | Get usage statistics for the OpenRouter account, including token counts and costs. |
openrouter.openrouter_get_current_user | Read read | 0 | Get the authenticated user's profile and account information. |