How to create an Ollama API key to use in Ozeki AI Gateway
This guide demonstrates how to create an Ollama API key and configure it in Ozeki AI Gateway. You'll learn how to access the Ollama cloud platform, generate a new API key, and set up Ollama as a provider in your gateway. By following these steps, you can connect your Ozeki AI Gateway to Ollama's cloud-based AI model inference service.
API URL: https://ollama.com/v1/ Example API Key: abcd1234... Default model: gpt-oss:120b
What is an Ollama API key?
An Ollama API key is a unique authentication credential that allows applications to access AI models through the Ollama cloud platform. Ollama provides access to various open-source large language models through their cloud service, offering a convenient way to use AI models without local infrastructure requirements. When configuring Ollama as a provider in Ozeki AI Gateway, you need this API key to establish the connection between your gateway and Ollama's cloud services.
Steps to follow
- Navigate to Ollama website
- Open user settings
- Create API key
- Enter details and generate key
- Copy API key
- Open Providers page in Ozeki AI Gateway
- Create provider
How to create an Ollama API key video
The following video shows how to create an Ollama API key and configure it in Ozeki AI Gateway step-by-step. The video covers accessing the Ollama platform, generating credentials, and setting up the provider in your gateway.
Step 0 - Install Ozeki AI Gateway
Before configuring Ollama 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 Ollama website
Open your web browser and navigate to the Ollama platform. Sign in with your account credentials or create a new account if needed (Figure 1).
Step 2 - Open user settings
After signing in, click on your profile icon to access the account menu. Select "Settings" to navigate to the user settings where you can manage your account preferences, API keys, and other configuration options (Figure 2).
Step 3 - Create API key
In the settings page, locate the API keys section in the left sidebar and click the "Add API Key" button to begin the API key generation process. This initiates the key creation workflow where you'll configure the settings for your new credential (Figure 3).
Step 4 - Enter details and generate key
Enter a descriptive name for your API key, such as "Ozeki AI Gateway". A clear naming convention helps identify which keys are used by which applications or services. Click the "Generate API Key" button to create your authentication credential (Figure 4).
Step 5 - Copy API key
After generation, Ollama displays the complete API key value. Click the copy button to transfer it to your clipboard. Store this key securely as it provides access to your Ollama account and cloud-hosted models (Figure 5).
The API key is only shown once during creation. Make sure to copy and securely store the key before closing this window.
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 for Ollama (Figure 7).
Fill in the configuration form with your Ollama information. Enter the provider name, select "OpenAI compatible" as the type, paste the endpoint URL (https://ollama.com/v1/), and add your API key. Select your preferred model from the dropdown list, then click "Create" to save the configuration (Figure 8).
https://ollama.com/v1/
After successful creation, Ollama is added to Ozeki AI Gateway. The provider now appears in the list, confirming that your gateway can route requests to Ollama's cloud service. You can now create routes that allow users to access Ollama's cloud-hosted models through your gateway (Figure 9).
Conclusion
You have successfully created an Ollama API key and configured it as a provider in Ozeki AI Gateway. Your gateway can now communicate with Ollama's cloud platform and access various open-source language models hosted in their cloud service. This setup allows you to manage Ollama access for multiple users and applications from a centralized point without requiring local infrastructure for running AI models.