Skip to content

Add Perplexity Agent API provider#1082

Merged
fwang merged 2 commits intoanomalyco:devfrom
kesku:kesku/add-ppl-agent-api
Mar 4, 2026
Merged

Add Perplexity Agent API provider#1082
fwang merged 2 commits intoanomalyco:devfrom
kesku:kesku/add-ppl-agent-api

Conversation

@kesku
Copy link
Copy Markdown
Contributor

@kesku kesku commented Mar 3, 2026

Add new perplexity-agent provider using @ai-sdk/openai with the Perplexity Agent API (/v1/responses)

  • 15 models across 5 vendors:
    • Anthropic: claude-opus-4-6, claude-opus-4-5, claude-sonnet-4-6, claude-sonnet-4-5, claude-haiku-4-5
    • OpenAI: gpt-5.2, gpt-5.1, gpt-5-mini
    • Google: gemini-3.1-pro-preview, gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash
    • xAI: grok-4-1-fast-non-reasoning
    • Perplexity: sonar
  • All models support tool calling via the Agent API
  • Reuses existing Perplexity logo

This is separate from the existing perplexity provider which uses @ai-sdk/perplexity for the Sonar chat completions endpoint (/chat/completions). The Agent API is OpenAI Responses API-compatible and requires @ai-sdk/openai.

You can run

curl -s https://api.perplexity.ai/v1/models -H "Authorization: Bearer $PERPLEXITY_API_KEY" | jq

to verify models

@fwang fwang merged commit 0d83ab8 into anomalyco:dev Mar 4, 2026
1 check passed
@kesku kesku deleted the kesku/add-ppl-agent-api branch March 15, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants