Mattering Automations OpenRouter integration
Connect OpenRouter to Mattering Automations: chat completions against hundreds of models with fallback lists and provider routing, the model catalog with per-token prices, key limits, and per-generation cost audits as workflow steps, authenticated with an OpenRouter API key.
The Mattering Automations OpenRouter integration adds OpenRouter to your automation canvas: run chat completions against any model in OpenRouter's catalog through one OpenAI-compatible request, with fallback model lists that fall through in order when a model is down or over quota and provider routing preferences that control which upstream providers serve the call. Alongside the chat node sit five free reads: the model catalog with OpenRouter's per-token prices, per-model provider endpoints, the provider directory, the key's own limits and usage, and a per-generation cost audit.
Setup takes a few minutes: create an API key in your OpenRouter settings, attach it as a credential in Mattering, and test the connection. This guide walks through each step and ends with the full node reference.
Cost visibility is built in rather than bolted on. Every response from OpenRouter: Chat Completion automatically carries data.usage.cost, the USD amount charged for the call, and OpenRouter: Get Generation turns any completion's id into a full billing record: exact total cost, token counts, the provider that served it, and latency. Only the chat node spends money; the other five nodes are free to call.
Before you start
- An OpenRouter account (openrouter.ai).
- Prepaid credits on the account for chat completions, which bill per token at the routed model's price. The five read nodes are free, so you can connect and verify before buying anything.
- A Mattering workspace with access to the Automations app.
Create an OpenRouter API key
Mattering authenticates to OpenRouter with an API key, sent as a bearer credential on every request. Keys are created in the OpenRouter settings and there is no OAuth flow involved.
Connect OpenRouter to Mattering
Verify it works
After connecting, open any automation canvas and check the palette: an OpenRouter section should list the query and action nodes. Drop OpenRouter: Get Current API Key onto the canvas and run a test step. It takes no parameters, costs nothing, and a successful response shows the key's limit, limit_remaining, and usage totals, which confirms the credential end to end. Do not rely on OpenRouter: List Models as a credential check: OpenRouter serves the catalog without authentication, so it succeeds even with a broken key.
To exercise the paid path cheaply, run OpenRouter: Chat Completion with a short prompt on an inexpensive model (the catalog includes free variants with tight rate limits) and a small completion-token cap, then feed the response's data.id into OpenRouter: Get Generation to see the exact cost, token counts, serving provider, and latency for the call. The whole verification pass costs well under a cent.
Node reference
6 nodes, generated from the connector itself so this reference always matches what ships.
Read and query nodes 5
OpenRouter: Get Current API Key
openrouter_get_key
Read the limits and usage of the API key making the call: data.limit and data.limit_remaining (USD credit limit, null when unlimited), usage totals for the current day, week, and month, the free-tier flag, and a masked display label. It never returns the full key material. Free to call and read-only, which makes it the connector's credential health check: a bad key gets a 401, a good key gets a 200 at no cost. The endpoint takes no parameters, so the config panel is intentionally empty.
OpenRouter: Get Generation
openrouter_get_generation
Fetch the full billing and performance record for one completed generation by id (the data.id returned by the chat node): data.data carries total_cost in USD, native and normalized token counts (prompt, completion, reasoning, cached), any cache_discount, the provider_name that actually served it, generation_time and latency in milliseconds, and the finish reason. Free to call; this is the cost-audit companion to every paid completion. Note: the record can lag the completion by a moment, so retry briefly on a 404 right after a call.
OpenRouter: Get Model Endpoints
openrouter_get_model_endpoints
List every provider endpoint serving one model: each entry at data.data.endpoints[] carries the provider_name, its own per-token pricing, context_length, max_completion_tokens, quantization, uptime, and recent latency/throughput percentiles. This is the data behind provider routing: use it to pick the order or only lists for the chat node's provider preferences. Free to call.
OpenRouter: List Models
openrouter_list_models
List the OpenRouter model catalog: each entry at data.data[] carries the model id (author/slug form, ready for the chat node), name, description, context_length, per-token USD pricing (pricing.prompt and pricing.completion), supported parameters, and modality info. Free to call. Honest probe note: this endpoint answers 200 even without authentication, so it cannot verify your key; use the Get Current API Key node for that.
OpenRouter: List Providers
openrouter_list_providers
List every upstream provider OpenRouter can route to: each entry at data.data[] carries the provider's name, slug (the value used in the chat node's provider order / only / ignore lists), headquarters and datacenter country codes, and links to its privacy policy, terms, and status page. Free to call. The endpoint takes no parameters, so the config panel is intentionally empty.
Action nodes 1
OpenRouter: Chat Completion
openrouter_chat_completion
Send a chat completion to any model on OpenRouter with one OpenAI-compatible request: pick the model by id (e.g. anthropic/claude-sonnet-4 or openai/gpt-5), optionally list fallback models and provider routing preferences, and read the answer at data.choices[0].message.content. Every response automatically includes data.usage.cost, the USD amount charged for the call, so downstream nodes can track spend per request. Billed per token at the routed model's price. Streaming is always off: the node returns one JSON response.
Using the integration
On the automation canvas
OpenRouter nodes chain with every other node: a comparison sweep can run one prompt across several models and write each answer with its cost as rows in a Mattering database, a content pipeline can draft into Mattering Productivity tasks with a fallback model list keeping it alive through provider outages, and a scheduled OpenRouter: Get Current API Key check can flag the team before credits run dry.
From AI assistants over MCP
Every node speaks MCP, the open protocol for connecting AI assistants to tools. Claude, ChatGPT, and Matter can browse the catalog with OpenRouter's per-token prices, compare the providers serving a model, run completions, and audit what each call cost, through the same nodes your workflows use. Five of the six nodes are free reads, which makes most of this surface safe to hand an agent.
Fallback models and provider routing
OpenRouter: Chat Completion takes a primary model id plus an optional fallback list; OpenRouter tries the ids in order when a model is down or over quota, and the response's data.model reports which one served. The provider preferences object controls the upstream side: order and only pin providers, ignore excludes them, and price sorting routes to the cheapest offer. Provider slugs come from OpenRouter: List Providers, and OpenRouter: Get Model Endpoints shows each provider's pricing, uptime, and latency percentiles for a model, which is the data those choices should rest on.
Cost accounting on every call
Every chat response carries data.usage.cost in USD automatically, with no opt-in. OpenRouter: Get Generation is the post-hoc audit: pass a completion's id and get the exact total cost, native and normalized token counts including reasoning and cached tokens, any cache discount, the serving provider, and generation time. OpenRouter: List Models carries OpenRouter's own per-token prices per model; the integration never invents prices, it surfaces OpenRouter's numbers.
Model ids are free text
The catalog holds hundreds of models and changes weekly, so the model field and the fallback list take ids as text in author/slug form (anthropic/claude-sonnet-4, openai/gpt-5) rather than a fixed dropdown: new models work the day OpenRouter lists them. OpenRouter: List Models returns the live ids. Leaving the model unset uses your account's default model, and openrouter/auto asks OpenRouter to pick.
Streaming off, attribution on
Streaming is pinned off by design: each run of OpenRouter: Chat Completion returns one complete JSON response, the shape canvas workflows and downstream nodes consume, and workflow config cannot re-enable it. Requests carry Mattering attribution headers identifying Mattering Automations as the calling app; these affect only attribution on OpenRouter's public rankings, never routing, pricing, or billing.
Troubleshooting
Test Connection fails with a 401
The models list works but chat completions fail with an auth error
Chat completions fail with a payment or credits error
There is no node for credits or account activity
A generation lookup returns a 404 right after the completion
The response came from a different model than the one configured
A provider you do not want keeps serving the requests
A workflow needs streaming output
Related
The OpenRouter MCP
What connecting OpenRouter unlocks for AI agents and automations, with common uses and FAQs.
More guides
All Automations documentation
Every integration guide, plus how connectors, credentials, and workflows fit together.
OpenRouter is a trademark of its respective owner. Mattering uses platform names to identify the services these integrations connect to; no endorsement or affiliation is implied.