Perplexity AI API integration for AI agents
<h2>Perplexity AI API & Chase Agents</h2><h3>Access Advanced AI Search & Answers: Chase Agents & Perplexity AI API Integration</h3><p>Chase Agents enhances your research, content creation, and decision-making processes by integrating with the powerful Perplexity AI API. Build automated agents and applications that leverage Perplexity's advanced AI search and conversational answering capabilities—all without writing complex code, managed through Chase Agents's intuitive no-code platform.</p>
Connect Perplexity AI API (also known as perplexity) to Chase Agents as an API connection, then use it in plain-English automations — on the web, in Slack, or inside ChatGPT and Claude via MCP. Chase Agents builds the workflow and deterministic code runs it.
How to connect Perplexity AI API
Add Perplexity AI API from the Chase Agents connections marketplace as API connection, provide the required credentials, and reference it in your automation steps. See plans or read the connection guide.
About Perplexity AI API
Learning from API Errors: The Perplexity AI Model Name Case
Introduction: When interacting with APIs, precision is key. A recent task involving the Perplexity AI API highlighted a common pitfall: assuming a model name or using a variant not explicitly supported by the API. This article details the error, the cause, and the simple yet crucial fix to ensure successful API calls in the future.
The Mistake: In an attempt to fulfill a user's request to search for information using the Perplexity AI API, the initial tool call was constructed with the model parameter set to "sonar-medium-online". The API responded with the following error:
{
"error": {
"message": "Invalid model 'sonar-medium-online'. Permitted models can be found in the documentation at https://docs.perplexity.ai/guides/model-cards.",
"type": "invalid_model",
"code": 400
}
}
This clearly indicated that the specified model name was not recognized by the Perplexity AI API.
The Cause and The Fix: The root cause of the error was a deviation from the API's specific instructions. The provided documentation for the Perplexity AI API explicitly states: "Use "sonar" model for all searches. It has to be "sonar" exactly."
Instead of adhering strictly to "sonar", a more descriptive but unsupported model name ("sonar-medium-online") was used. This likely stemmed from an assumption or an attempt to use a more specific version of the model that either doesn't exist or isn't exposed through this particular API endpoint.
The fix was straightforward:
- Review the API Documentation: Re-consult the API documentation, paying close attention to the exact model names permitted.
- Correct the Model Parameter: Modify the API call to use the exact model name specified:
"sonar".
The subsequent API call with the corrected model name ("sonar") executed successfully, demonstrating the importance of using the precise model identifier.
Key Takeaway for Future Use: When using any API, and particularly when specific instructions or examples are provided for parameters like model names, always adhere strictly to the documented values. Avoid guessing, assuming variants, or trying to be more specific than the documentation allows, unless explicitly stated that such variations are supported. If an error occurs, the API's error message (like the one above) is often the best first clue, and cross-referencing with the documentation for the mentioned parameters is the most effective troubleshooting step.
For the Perplexity AI API, the instruction is clear: use "sonar".