Skip to content

feat(perplexity): send X-Pplx-Integration header - #1050

Open
qirh wants to merge 1 commit into
prism-php:mainfrom
qirh:feature/perplexity-integration-header
Open

qirh wants to merge 1 commit into
prism-php:mainfrom
qirh:feature/perplexity-integration-header

Conversation

@qirh

@qirh qirh commented Oct 27, 2026

Copy link
Copy Markdown

Description

Adds an X-Pplx-Integration: prism header to requests the Perplexity provider sends to the public Perplexity API, so Perplexity can recognize traffic coming from Prism.

  • The header is only added when the configured URL's host is exactly api.perplexity.ai. Custom PERPLEXITY_URL hosts (proxies, gateways) are left untouched.
  • A caller supplied X-Pplx-Integration header passed through withClientOptions(['headers' => ...]) wins, matched case-insensitively, so no duplicate header is sent.
  • No change to authentication, request bodies, or other providers.

Tests: added tests/Providers/Perplexity/IntegrationHeaderTest.php covering the default header, caller override (two casings), and no header on a custom host. Locally on PHP 8.5: vendor/bin/pest --parallel (2199 passed, 8 skipped), vendor/bin/phpstan analyse src/Providers/Perplexity (no errors), vendor/bin/pint --test on the changed files (pass).

This branch has not been deployed

No deployments
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.

1 participant