Perplexity
perplexityYAML config
providers:
- id: perplexity:sonar-large-32k-online
config:
apiKey: ${PERPLEXITY_API_KEY}TypeScript usage
import { createProvider } from "@evalguard/core";
const provider = createProvider("perplexity", process.env.PERPLEXITY_API_KEY);
const response = await provider.complete({
model: "sonar-large-32k-online",
messages: [{ role: "user", content: "Hello" }],
});Authentication
Set PERPLEXITY_API_KEY in your environment. EvalGuard validates the key on first call and surfaces typed errors for 401 / 403 / rate-limit responses (with Retry-After parsing).
Setup walkthrough
- 1. Sign up for an account on the Perplexity website.
- 2. Obtain your API key from the account dashboard.
- 3. Review the API documentation to understand the endpoints and parameters.
- 4. Set up your development environment with the necessary libraries for making HTTP requests.
- 5. Test the API with a simple request to ensure your setup is correct.
Gotchas
- API rate limits are enforced; exceeding them may result in temporary access restrictions.
- Certain features may not be available in all regions; check the documentation for regional limitations.
- Authentication tokens may expire; ensure to handle token refresh in your application.
Cost note
Pricing is $0.002 per 1,000 tokens for the cheapest model and $0.006 per 1,000 tokens for the flagship model.
Recommended models
- Eval / judge
- perplexity-3.5-turbo
- Agent / tool-use
- perplexity-3.5-turbo
- Code
- perplexity-codex-1
- Vision
- perplexity-vision-1
LLM-generated (llm-gpt-4o) · 2026-05-23