How to create a GLM API key to use in Ozeki AI Gateway

This guide demonstrates how to create a GLM API key and configure it in Ozeki AI Gateway. You'll learn how to access the Z.AI platform, generate a new API key, and set up GLM as a provider in your gateway. By following these steps, you can connect your Ozeki AI Gateway to GLM's AI models and services.

API URL: https://api.z.ai/api/paas/v4/
Example API Key: 12345...
Default model: glm-4.5

What is a GLM API key?

A GLM API key is a unique authentication credential that allows applications to access GLM's AI models and services through the Z.AI platform. The API key serves as a secure token that identifies your Z.AI account and authorizes API requests. When configuring GLM as a provider in Ozeki AI Gateway, you need this API key to establish the connection between your gateway and GLM's services.

Overview
Overview

Steps to follow

We assume Ozeki AI Gateway is already installed on your system. You can install it on Linux, Windows or Mac.

  1. Open Z.AI page
  2. Navigate to API keys
  3. Login to Z.AI
  4. Create new API key
  5. Enter key name
  6. Copy API key
  7. Open Providers page in Ozeki AI Gateway
  8. Create provider

How to create a GLM API key video

The following video shows how to create a GLM API key and configure it in Ozeki AI Gateway step-by-step. The video covers accessing the Z.AI platform, generating a new API key, and setting up GLM as a provider in your gateway.

Step 1 - Open Z.AI page

Open your web browser and navigate to the Z.AI platform. This is the main portal where you can access GLM models and manage your API keys (Figure 1).

Open Z.AI page
Figure 1 - Open Z.AI page

Step 2 - Navigate to API keys

On the Z.AI platform, locate and click the "API" button to access the API management section (Figure 2).

Click API
Figure 2 - Click API

Navigate to the API Key section by clicking on the API Key option. This will take you to the key management page (Figure 3).

Click API Key
Figure 3 - Click API Key

Step 3 - Login to Z.AI

Sign in to your Z.AI account using your credentials. If you don't have a Z.AI account yet, you'll need to create one before proceeding (Figure 4).

Login to Z.AI
Figure 4 - Login to Z.AI

Step 4 - Create new API key

On the API keys page, click the "Create new API key" button to begin the API key generation process (Figure 5).

Create new API key
Figure 5 - Create new API key

Step 5 - Enter key name

Enter a descriptive name for your API key that identifies its purpose. For example, you might name it "Ozeki AI Gateway" to indicate it will be used with your gateway installation. Click "Confirm" to generate the API key (Figure 6).

Enter key name
Figure 6 - Enter key name

Step 6 - Copy API key

After the API key is generated, locate and click the copy button on the page to copy the key to your clipboard (Figure 7).

Copy API key
Figure 7 - Copy API key

Step 7 - Open Providers page in Ozeki AI Gateway

Open the Ozeki AI Gateway web interface and navigate to the Providers page. This is where you'll configure GLM as a new provider using the API key you just created (Figure 8).

Open Providers page
Figure 8 - Open Providers page in Ozeki AI Gateway

Step 8 - Create provider

Click the "New" button to begin the provider creation process. This opens a form where you'll enter the connection details for GLM (Figure 9).

Click add new provider
Figure 9 - Click add new provider button

Fill in the provider configuration form with GLM's details. Enter "GLM" as the provider name, select "OpenAI compatible" as the provider type, specify the API endpoint URL, and paste the API key you copied earlier. Select the preferred model from the dropdown list, then click "Create" to save the configuration (Figure 10).

https://api.z.ai/api/paas/v4/

Enter GLM provider details
Figure 10 - Enter GLM provider details and create

After clicking "Create", the GLM provider is added to Ozeki AI Gateway. The provider now appears in the providers list, confirming that your gateway can route requests to GLM's services. You can now create routes that allow users to access GLM models through your gateway (Figure 11).

Provider created
Figure 11 - GLM provider created successfully

Conclusion

You have successfully created a GLM API key and configured it as a provider in Ozeki AI Gateway. Your gateway can now communicate with GLM's services through the Z.AI platform and access GLM AI models through your centralized gateway infrastructure. This setup allows you to manage GLM access for multiple users and applications from a single point.

More information