Skip to main content

Configure API Key

244 of the 307 capabilities require an API Key, covering accounts, trading, financial products, activities, and the few spot market endpoints that are account-related.

Create Credentials

Sign in to the MEXC website and create a key on the API management page. You will receive two values:

  • Access Key: Account identifier; can be viewed again later.
  • Secret Key: Access credential; shown only once at creation. Save it immediately.

Grant the minimum permissions needed: enable read-only access for data queries, and enable trading only when placing orders.

Save Credentials

mexc profile set <account-name>      # Enter Access Key and Secret Key in sequence
mexc profile use <account-name> # Set as the current account

When entering the Secret Key, the terminal does not echo characters. Press Enter after typing. Credentials are stored in encrypted form and must be entered manually in the terminal; passing them via command-line arguments or environment variables is not accepted.

Multiple Accounts

mexc profile list              # Saved accounts and the current account
mexc profile show my-account # Show details with Secret Key masked
mexc profile use another-account # Switch the current account
mexc profile remove old-account # Remove
mexc <command> --profile another-account # Use another account for this call only