# Asynchronous Inference

Asynchronous inference is suitable for jobs that involve longer inference times. First, you need to create an generation job. Then, you can check the job status through another interface. Finally, you can download the inference results using the provided download link.

## Create generation

{% hint style="info" %}
Replace `{{API_TOKEN}}` with your actual token.
{% endhint %}

**Example Request:**

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X POST 'https://api.netmind.ai/v1/generation' \
--header 'Authorization: {{API_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "Qwen/Qwen-Image",
    "config": {
        "prompt": "Generate a cup of coffee",
        "image_size": "landscape_4_3",
        "num_inference_steps": 30,
        "guidance_scale": 2.5,
        "num_images": 1,
        "enable_safety_checker": true,
        "output_format": "png",
        "acceleration": "none"
    }
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://api.netmind.ai/v1/generation"

payload = json.dumps({
   "model": "hkchengrex/MMAudio",
   "config": {
      "prompt": "The summer wind blows over the willow branches.",
      "duration": 100
   }
})
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}',
   'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "id": "6347623b2fce4998b0e842f7e935ccb0",
    "user_id": "....",
    "status": "pending",
    "created_at": "2025-09-18 09:14:20",
    "updated_at": "2025-09-18 09:14:20",
    "deleted_at": null,
    "is_deleted": false,
    "result": {}
}
```

## Get generation

{% hint style="info" %}
Replace `{{API_TOKEN}}` with your actual token.

Replace `{{GENERATION_ID}}` with "id" you got from previous step.
{% endhint %}

**Example Request:**

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X GET 'https://api.netmind.ai/v1/generation/{{GENERATION_ID}}' \
--header 'Authorization: {{API_TOKEN}}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.netmind.ai/v1/generation/{{GENERATION_ID}}"
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

```

{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "id": "6347623b2fce4998b0e842f7e935ccb0",
    "user_id": "....",
    "status": "completed",
    "created_at": "2025-09-18 09:14:21",
    "updated_at": "2025-09-18 09:27:32",
    "deleted_at": null,
    "is_deleted": false,
    "result": {
        "data": [
            {
                "url": "https://netmind-files-prod.s3.amazonaws.com/....",
                "file_id": "file-srcf4srhx...",
                "file_name": "",
                "file_type": "image"
            }
        ]
    }
}
```

Now you can view or download you generated video through "result.data".

## List generations

{% hint style="info" %}
Replace `{{API_TOKEN}}` with your actual token.
{% endhint %}

**Example Request:**

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X GET 'https://api.netmind.ai/v1/generation' \
--header 'Authorization: {{API_TOKEN}}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.netmind.ai/v1/generation"
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.request("GET", url, headers=headers)

print(response.text)

```

{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "generation_list": [
        {
            "id": "6347623b2fce4998b0e842f7e935ccb0",
            "user_id": "....",
            "status": "completed",
            "created_at": "2025-09-18 09:14:21",
            "updated_at": "2025-09-18 09:27:32",
            "deleted_at": null,
            "is_deleted": false,
            "result": {
                "data": [
                    {
                        "url": "https://netmind-files-prod.s3.amazonaws.com/....",
                        "file_id": "file-srcf4srhx...",
                        "file_name": "",
                        "file_type": "image"
                    }
                ]
            }
        }
    ]
}
```

## Delete generation

{% hint style="info" %}
Replace `{{API_TOKEN}}` with your actual token.

Replace `{{GENERATION_ID}}` with "job\_id" you got from previous step.
{% endhint %}

**Example Request:**

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X DELETE 'https://api.netmind.ai/v1/generation/{{GENERATION_ID}}' \
--header 'Authorization: {{API_TOKEN}}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.netmind.ai/v1/generation/{{GENERATION_ID}}"
headers = {
   'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.request("DELETE", url, headers=headers)

print(response.text)

```

{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "message": "Generation deleted"
}
```
