OpenRouter integration
Unified multi-LLM gateway that exposes hundreds of models from Anthropic, OpenAI, Google, Meta, Mistral, Cohere, DeepSeek and others behind a single OpenAI-compatible API. Provides model routing with automatic fallbacks, structured outputs, function calling, vision, streaming, BYOK (per-provider), reasoning controls, plugins (web search, file parsing, response healing), per-request cost reporting, and a credits API. Supports both API-key and OAuth2 PKCE authentication so integrations can either run with a platform key or bind a per-user key minted via the user-controlled PKCE flow. Ideal for building model-agnostic AI features, A/B testing across providers, cost-aware routing and end-user multi-tenant LLM access.
Say what should happen.
The workflow builds itself.
Common OpenRouter use cases
- key rotation
- key inventory
- post hoc billing
- multi tenant byok
- real time chat ui
- balance dashboards
- per environment keys
- provider preference ui
- single shot generation
- model picker population
What you can do with OpenRouter
Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.
Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.
Api key, 3 operations
create_api_keyCreate api keyPOSTProvisions a new OpenRouter API key with an optional USD spending cap.delete_api_keyDelete api keyDELETEDeletes an OpenRouter API key by its hash. The key is invalidated immediately.list_api_keysList api keysGETLists every API key on the account with its label, spending cap, usage and disabled status. Plaintext keys are never returned.
Chat, 2 operations
create_chat_completionCreate chat completionPOSTCreates a non-streaming chat completion via OpenRouter. Pick any model slug across 300+ providers with optional fallback routing, tool calling, structured outputs and plugins.create_chat_completion_streamCreate chat completion streamPOSTStreams a chat completion via OpenRouter as Server-Sent Events. Same routing / tools / structured-output features as create_chat_completion, but with token-by-token deltas.
Completion, 1 operation
create_completionCreate completionPOSTCreates a legacy text completion via OpenRouter. Single prompt string in, choices[].text out.
Credit, 1 operation
get_creditsGet creditsGETGets total credits purchased and used on the authenticated OpenRouter account.
Generation, 1 operation
get_generationGet generationGETFetches token-usage and cost statistics for a previously completed OpenRouter generation by id.
Model, 1 operation
list_modelsList modelsGETLists every model routable through OpenRouter with pricing, context length, modalities and feature flags.
Model endpoint, 1 operation
list_model_endpointsList model endpointsGETLists the underlying provider endpoints serving a given OpenRouter model slug, with their pricing, context length and supported parameters.
Oauth key, 1 operation
exchange_oauth_codeExchange oauth codePOSTExchanges a PKCE authorization code for a user-controlled OpenRouter API key.
Provider, 1 operation
list_providersList providersGETLists every upstream provider OpenRouter routes traffic to, with the slugs used in the chat-completion provider routing preferences.
Use OpenRouter from Claude Code, Cursor or Codex
Connect OpenRouter in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its OpenRouter operations become tools the client can call, next to every other integration you connected.
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"
[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"{
"mcpServers": {
"livecontext": {
"type": "http",
"url": "https://livecontext.ai/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}How to connect OpenRouter
- Create your workspace
Sign up free. Nothing to install.
- Connect OpenRouter once
Add your OpenRouter connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.
- Describe the job in chat
The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.
OpenRouter integration FAQ
What can you do with the OpenRouter integration?
LiveContext exposes 12 operations on OpenRouter, covering api key, chat, completion and credit. Common uses include key rotation, key inventory and post hoc billing.
