Skip to main content

Perplexity

Route your Perplexity API calls through AI SpendOps for automatic usage tracking and cost attribution.

Configuration

SettingValue
Route/v1/perplexity/*
Upstreamhttps://api.perplexity.ai
Auth headerAuthorization: Bearer pplx-...
Streaming usageStandard

SDK base URL

https://proxy.aispendops.com/v1/perplexity/v1

Example

curl https://proxy.aispendops.com/v1/perplexity/v1/chat/completions \
-H "Authorization: Bearer pplx-your-perplexity-key" \
-H "X-ASO-API-Key: aso_k_yourkey.secret" \
-H "Content-Type: application/json" \
-d '{"model":"sonar-pro","messages":[{"role":"user","content":"Hello"}]}'

Usage fields

FieldDescription
prompt_tokensInput tokens
completion_tokensOutput tokens

Notes

  • Search-augmented models. OpenAI-compatible API.