Perplexity()
Sonar models direct from Perplexity, with your own API key. Costs go direct to the vendor at their rates — no markup, nothing on your Axon balance.
export default defineProfile({
providers: [Perplexity()],
})
Serves perplexity/*.
Credentials
Set the environment variable, or pass key on the declaration:
PERPLEXITY_API_KEY=...
providers: [Perplexity({ key: process.env.MY_OWN_VAR })]
Unlike OpenRouter() and
Codex(), direct providers are not vaulted yet: the
credential comes from the agent's environment. A deployed agent needs it set as a runtime
secret, or should use a vaulted route instead.
Declaring this provider without the variable set is not an error. The failure comes when something tries to use it, and names the variable you need.
Options
Perplexity(options?: ProviderOptions)
| Option | Default | Description |
|---|---|---|
key | PERPLEXITY_API_KEY | Your own credential, passed directly |
url | the provider's API | Endpoint override |
slots | unbounded | Ceiling on concurrent calls a fanned-out role may spend here |
Model ids
Bare Sonar slugs:
export default defineAgent({ model: "perplexity:sonar-pro" })
Search-grounded by design
Sonar models answer with live web search built in, which makes them a poor fit for a cortex role — the loop already owns retrieval, and a model doing its own is a second source of truth. They suit a role that genuinely wants a grounded answer, declared alongside a conventional model rather than instead of one.