Skip to main content
1

Register or Login

Access MiniMax API Platform, register or login .
2

Get a Key

  • Pay-as-you-go:Visit API Keys > Create new secret key to get your API Key
    Pay-as-you-go supports all modality models, including language, Video, Image, and Speech.
  • M Plan:Visit Billing > M Plan to view your Subscription Key
    The Subscription Key is used for M Plan subscriptions and purchased Credits. It can exist before paid resources are available, and becomes usable when you have an M Plan seat or Credits access. See M Plan Overview for details.
After getting a Key, we recommend setting it as an environment variable instead of writing it in your code. See Configure Environment Variables below.
3

Add resources

For pay-as-you-go, access Billing/Balance to top up if needed. For M Plan, buy a subscription or Credits, or use resources assigned by your Team.
Sample code in the MiniMax docs reads the API address and Key from environment variables. Pick the variables for your integration and replace <YOUR_API_KEY> with your API Key (M Plan users: your Subscription Key):Using the Anthropic SDK as an example, choose the steps for your system:
Current session only: run in your terminal. It applies to this terminal window only and is lost when you close it:
Persistent: add the two lines above to the end of your shell configuration file. macOS uses zsh by default, with the file ~/.zshrc; most Linux distributions use bash, with the file ~/.bashrc. Run echo $SHELL to check your shell.
If you use bash, replace ~/.zshrc with ~/.bashrc in the commands.To confirm, run echo $ANTHROPIC_BASE_URL in a new terminal. If it prints the address, the variable is set.
Do not commit your Key to a code repository or share it with others. If you keep it in a .env file, add the file to .gitignore.