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.
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.
Configure Environment Variables
Configure Environment Variables
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:
- macOS / Linux
- Windows
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 If you use bash, replace
~/.zshrc; most Linux distributions use bash, with the file ~/.bashrc. Run echo $SHELL to check your shell.~/.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.