Provider REST API
AIConnect Claude to Perplexity
Ask a question and get an answer with the sources it came from, synchronously or as a queued job. Toolspoke puts 11 of its actions behind one MCP endpoint that Claude, Cursor, and Codex all speak.
- Connection
- Provider REST API
- Authentication
- API key
- Actions exposed
- 11
- Cost per call (typical)
- 1 credit
- Adapter
- Maintained by Toolspoke
Connected in three steps
- 1
Install Perplexity
Open the marketplace in your workspace, add Perplexity 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. Perplexity 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 Perplexity 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
- perplexity.ai → Settings → API → API Keys. Every operation here except list_models is billed per request and per token, so give this key its own budget if the account allows it.
- pplx-…
What Claude can do in Perplexity
11 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
- 4Writes
- Destructive
- 0Destructive
Reads
7Fetches data and changes nothing.
list_modelsList the models this key can reach, in OpenAI list format. Free, creates nothing, and needs no arguments, which is why it is the connection test. Read one caveat before trusting it as a catalogue: Perplexity documents this endpoint as the roster for the Agent API - the ids it returns look like "anthropic/claude-…" and "openai/gpt-…" - so it does not enumerate the Sonar models that chat_completion takes. For those, the names in circulation are sonar, sonar-pro, sonar-reasoning-pro and sonar-deep-research, and this connector deliberately hard-codes none of them, because the roster moves faster than a file in a repository: sonar-reasoning was removed in December 2025 and any enum written before then is now wrong.
get_async_completionCheck a job started by create_async_completion and read its answer. Free - polling is not billed; the work already queued is. Poll every few seconds and back off; a sonar-deep-research job can take several minutes. A completed job carries the same shape chat_completion returns, including the citations and the token usage the bill was computed from. The answer is built from other people's pages, so the payload is kept out of the audit log.
list_async_completionsList the async jobs this key has submitted, with their statuses. Free. The reason to call it is finding a job whose id was lost - a deep-research submission costs real money, and looking for it here is always better than sending it again. Each record carries the request that started it and, once finished, the answer, so the payload is kept out of the audit log.
searchSearch the web and get ranked results with page content, and no written answer. A flat $5 per thousand requests with no token charge, which makes it the cheapest thing here by a wide margin and the right call whenever an agent wants sources it will read itself rather than a paragraph Perplexity wrote. `query` takes a string or a list of strings, and a list runs several searches in one request. Bound the payload with `max_tokens_per_page` rather than `search_context_size` - the two are alternatives and Perplexity asks that you send one or the other, not both. The results are pages other people wrote, so the payload is kept out of the audit log, and the query is prose the caller wrote, so it is kept out too.
get_agent_responseRead an agent response by id - the one to poll after create_agent_response with `background: true`. Free; the run already in flight is what costs. Poll every few seconds and back off. The completed response carries the answer, the steps the agent took and its token usage. Built from other people's pages, so the payload is kept out of the audit log.
list_agent_filesList the files an agent run produced - charts, spreadsheets, documents written in its sandbox - with their ids and names. Free. Downloading the bytes is a separate endpoint this connector does not declare, because the gateway returns JSON and a binary body has nowhere to go here; the ids are what a client that can fetch them needs. Filenames describe whatever the agent was asked to make, so the payload is kept out of the audit log.
create_embeddingsTurn text into vectors with Perplexity's own embedding models. A read because it creates nothing and stores nothing - it returns numbers - but it is billed per token, so batching is what keeps it cheap: up to 512 texts in one request, each under 32,000 tokens and 120,000 tokens across the whole call. `dimensions` shortens the vectors (Matryoshka truncation) when a smaller index is worth more than the last few points of accuracy: 128 to 1024 for pplx-embed-v1-0.6b, 128 to 2560 for pplx-embed-v1-4b. Both sides are withheld from the audit log: the input is somebody's text and the output is a very large array derived from it.
Writes
4Creates or updates something on the other side.
chat_completionAsk Perplexity a question and get a written answer with the citations behind it. This is the operation the product exists for and the one that costs money, which is why it is a write. Billed twice: per token - $1 in and out for sonar, $3 and $15 for sonar-pro, $2 and $8 for sonar-reasoning-pro, $2 and $8 plus citation and reasoning token charges for sonar-deep-research - and per request, at $5 to $12 per thousand for sonar and $6 to $14 for the pro models depending on `web_search_options.search_context_size`, which defaults to low. Leave it low unless the answer is genuinely thin; raising it roughly doubles the per-request fee. `model` is a plain string with no list hard-coded here; sonar is the cheap default, sonar-pro answers harder questions, sonar-deep-research runs for minutes and belongs in create_async_completion rather than this blocking call. Narrow the sources with `search_domain_filter` and `search_recency_filter` before reaching for a bigger model - it is cheaper and usually more accurate. The citations come back on the response, and an answer whose citations do not support it is one to distrust. Streaming is not offered; the gateway returns whole responses. Prompts are prose the caller wrote and the answer is built from other people's pages, so neither is written to the audit log.
create_async_completionQueue a question instead of waiting for it. Returns a `request_id` and a status, and get_async_completion is what eventually carries the answer. Use this for sonar-deep-research, which routinely runs for minutes and will time out a blocking call. Priced exactly like chat_completion - the queue is free, the work is not - so read that operation's description for what a call costs before choosing a model and a context size. `idempotency_key` is worth setting: a submission that times out ambiguously can then be retried without paying for the same research twice, which is a real risk on a job that costs dollars rather than cents. Prompts are prose the caller wrote, so they are kept out of the audit log, and so is the response, which echoes the request back.
create_agent_responseRun Perplexity's agent, which chooses a model, searches, reads and can use tools across several steps. More capable than chat_completion and more expensive, because it may run many searches and many model turns for one request; the bill is the sum of those, and `max_steps` is the only ceiling this connector offers on it - set it. Either `model` (as "provider/model", e.g. "anthropic/claude-sonnet-4-6") or `preset` (fast, low, medium, high, xhigh) has to be given; list_models is the roster for the `model` form, which is the one thing that endpoint is actually authoritative about. `max_output_tokens` is required when the model is an Anthropic one, and omitting it there is a 400 that says so. Set `background: true` to have it queued rather than answered in the same call, then poll get_agent_response. Instructions are prose the caller wrote and the answer is built from other people's pages, so neither is written to the audit log.
cancel_agent_responseStop an agent run that is still going, so it stops spending. Free to call, and the only lever this connector offers on a background run that is taking far longer than expected. This destroys nothing recoverable: a cancelled run has produced no final answer to lose, and its record stays readable through get_agent_response. Work already done is still billed, so this caps a run rather than refunding it. The response is the run record, which carries the question it was given.
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 11 actions above are the whole of it. A call to any other name is refused before it reaches Perplexity 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 Perplexity, but nothing in it deletes or permanently alters anything.
- It reaches no further than your credential
- Toolspoke holds no access to Perplexity 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 Perplexity
- 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 Perplexity. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around Perplexity's own rate limits. A call that Perplexity refuses comes back to the agent as a failed call.
Before you connect it
What can Claude do in Perplexity?
11 named actions: 7 that only read and 4 that write. They include list_models, chat_completion and create_async_completion. 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 Perplexity 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 Perplexity connector work with Cursor and Codex, or only Claude?
Any client that speaks MCP, and every one of them gets the same 11 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 Perplexity connector not do?
The 11 actions above are the whole of it. A call to any other name is refused before it reaches Perplexity 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 Perplexity, but nothing in it deletes or permanently alters anything. Toolspoke holds no access to Perplexity 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 Perplexity. An agent has to ask. Toolspoke does not retry, queue or back off around Perplexity's own rate limits. A call that Perplexity 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 Perplexity'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 Perplexity?
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.