Model Providers
Perplexity
Call models on the Perplexity Router API through your Verdictan gateway. Your Perplexity key stays on the gateway, and your application calls the gateway with its application token.
Router is a private preview, so check that your account has access first. This integration is not for Perplexity's web-search Agent API. See the Router quickstart.
Before you start
- A working gateway from the quickstart.
- A Perplexity account with Router API preview access, an API key, and a full Router model ID.
- The gateway startup command, and a separate application token for test requests.
Configure the provider
Keep /router at the end of base_url:
pack:
name: perplexity-integration
version: 1.0.0
enabled: true
policies:
chain:
- prompt-injection
providers:
targets:
- id: perplexity-primary
provider: perplexity
model: "replace-with-router-model-id"
base_url: https://api.perplexity.ai/router
secret_key_ref:
env: VERDICTAN_PERPLEXITY_API_KEYThe gateway appends /v1/chat/completions, so requests go to /router/v1/chat/completions. It sends the key from VERDICTAN_PERPLEXITY_API_KEY as a Bearer token.
Start and verify
For configuration deployment from your terminal, use CLI 0.1.14 or later. Check In sync before the Perplexity request. Keep its provider key on the gateway.
With the quickstart in Docker, follow the container steps instead of steps 1 to 3.
-
In the gateway terminal, set the key and lint the file:
export VERDICTAN_PERPLEXITY_API_KEY="<provider-api-key>" verdictan policy lint --file policy-config.yaml -
Restart the test gateway with the key in its environment.
-
Deploy the file to the test agent in Configurations. If that agent already runs
pack.version1.0.0, increase the version first. Then wait for the gateway log lineconnected read model refresh applied updated configwith your version asconfig_version. Try the change on a test gateway has the steps. -
In a second terminal, send a request for the configured model:
export VERDICTAN_CLIENT_TOKEN="<application-token>" curl --fail-with-body http://127.0.0.1:41002/v1/chat/completions \ -H "Authorization: Bearer ${VERDICTAN_CLIENT_TOKEN}" \ -H "Content-Type: application/json" \ -d '{"model":"replace-with-router-model-id","messages":[{"role":"user","content":"Reply with Hello."}]}'
choices[0].message.content contains the reply, and the request appears in History when capture is on, or in the delivered events.
Supported requests
| Request | Support |
|---|---|
| Chat Completions | Yes. Streaming and tools work if the model supports them. |
| Messages | Translated to Chat Completions |
Responses, embeddings, audio, image input, response_format, parallel tool calls | No |
| Perplexity Agent API and its search tools | No |
Failure behavior
| Problem | What to check |
|---|---|
401 from the gateway | The application token is active, and the key is set on the gateway host. |
| Provider authentication or access error | VERDICTAN_PERPLEXITY_API_KEY is set, and the account has Router preview access. |
404 from Perplexity | base_url ends in /router. |
| Model not found | The full Router model ID matches the target. |
Provider 429 or another upstream error | The response body and your Perplexity limits. See Error Handling. |
Limits
- Model names, prices, rate limits, and data terms are in the Perplexity documentation.
- Sonar Chat Completions support ended on September 27, 2026. Perplexity now turns remaining Sonar requests into Agent API requests; see the migration notice. This page does not depend on that behavior.
- Streaming and tools vary by model. Test each one with your model.
- A listener on a non-loopback address needs TLS and network controls.
Next steps
- Provider Configuration: target fields, routing, and fallback.
- Runtime Request Families: request families and their policy stages.