Provider REST API
AIConnect Claude to Anthropic
Call Claude models, count tokens before you spend them, and read organization usage and cost. 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 Anthropic
Open the marketplace in your workspace, add Anthropic 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. Anthropic 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 Anthropic 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
- platform.claude.com → Settings → API keys
- sk-ant-api03-…
- Admin API keyOptional
- Only for the workspace, API key and usage/cost reads. A separate key an organization admin creates in the Console; unavailable to individual accounts.
- sk-ant-admin01-…
What Claude can do in Anthropic
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_modelsList the Claude models this API key can call, newest first, with each model's id, display name, release date, context window and maximum output tokens. Call this before create_message or count_tokens whenever a model id is not certain - this connector deliberately does not carry a hard-coded list of model names, because Anthropic's roster changes faster than a file in a repository can. Free, and the cheapest proof that the key works.
get_modelRead one model by its id: display name, release date, context window, maximum output tokens, and the capability flags saying whether it accepts images or PDFs, supports extended thinking, structured outputs, citations, code execution or the Batch API. Use it to check that a model supports a feature before building a request around that feature, and to confirm an id from list_models is still available to this key. A 404 means the id does not exist for this key - call list_models to see what does.
count_tokensCount how many input tokens a message request would use, without sending it and without being billed for the completion. Takes the same `model`, `messages`, `system` and `tools` that create_message takes, so the honest way to use it is to build the request, count it here, and only then decide whether to spend it. A read, because nothing is created and nothing is charged. Returns a single input_tokens number; it does not predict output tokens, which are the larger part of the cost of most calls.
list_workspacesList the organization's workspaces with their ids, names, display colours and archive state. Needs the separate Admin API key, not the ordinary one - without an admin_key credential this call is refused before it is sent. The `wrkspc_…` ids it returns are what usage_report and cost_report take to break a report down by workspace. The Admin API is unavailable to individual accounts; on one of those this returns nothing useful no matter which key is pasted.
list_api_keysList the organization's API keys as records - id, name, status, partial key hint, which workspace each belongs to and who created it. It does not and cannot return key values; Anthropic shows those once, at creation. Needs the separate Admin API key. The `apikey_…` ids are what usage_report takes to attribute token spend to a particular key, which is the usual reason to call this.
usage_reportToken usage for the organization over a time range, in buckets, split into uncached input, cache reads, cache writes and output tokens. This is the accurate number - far better than adding up what individual responses reported. Group by "model", "workspace_id", "api_key_id" or "service_tier" to see where the tokens went; filter with models, workspace_ids or api_key_ids to narrow it. Needs the separate Admin API key. Bucket limits are Anthropic's: 1d allows at most 31 buckets per call, 1h at most 168, 1m at most 1440 - ask for a range that fits, or page with `page` when has_more comes back true. For money rather than tokens, call cost_report.
cost_reportWhat the organization was actually billed, in USD, bucketed by day. Prefer usage_report when the question is about tokens and this when the question is about money. Group by "workspace_id" to attribute spend to a team, or "description" to see it split by line item - grouping by description is also how web search and code execution charges become visible, since they are not token usage. Needs the separate Admin API key. Daily buckets only; Anthropic rejects any other bucket width here. Priority Tier spend is billed differently and does not appear at all - track that through usage_report instead.
Writes
1Creates or updates something on the other side.
create_messageGenerate a response from a Claude model. This is the operation that costs money: it is billed per input and output token, which is why it is a write while count_tokens and list_models are reads, and why it is not this connector's health check. Streaming is out of scope here - the response comes back whole, with its content blocks, stop reason and token usage. `max_tokens` is required and caps the output; set it to what the answer actually needs rather than to the model's ceiling. Call list_models for a valid `model` id and count_tokens to price the request first. The response is a model's own output and the prompt is prose, so both are kept out of the audit log.
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 Anthropic 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 Anthropic, but nothing in it deletes or permanently alters anything.
- It reaches no further than your credential
- Toolspoke holds no access to Anthropic 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 Anthropic
- 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 Anthropic. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around Anthropic's own rate limits. A call that Anthropic refuses comes back to the agent as a failed call.
Before you connect it
What can Claude do in Anthropic?
8 named actions: 7 that only read and 1 that write. They include list_models, get_model and count_tokens. 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 Anthropic connector need?
API key. The connector asks for api key, and optionally admin 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 Anthropic 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 Anthropic connector not do?
The 8 actions above are the whole of it. A call to any other name is refused before it reaches Anthropic 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 Anthropic, but nothing in it deletes or permanently alters anything. Toolspoke holds no access to Anthropic 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 Anthropic. An agent has to ask. Toolspoke does not retry, queue or back off around Anthropic's own rate limits. A call that Anthropic 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 Anthropic'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 Anthropic?
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.