Unlock Free AI Models: Integrate Nvidia GLM-4.7 & Minimax M2.1 into Claude Code

Nvidia, famous for its GPUs, has recently released access to two impressive, free-to-use domestic Large Language Models (LLMs): GLM-4.7 and Minimax M2.1. These models come with official API access from Nvidia, currently capped at a generous 40 Requests Per Minute (RPM), which is effectively unlimited for most users.

Given the current challenges with potential service instability or account restrictions on platforms like Claude Code, leveraging these free Nvidia resources presents an excellent opportunity. The good news is that it is entirely possible to integrate these models into a system mimicking the Claude Code interface using a simple intermediary tool. This guide provides step-by-step instructions on achieving this integration.

Step 1: Obtain Your Free Nvidia API Key

To begin utilizing the Nvidia services, you first need to register and secure your unique API key. This key acts as your credential for accessing the models.

1. Registration Process

Visit the Nvidia developer platform registration page:

https://build.nvidia.com/ 

Follow the prompts to register using your email address. Be sure to check your spam or junk folder if you do not immediately receive the verification email.

2. Identity Verification

After successful email verification, you will be prompted to create an Nvidia Cloud account. Account naming is flexible. Crucially, you must verify your mobile phone number. Click the “Verify” button in the designated area. The service currently also supports mainland China (+86) mobile numbers.

Tip: If you face issues selecting your region during phone verification, check your current network connection settings.

3. Generating the API Key

Once verification is complete, navigate to your profile icon in the upper right corner and select API Keys to access the management page.

Click to generate a new key. Critical Warning: The key will only be displayed in its entirety once upon creation. Copy and save this key securely immediately, as you will not be able to retrieve the full string again.

Step 2: Install the Router Tool: claude-code-router

The API format provided by Nvidia is not directly compatible with the native format expected by systems designed for Claude Code. Therefore, an intermediary tool is required to translate the requests. The recommended solution is the open-source project claude-code-router available on GitHub.

This tool effectively masquerades various vendor APIs into a format recognizable by Claude Code interfaces.

Prerequisites

  • Claude Code or a compatible application environment must be installed.
  • Node.js (version 18 or higher) must be installed on your system.

Installation and Startup

Open your terminal or command prompt and execute the following commands:

  1. Global Installation of the Tool:

npm install -g claude-code-router

  1. Start the Core Service:

ccr start

  1. Access the Configuration UI:

ccr ui

Your web browser should automatically open the configuration interface. Ensure that the terminal window running the service remains open, as it manages the background process.

Step 3: Configure Essential Parameters (The Key Step)

This configuration step is where most errors occur. Precision is essential when mapping the Nvidia endpoints.

Adding the Provider

In the web UI for claude-code-router, click Add Provider. Fill in the details exactly as specified below for the Nvidia service:

  • Base URL (API Address): Copy this address precisely:

https://integrate.api.nvidia.com/v1/chat/completions

  • API Key: Enter the nvapi-xxx key you saved in Step 1.
  • Transformer (Provider Converter): Select openrouter.
  • Model Name: Add the specific model IDs by pasting the name and pressing Enter after each one (it is recommended to add both):
    • GLM-4.7 Model: z-ai/glm4.7
    • Minimax M2.1 Model: minimaxai/minimax-m2.1

Configuring Routing Rules

After adding the provider details, you must set up the routing rules to direct traffic intended for Claude Code to use your newly configured Nvidia provider. Review the UI screenshots provided in the original documentation to ensure the routes correctly map the required endpoints to the Nvidia provider.

Once all configurations are double-checked, click Save and Restart in the upper right corner of the UI.

Step 4: Start Utilizing the Free Models

With the router configured, you are ready to start using the models. Return to your terminal session where the router service is running. Instead of using the standard Claude commands, execute the following command to launch the environment configured to route requests through the Nvidia intermediary:

ccr code

You can now proceed to use your coding assistant, benefiting from the free access to GLM-4.7 and Minimax M2.1.

Usage Notes and Considerations

Compatibility Check

Currently, this setup works most reliably when used in the CLI (command-line interface) mode. If you are using VS Code extensions that hook into the Claude API or utilize switching plugins like CC Switch, it is advisable to temporarily disable them to prevent potential port conflicts with the router service. Community feedback and further exploration are welcome regarding full plugin compatibility.

Service Longevity

The utilization of Nvidia's NIM Service is currently free of charge. Users should remain aware that Nvidia may adjust its pricing structure or usage limits in the future. The recommendation is to configure and utilize this benefit early while it remains available.

Response Time Observation

It is worth noting that GLM-4.7, being a highly capable inference model, may exhibit slightly slower response times compared to some real-time models. This is often a trade-off for higher accuracy and a function of how the API call is processed through the intermediary routing layer that adheres to Nvidia's rate limits.

This integration method provides a stable and cost-effective alternative for developers seeking robust LLM support. What other free AI Models have you successfully integrated recently? Share your experiences in the comments below!

Comments

Please sign in to post.
Sign in / Register
Notice
Hello, world! This is a toast message.