# Code Snippets

{% 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.3mint.io/developer-guides/mint/code-snippets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
