The Perplexity model provides access to Perplexity’s language models.

ParameterTypeDefaultDescription
idstr"sonar-pro"The specific model ID used for generating responses.
namestr"Perplexity"The name identifier for the Perplexity agent.
providerstr"Perplexity" + idThe provider of the model, combining "Perplexity" with the model ID.
api_keyOptional[str]-The API key for authenticating requests to the Perplexity service. Retrieved from the environment variable PERPLEXITY_API_KEY.
base_urlstr"https://api.perplexity.ai/"The base URL for making API requests to the Perplexity service.
max_tokensint1024The maximum number of tokens to generate in the response.