How to create a Perplexity AI API key to use in Ozeki AI Gateway
This guide demonstrates how to create a Perplexity AI API key and configure it in Ozeki AI Gateway. You'll learn how to access the Perplexity AI platform, generate a new API key, and set up Perplexity as a provider in your gateway. By following these steps, you can connect your Ozeki AI Gateway to Perplexity's AI services and access their advanced language models optimized for search and reasoning tasks.
API URL: https://api.perplexity.ai/ Example API Key: pplx-abcde... Default model: sonar
What is a Perplexity AI API key?
A Perplexity AI API key is a unique authentication credential that allows applications to access AI models through Perplexity's platform. Perplexity AI specializes in search-optimized language models that provide accurate, up-to-date information with source citations. When configuring Perplexity as a provider in Ozeki AI Gateway, you need this API key to establish the connection between your gateway and the AI services.
Steps to follow
- Navigate to Perplexity AI website
- Open API settings from profile menu
- Navigate to API keys and generate key
- Enter name and create key
- Copy API key
- Open Providers page in Ozeki AI Gateway
- Create provider
How to create a Perplexity AI API key video
The following video shows how to create a Perplexity AI API key and configure it in Ozeki AI Gateway step-by-step. The video covers accessing the platform, generating credentials, and setting up the provider in your gateway.
Step 0 - Install Ozeki AI Gateway
Before configuring Perplexity as a provider, ensure Ozeki AI Gateway is installed and running on your system. If you haven't installed Ozeki AI Gateway yet, follow our Installation on Linux guide or Installation on Windows guide to complete the initial setup.
Step 1 - Navigate to Perplexity AI website
Open your web browser and navigate to the Perplexity AI website. Sign in with your account credentials or create a new account if needed. The platform provides access to AI services, API management, and account settings (Figure 1).
Step 2 - Navigate to API from profile menu
Click on your profile icon in the bottom left corner to open the profile menu. Select "API" from the menu to access the API management section where you can create and manage your API keys (Figure 2).
Step 3 - Navigate to API keys and generate key
Navigate to the API Keys section and click the "Generate API Key" button to begin the API key creation process. This initiates the key generation workflow where you'll configure the settings for your new authentication credential (Figure 3).
Step 4 - Enter name and create key
Enter a descriptive name for your API key, such as "Ozeki AI Gateway". Review the configuration settings and click the "Create Key" button to generate your authentication credential (Figure 4).
Step 5 - Copy API key
After generation, the key appears on the dashboard. Click the copy button to transfer it to your clipboard. Store this key securely as it provides access to Perplexity AI services and models (Figure 5).
Step 6 - Open Providers page in Ozeki AI Gateway
Open the Ozeki AI Gateway web interface and navigate to the Providers page. The Providers page displays all configured AI model connections and allows you to add new providers (Figure 6).
Step 7 - Create provider
Click the "New" button on the Providers page to begin creating a provider configuration. This opens a form where you'll specify the connection details (Figure 7).
Fill in the configuration form with your connection information. Enter the provider name, select "OpenAI compatible" as the type, paste the endpoint URL (https://api.perplexity.ai/), and add your API key. Unlike most providers, Perplexity AI does not provide a /models endpoint for automatic model discovery, so you must manually enter the model name in the "Preferred model" field. For example, enter "sonar" or another model from the available list. You can view all available models and their specifications at the Perplexity AI Models Documentation. Click "Create" to save the configuration (Figure 8).
https://api.perplexity.ai/
After successful creation, the provider is added to Ozeki AI Gateway. The provider now appears in the list, confirming that your gateway can route requests to Perplexity AI services. You can now create routes that allow users to access Perplexity's search-optimized AI models through your gateway (Figure 9).
To sum it up
You have successfully created a Perplexity AI API key and configured it as a provider in Ozeki AI Gateway. Your gateway can now communicate with the platform and access Perplexity's search-optimized AI models that provide accurate, up-to-date information. This setup allows you to manage access for multiple users and applications from a centralized point.