Perplexity via Spawnpay

Perplexity Sonar models with built-in web search — citations + research, billed in USDC.

BYOK $0.001 / 2xx No reselling — your upstream relationship stays exactly as it is.

Why route through Spawnpay

Research agents that need cited answers. RAG fallback when your own retrieval pipeline is weak. Multi-tenant tools that re-bill Perplexity calls.

Endpoint

Method
POST
Upstream path
/chat/completions
Upstream auth
Authorization
Auth note
X-Provider-Key becomes "Authorization: Bearer …" upstream.
Routing fee
$0.001 USDC per upstream 2xx (4xx is free)
Provider docs

curl

curl -X POST https://spawnpay.ai/api/proxy \
  -H 'Authorization: Bearer spk_live_…' \
  -H 'X-Provider-Key: $PERPLEXITY_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "perplexity",
  "path": "/chat/completions",
  "method": "POST",
  "body": {
    "model": "sonar",
    "messages": [
      {
        "role": "user",
        "content": "latest spawnpay news"
      }
    ]
  }
}'

Node (spawnpay-paywall)

import { proxy } from 'spawnpay-paywall';

const out = await proxy({
  "provider": "perplexity",
  "path": "/chat/completions",
  "method": "POST",
  "body": {
    "model": "sonar",
    "messages": [
      {
        "role": "user",
        "content": "latest spawnpay news"
      }
    ]
  },
  "providerKey": process.env.PERPLEXITY_KEY
});

console.log(out.status, out.body);
console.log('charged', out.charged); // txHash + $0.001 USDC receipt

What you get back

The full upstream JSON body, the upstream status code, the upstream response headers, plus a charged field with the USDC receipt (tx hash) when the call succeeded.

▶ Try Perplexity live → 60-sec quickstart All providers