How to create a Kimi K2 API key to use Ozeki AI Gateway

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

API URL: https://api.moonshot.ai/v1
Example API Key: sk-12345...
Default model: kimi-latest

What is a Kimi K2 API key?

A Kimi K2 API key is a unique authentication credential that allows applications to access Kimi K2's AI models and services through the Moonshot AI platform. The API key serves as a secure token that identifies your Moonshot account and authorizes API requests. When configuring Kimi K2 as a provider in Ozeki AI Gateway, you need this API key to establish the connection between your gateway and Kimi K2'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 Moonshot platform
  2. Login to Moonshot
  3. Click create API key
  4. Enter key name and project
  5. Copy API key
  6. Open Providers page in Ozeki AI Gateway
  7. Create provider

How to create a Kimi K2 API key video

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

Step 1 - Open Moonshot platform

Open your web browser and navigate to the Moonshot AI platform. This is where you'll create and manage your Kimi K2 API keys (Figure 1).

Open Moonshot platform
Figure 1 - Open Moonshot platform

Step 2 - Login to Moonshot

Sign in to your Moonshot account using your credentials. If you don't have a Moonshot account yet, you'll need to create one before proceeding. After logging in, you'll have access to the API keys management section (Figure 2).

Login to Moonshot
Figure 2 - Login to Moonshot

Step 3 - Click create API key

Click the "Create API key" button to begin the API key generation process (Figure 3).

Click create API key
Figure 3 - Click create API key

Step 4 - Enter key name and project

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

Enter key name and project
Figure 4 - Enter key name and project

Step 5 - Copy API key

After the API key is generated, Moonshot displays the complete key value. Click the copy button to copy the key to your clipboard (Figure 5).

The API key is shown only once during creation. Make sure to copy and securely store the key before closing this window.

Copy API key
Figure 5 - Copy API key

Step 6 - 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 Kimi K2 as a new provider using the API key you just created (Figure 6).

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

Step 7 - Create provider

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

Click add new provider
Figure 7 - Click add new provider button

Fill in the provider configuration form with Kimi K2's details. Enter "Kimi K2" 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 8).

https://api.moonshot.ai/v1

Enter Kimi K2 provider details
Figure 8 - Enter Kimi K2 provider details and create

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

Provider created
Figure 9 - Kimi K2 provider created successfully

Conclusion

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

More information