OpenRouter
v1.1.8MCP server providing access to 300+ AI models via OpenRouter
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
chat
Send a chat completion request to any OpenRouter model.
| Parameter | Type | Description |
|---|---|---|
assistant_prefill | Text to prefill the assistant response with | |
frequency_penalty | Penalize repeated tokens (-2 to 2) | |
json_mode | boolean | If True, request JSON-formatted response (backward compat) |
max_tokens | Maximum tokens in response (model default if not specified) | |
messages | Multi-turn conversation as a list of {role, content} dicts (provide either prompt or messages, not both) | |
model | Model identifier (e.g., "anthropic/claude-sonnet-4", "openai/gpt-4o"). If not specified, uses DEFAULT_TEXT_MODEL environment variable. | |
presence_penalty | Penalize tokens already present (-2 to 2) | |
prompt | User message to send (provide either prompt or messages, not both) | |
provider | Provider routing control (e.g., {"order": ["Anthropic", "Google"]}) | |
reasoning_effort | Reasoning effort level: "minimal", "medium", or "high" | |
response_format | Response format spec, e.g. {"type": "json_schema", ...}. Supersedes json_mode if both provided. | |
seed | Random seed for deterministic outputs | |
stop | List of stop sequences | |
system | Optional system prompt to set context | |
temperature | Sampling temperature 0-2 (model default if not specified) | |
top_k | Top-k sampling (number of top tokens to consider) | |
top_p | Nucleus sampling threshold 0-1 |
generate_image
Generate an image using an OpenRouter image generation model.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Image description - be specific about style, colors, composition |
aspect_ratio | string | Aspect ratio - 1:1, 16:9, 9:16, 4:3, 3:4, or 21:9 |
background | Background setting (e.g., "transparent" for PNG/WebP) | |
model | Image model (e.g., "google/gemini-3-pro-image-preview"). If not specified, uses DEFAULT_IMAGE_MODEL environment variable. | |
output_format | Output format (e.g., "png", "webp", "jpeg") | |
output_path | Optional absolute file path to save the image. Must be an absolute path if provided (e.g., "/Users/name/output.png"). | |
quality | Quality setting (e.g., "high", "medium", "low") | |
size | string | Image size - 1K, 2K, or 4K |
embed
Generate embeddings for text input using an OpenRouter embedding model.
| Parameter | Type | Description |
|---|---|---|
input * | Text string or list of strings to embed | |
dimensions | Custom embedding dimensions (model-dependent) | |
encoding_format | Output format: "float" or "base64" (default: float) | |
model | Embedding model (e.g., "mistralai/mistral-embed-2312"). If not specified, uses DEFAULT_EMBEDDING_MODEL environment variable. |
list_models
List available OpenRouter models, optionally filtered by capability.
| Parameter | Type | Description |
|---|---|---|
capability | Filter by capability: - "vision": Models that can analyze images - "image_gen": Models that can generate images - "embedding": Models that can generate embeddings - "tools": Models that support tool/f… |
find_models
Search for models by name or slug.
| Parameter | Type | Description |
|---|---|---|
search_term * | string | Text to search for in model names (e.g., "claude", "gpt", "gemini") |