> For the complete documentation index, see [llms.txt](https://docs.3mint.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.3mint.io/developer-guides/mint/code-snippets.md).

# Code Snippets

Different ways to mint tokens

{% hint style="info" %}
**SDK Coming Soon**

With the release of our SDK, you'll be able to easily integrate all features within your framework of choice.
{% endhint %}

## NFT Mint

### Minting an ERC721 NFT

This example mints a new ERC721 NFT and sends it directly to the specified user.

{% tabs %}
{% tab title="cURL" %}
{% code lineNumbers="true" %}

```json
curl -X POST https://api.3mint.io/api/v1/mint   
   -H "Content-Type: application/json"
   -H "X-API-KEY: [YOUR_API_KEY]"
   -d '{"chain": "polygon",
         "network": "mainnet",
         "type": "erc721",
         "to": "0x958fb436dB50DB2F689C364712113cc226b38151",
         "contractAddress": "0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2",
         "quantity": 1 // How many NFTs should be minted -- must be positive integer 
       }'
```

{% endcode %}
{% endtab %}

{% tab title="Axios (JS)" %}
{% code lineNumbers="true" %}

```javascript
import axios from 'axios';

// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';

var requestOptions = {
  method: 'POST',
  url: `${url}`,
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': `${apiKey}`
  },
  data: {
    'chain': 'polygon',
    'network': 'mainnet',
    'type': 'erc721',
    'to': '0x958fb436dB50DB2F689C364712113cc226b38151',
    'contractAddress': '0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2',
    'quantity': 1 // How many NFTs should be minted -- must be positive integer 
  }
};

axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Minting an ERC1155 NFT

This example mints a new ERC1155 NFT and sends it directly to the specified user.

{% tabs %}
{% tab title="cURL" %}
{% code lineNumbers="true" %}

```json
curl -X POST https://api.3mint.io/api/v1/mint   
   -H "Content-Type: application/json"
   -H "X-API-KEY: [YOUR_API_KEY]"
   -d '{"chain": "polygon",
         "network": "mainnet",
         "type": "erc1155",
         "to": "0x958fb436dB50DB2F689C364712113cc226b38151",
         "contractAddress": "0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2",
         "tokenId": "1",
         "quantity": 1 // How many NFTs should be minted -- must be positive integer 
       }'
```

{% endcode %}
{% endtab %}

{% tab title="Axios (JS)" %}
{% code lineNumbers="true" %}

```javascript
import axios from 'axios';

// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';

var requestOptions = {
  method: 'POST',
  url: `${url}`,
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': `${apiKey}`
  },
  data: {
    'chain': 'polygon',
    'network': 'mainnet',
    'type': 'erc1155',
    'to': '0x958fb436dB50DB2F689C364712113cc226b38151',
    'contractAddress': '0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2',
    'tokenId': '1',
    'quantity': 1 // How many NFTs should be minted -- must be positive integer
  }
};

axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));
```

{% endcode %}
{% endtab %}
{% endtabs %}

## ERC20 Airdrop

### Minting an ERC20 token

This example sends an existing ERC20 token directly to the specified user.

{% tabs %}
{% tab title="cURL" %}
{% code lineNumbers="true" %}

```json
curl -X POST https://api.3mint.io/api/v1/mint   
   -H "Content-Type: application/json"
   -H "X-API-KEY: [YOUR_API_KEY]"
   -d '{"chain": "polygon",
         "network": "mainnet",
         "type": "erc20",
         "to": "0x958fb436dB50DB2F689C364712113cc226b38151",
         "contractAddress": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
         "quantity": 1.01 // How many tokens should be sent -- must be positive float
       }'
```

{% endcode %}
{% endtab %}

{% tab title="Axios (JS)" %}
{% code lineNumbers="true" %}

```javascript
import axios from 'axios';

// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';

var requestOptions = {
  method: 'POST',
  url: `${url}`,
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': `${apiKey}`
  },
  data: {
    'chain': 'polygon',
    'network': 'mainnet',
    'type': 'erc20',
    'to': '0x958fb436dB50DB2F689C364712113cc226b38151',
    'contractAddress': '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984',
    'quantity': 1.01 // How many tokens should be sent -- must be positive float
  }
};

axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));
```

{% endcode %}
{% endtab %}
{% endtabs %}
