Skip to content

OpenRouter API and MCP

OpenRouter provides text and multimodal model inference through a common API. An agent can request model responses and inspect model information for integrations. Add your OpenRouter key once in Longwave settings; calls run on your vendor account.

Add to Longwave

Add OpenRouter to your agent

Paste this into Claude Code or a terminal. Then run /mcp to sign in.

functions
6
access
Your key
tasks
1

Use OpenRouter on Longwave

  1. Download Longwave or open app.longwave.run.
  2. Add your OpenRouter API key once in Longwave settings. Calls run on your OpenRouter account at OpenRouter's price.
  3. Ask for the result in any thread, for example: “Draft text for a research brief”. The agent picks the OpenRouter function and calls it.

Use OpenRouter in Claude Code, Codex, Cursor or ChatGPT

Add the Longwave MCP server once. It carries 2,593 functions across 103 tools, including OpenRouter, and asks you to sign in on first use.

Why call OpenRouter through Longwave

  • Your OpenRouter key is stored once, encrypted, and used by every harness and device you use.
  • One MCP server for 103 tools, so your agent setup does not grow a key and a server per vendor.
  • Spending limits per key and per account, checked before a paid call is made.
  • Each call is recorded with the provider, the cost and the result, and can be read again from another device.

OpenRouter functions

Function Price
Generate a response with an OpenRouter model Accepts a model name, conversation messages and an output token limit and returns a model response to the supplied conversation. openrouter.chat.complete
The selected model and usage determine the charge; no single per-call price applies to this function.
List OpenRouter endpoints with zero data retention Returns model endpoints available under zero data retention without requiring input parameters. openrouter.openapi.get.endpoints.zdr
Model or provider metadata lookup; no generation charge or separate published per-call fee.
List OpenRouter models Accepts a category, output types, a search term and input modalities and returns available models and their capabilities and prices. openrouter.openapi.get.models
Model or provider metadata lookup; no generation charge or separate published per-call fee.
List OpenRouter endpoints for a model Accepts a model author and a model slug and returns model hosting endpoints and their properties. openrouter.openapi.get.models.author.slug.endpoints
Model or provider metadata lookup; no generation charge or separate published per-call fee.
Get the number of OpenRouter models Accepts output types and returns the count of available models. openrouter.openapi.get.models.count
Model or provider metadata lookup; no generation charge or separate published per-call fee.
List OpenRouter model providers Returns available model hosting providers without requiring input parameters. openrouter.openapi.get.providers
Model or provider metadata lookup; no generation charge or separate published per-call fee.

Prices are OpenRouter's published rates. Source: OpenRouter pricing.

Use cases

Questions people ask

How do I get an OpenRouter API key?

Sign in to OpenRouter and create a key at openrouter.ai/settings/keys. Add it once in Longwave settings and your agents' OpenRouter calls run on your own account. OpenRouter API keys

Does OpenRouter use one price for every model?

OpenRouter publishes pricing by model. Its model information includes separate pricing fields, so check the selected model before estimating usage. OpenRouter documentation

Do I need an OpenRouter account?

Yes. Create a key at https://openrouter.ai/settings/keys and add it in Longwave settings. Longwave stores it encrypted and uses it only for your calls.

How do I use OpenRouter in Claude Code?

Add the Longwave MCP server once with claude mcp add --transport http longwave https://api.longwave.run/v1/mcp/tasks, sign in, and ask for what you need. Claude finds the right OpenRouter function and calls it.

Use OpenRouter in Longwave

Ask any Longwave thread for the result, or add Longwave to Claude Code, Codex, Cursor or ChatGPT.

Add to Longwave