Provider REST API
AIConnect Claude to OpenRouter
Compare models and prices, then call any of them with one key. Toolspoke puts 8 of its actions behind one MCP endpoint that Claude, Cursor, and Codex all speak.
- Connection
- Provider REST API
- Authentication
- API key
- Actions exposed
- 8
- Cost per call (typical)
- 1 credit
- Adapter
- Maintained by Toolspoke
Connected in three steps
- 1
Install OpenRouter
Open the marketplace in your workspace, add OpenRouter to the project your agents work in, and it appears on the gateway immediately.
- 2
Connect the credential
Authenticate with api key. Where to get one, and what it has to be able to reach, is the next section.
- 3
Point your agent at the gateway
Give your client one address, https://toolspoke.com/mcp. Claude Code takes it as a command, Claude and Claude Desktop add it as a custom connector, and Cursor, Codex and VS Code each read it from a config file of their own.
.mcp.json{
"mcpServers": {
"toolspoke": {
"type": "http",
"url": "https://toolspoke.com/mcp"
}
}
}One block covers every tool you have installed. OpenRouter shows up in the client as soon as your policy allows it, and so does everything else you install later.
Where the address goes, per client
- Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcp- Claude and Claude Desktop
Settings, then Connectors, then Add custom connector
https://toolspoke.com/mcp- Cursor
~/.cursor/mcp.json, or .cursor/mcp.json for one project
{ "mcpServers": { "toolspoke": { "url": "https://toolspoke.com/mcp" } } }- Codex
~/.codex/config.toml
[mcp_servers.toolspoke] url = "https://toolspoke.com/mcp"- VS Code
.vscode/mcp.json, or the MCP: Add Server command
{ "servers": { "toolspoke": { "type": "http", "url": "https://toolspoke.com/mcp" } } }
What OpenRouter asks for
API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API keyRequired
- openrouter.ai → Keys. An inference key reaches the catalogue, key info, and chat_completion; get_credits additionally needs a management key.
- sk-or-v1-…
What Claude can do in OpenRouter
8 actions, each one declared and named by the connector rather than discovered at runtime. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
- Reads
- 7Reads
- Writes
- 1Writes
- Destructive
- 0Destructive
Reads
7Fetches data and changes nothing.
list_modelsSearch the model catalogue and read each model's context length, per-token pricing, modalities, and the sampling parameters it supports. Call this before chat_completion when the model id is not already known - an id that is not in this list is refused. Prices are strings in US dollars per token.
get_modelFetch one model by its id, split into author and slug. Use it when list_models has already named the model and the full record is wanted - pricing, context length, modalities, and knowledge cutoff.
list_model_endpointsList every provider serving one model, with that provider's price, context limit, quantisation, uptime, latency, and throughput. This is how to choose a provider for chat_completion's `provider.order`, and how to explain why two calls to the same model differed in cost or speed.
list_providersList the upstream providers OpenRouter can route to, with each one's privacy policy, terms, status page, headquarters country, and datacentre countries. Use it when a choice of provider has to satisfy a data-residency rule.
get_keyRead the API key this connection uses: its label, spend limit, remaining limit, and usage to date. The cheapest proof that the credential works, and the way to check a limit before starting a long run. `rate_limit` is a legacy field OpenRouter always returns as -1 - ignore it.
get_creditsRead the account's total credits purchased and total credits used. Needs a management key - an ordinary inference key is refused with a 403, in which case use get_key, whose usage and limit fields answer most of the same questions.
get_generationLook up what one completed request actually cost and who served it, by the generation id returned in a chat_completion response. Gives total cost, the provider that answered, native prompt and completion token counts, cache discount, latency, and the finish reason. Statistics only - the prompt and completion text are not returned here.
Writes
1Creates or updates something on the other side.
chat_completionRun a chat completion against any model in the catalogue. This spends credits and is billed per token, so check pricing with list_models first and keep max_completion_tokens tight. Pass `models` to name fallbacks tried in order when the first is unavailable, and `provider` to constrain or rank which upstream serves the call. The response `id` is what get_generation reads to report the real cost.
What it will not do
Enforced by the gateway rather than left to convention, which is why each of these can be stated flatly.
- It cannot call anything else
- The 8 actions above are the whole of it. A call to any other name is refused before it reaches OpenRouter rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- Nothing here deletes
- This connector writes to OpenRouter, but nothing in it deletes or permanently alters anything.
- It reaches no further than your credential
- Toolspoke holds no access to OpenRouter of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from OpenRouter
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in OpenRouter. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around OpenRouter's own rate limits. A call that OpenRouter refuses comes back to the agent as a failed call.
Before you connect it
What can Claude do in OpenRouter?
8 named actions: 7 that only read and 1 that write. They include list_models, get_model and list_model_endpoints. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the OpenRouter connector need?
API key. The connector asks for api key. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
Does the OpenRouter connector work with Cursor and Codex, or only Claude?
Any client that speaks MCP, and every one of them gets the same 8 actions. There is a single address, https://toolspoke.com/mcp. Claude Code adds it with claude mcp add --transport http, Claude and Claude Desktop take it as a custom connector in settings, Cursor reads it from .cursor/mcp.json, Codex from ~/.codex/config.toml, and VS Code from .vscode/mcp.json. Each of them signs in to the gateway itself, so there is no key to paste.
What does the OpenRouter connector not do?
The 8 actions above are the whole of it. A call to any other name is refused before it reaches OpenRouter rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. This connector writes to OpenRouter, but nothing in it deletes or permanently alters anything. Toolspoke holds no access to OpenRouter of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in OpenRouter. An agent has to ask. Toolspoke does not retry, queue or back off around OpenRouter's own rate limits. A call that OpenRouter refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches OpenRouter's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls OpenRouter?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and the credits spent. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.