The keys create command allows you to create a new API key for your Crossmint project.

To use it, run the following command from your terminal

crossmint keys create

Server-side keys are view-once in Production, make sure to copy your API key secret when it’s displayed, as it won’t be shown again.

Client-side keys require selecting the app type and adding allowed origins—use domain URLs for web or package/bundle IDs for mobile.

Example

Start the API key creation process:

crossmint keys create

Select the type of key you want to create:

? Select Key Usage: (Use arrow keys)
  Server side
> Client side

For client-side keys, select the application type:

? Select client platform: (Use arrow keys)
> Web
  Mobile

Specify the allowed origins for your key.

  • For web enter the domain, eg: https://crossmint.com
  • For mobile enter your Android Package name or IOS Bundle ID, eg: com.company.appname
Enter multiple domains or app identifiers separated by a comma.
? Enter whitelisted domain or localhost (e.g., https://www.yourdomain.com) (separate multiple domains with a comma):
https://www.crossmint.com

Select the scopes you want to add to the key by pressing space. Once you are ready, press enter to create the key:

? Select scopes for client key:
● Read wallet (wallets.read)
● Create wallet (wallets.create)
○ Create Transaction (wallets.transactions.create)
○ Sign Transaction (wallets.transactions.sign)
○ Read Transactions (wallets.transactions.read)
○ Create Wallet Signatures (wallets.signatures.create)

The CLI will display the created API key information, this includes the Key ID and Client Secret:

 ✅ API Key created successfully!
Key ID: 67ff9c388687868382...
🔒 Key Secret: ck_production_3218u5TFZMGkK16uLbKfxDsJ4xtwSd2xtZRa9A8cbe64oRMe1J148XTGbuSvqmxB4k9TspLUAbKyt2RTqbArGBdkvARxkCg8S1tgwb4ie3gUNFw74vTuCUhSpu7ojkjGxY6epj...