proxyExecute does not attach the API key for the perplexityai toolkit — 401 on every connected account, while tools.execute with the same account succeeds
Summary
For the perplexityai toolkit, composio.tools.proxyExecute(...) appears not to attach the stored generic_api_key to the upstream request. Every call returns Perplexity's 401 invalid_api_key. The same connected account, same stored key succeeds through POST /api/v3/tools/execute/PERPLEXITYAI_PERPLEXITY_AI_SEARCH, which is what rules out a bad key.
We ship Perplexity as a user-facing connector, so this is currently a hard block for us.
Reproduce
- Connect a
perplexityaiaccount (auth schemepplx_scheme, modeAPI_KEY, fieldgeneric_api_key) with a validpplx-…key. Account reportsstatus: ACTIVE. - Call the proxy:
await composio.tools.proxyExecute({
endpoint: 'https://api.perplexity.ai/chat/completions',
method: 'POST',
connectedAccountId,
body: { model: 'sonar', messages: [{ role: 'user', content: 'hi' }] },
})Actual:
{"error":{"message":"Invalid API key provided. Ensure your API key is correct and active.","type":"invalid_api_key","code":401}}- Same connected account, via the tool endpoint:
POST /api/v3/tools/execute/PERPLEXITYAI_PERPLEXITY_AI_SEARCH
{ "connected_account_id": "…", "user_id": "…",
"arguments": { "model": "sonar", "systemContent": "One word.", "userContent": "Capital of France?" } }Actual: successful: true, correct answer with citations.
So the credential is valid and resolvable — it just doesn't reach the upstream request on the proxy path.
Scope
- 17 of 17 connected
perplexityaiaccounts, across 15 unrelated workspaces, return the same 401 on the proxy path. Independent end users, independently entered keys. - Reproduced on both
GET /async/chat/completionsandPOST /chat/completions, so it isn't verb- or endpoint-specific. - Base URL is not the cause: we call
https://api.perplexity.ai/…, matching thebase_urlreported byGET /api/v3/toolkits/perplexityai. A wrong base returns 404, not 401.
Controls (same proxy, same client, same API key)
| toolkit | auth mode | proxyExecute result |
|---|---|---|
firecrawl |
API_KEY | 200, real payload |
elevenlabs |
API_KEY | 401 but authenticated — "API key is missing the permission models_read", i.e. the key was sent |
perplexityai |
API_KEY | 401 invalid_api_key — consistent with no key being sent |
Injection clearly works for API_KEY toolkits generally, which is why this looks specific to perplexityai.
Expected
proxyExecute against a perplexityai connected account should send the stored generic_api_key as Authorization: Bearer <key>, which is the only scheme Perplexity accepts.
Secondary (smaller)
tools.execute('PERPLEXITYAI_PERPLEXITY_AI_SEARCH', …) in @composio/core fails before dispatch with ComposioToolNotFoundError: Unable to retrieve tool with slug PERPLEXITYAI_PERPLEXITY_AI_SEARCH (TS-SDK::TOOL_NOT_FOUND). The underlying client.tools.retrieve(slug, { toolkit_versions }) 404s, while GET /api/v3/tools/PERPLEXITYAI_PERPLEXITY_AI_SEARCH and the REST execute endpoint both resolve it fine. Passing an explicit version ('latest' and a pinned value) didn't help. The workaround is to call the REST endpoint directly — worth a look if the SDK path is meant to work.
Happy to supply request IDs privately if useful.
Source: ComposioHQ/composio