# Openrouter — how to use (mcp.ai)

Connect your Openrouter account and use 13 tools for artificial intelligence straight from your AI agent. Connect with your own API key. OpenRouter is a platform that provides a unified API for accessing various large language models (LLMs) from different providers, allowing developers to integrate multiple AI models seamlessly.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_openrouter?ms=1787293500000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `openrouter_create_chat_completion`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/openrouter`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/openrouter/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/openrouter/create/chat/completion` — Tool to generate a chat-style completion. Use after assembling messages and selecting a model. Supports streaming and function calls. Response format varies across models; use explicit prompt instruct
  - body: { n?: integer, stop?: string|string[], user?: string, model: string, top_p?: number, stream?: boolean, messages: object[], functions?: object[], logit_bias?: object, max_tokens?: integer, temperature?: number, function_call?: string|object, presence_penalty?: number, frequency_penalty?: number }
- `POST https://api.mcp.ai/api/openrouter/create/coinbase/charge` — Tool to create a Coinbase charge for crypto payment to add credits to your OpenRouter account. Use when you need to purchase credits using cryptocurrency. Returns calldata needed to fulfill the transa
  - body: { amount: number, sender: string, X_Title?: string, chain_id: integer, HTTP_Referer?: string }
- `POST https://api.mcp.ai/api/openrouter/create/message` — Tool to create a message using Anthropic Messages API format via OpenRouter. Use when you need Claude-compatible chat completion with support for text, images, PDFs, tools, and extended thinking.
  - body: { user?: string, model: string, tools?: object[], top_k?: integer, top_p?: number, models?: string[], stream?: boolean, system?: string|object[], plugins?: object[], x_title?: string, messages: object[], metadata?: object, provider?: object, thinking?: object, max_tokens: integer, session_id?: string, temperature?: number, tool_choice?: object, http_referer?: string, service_tier?: string, output_config?: object, stop_sequences?: string[] }
- `POST https://api.mcp.ai/api/openrouter/get/credits` — Tool to get the current API credit balance for the authenticated user. Use before large or batch jobs to verify sufficient balance. A successful response may return total_credits=0, which confirms aut
- `POST https://api.mcp.ai/api/openrouter/get/current/key` — Tool to get information about the currently authenticated API key. Use to check usage limits, spending, and key metadata.
  - body: { x_title?: string, http_referer?: string }
- `POST https://api.mcp.ai/api/openrouter/get/generation` — Tool to retrieve a generation result by its unique ID. Use after a generation completes to fetch metadata like token counts, cost, and latency.
  - body: { id: string }
- `POST https://api.mcp.ai/api/openrouter/get/models/count` — Tool to get the total count of available models on OpenRouter. Use when you need to know how many models are available without fetching the full list.
  - body: { x_title?: string, http_referer?: string }
- `POST https://api.mcp.ai/api/openrouter/list/available/models` — Tool to list available models via OpenRouter API. Use after confirming authentication to fetch the model catalog. Use exact model IDs returned here in OPENROUTER_CREATE_CHAT_COMPLETION or OPENROUTER_C
  - body: { use_rss?: boolean, category?: string, use_rss_chat_links?: boolean }
- `POST https://api.mcp.ai/api/openrouter/list/embedding/models` — Tool to list all available embeddings models via OpenRouter API. Returns a list of embeddings models with their properties including architecture, pricing, and capabilities.
  - body: { X-Title?: string, HTTP-Referer?: string }
- `POST https://api.mcp.ai/api/openrouter/list/model/endpoints` — Tool to list endpoints for a specific model. Use after specifying model author and slug to get endpoint details including pricing, context length, and supported parameters. Some metadata fields (e.g.,
  - body: { slug: string, author: string }
- `POST https://api.mcp.ai/api/openrouter/list/providers` — Tool to list all AI model providers available through the OpenRouter API. Use after authentication to retrieve available provider options for routing configuration. Providers differ in latency, contex
- `POST https://api.mcp.ai/api/openrouter/list/user/models` — Tool to list models filtered by user provider preferences, privacy settings, and guardrails. Use after authenticating to get models tailored to the user's configuration.
  - body: { x_title?: string, http_referer?: string }
- `POST https://api.mcp.ai/api/openrouter/list/zdr/endpoints` — Tool to preview the impact of Zero Data Retention (ZDR) on the available endpoints. Use to see which model endpoints remain accessible when ZDR is enabled.
  - body: { x_title?: string, http_referer?: string }

## Example prompts
- "What can I do in Openrouter?"
- "Show me a summary of my Openrouter account"

## More
- Page: https://mcp.ai/openrouter
- Agent spec (llms.txt): https://mcp.ai/openrouter/llms.txt
- Postman collection: https://mcp.ai/openrouter/postman.json
