# Haiper Inference

## Video

### Create Job

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location 'https://api.netmind.ai/v1/netmind-video-job' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_TOKEN}}' \
--data '{ 
      "job_type":"text2video",
      "config": {
        "prompt": "A sci-fi and historical drama that tells the story of a time traveler’s experiences across different historical periods and how they influence major events."
      }  
}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests
import json

url = "https://api.netmind.ai/v1/netmind-video-job"

payload = json.dumps({
  "job_type": "text2video",
  "config": {
    "prompt": "A sci-fi and historical drama that tells the story of a time traveler’s experiences across different historical periods and how they influence major events."
  }
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {{API_TOKEN}}'
}

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

print(response.text)

```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "job_id": "...",
    "user_id": "...",
    "name": "",
    "description": "",
    "payment_type": "usd",
    "status": "initializing",
    "meta_info": {
        "original_request": {
            "job_type": "text2video",
            "config": {
                "prompt": "A sci-fi and historical drama that tells the story of a time traveler’s experiences across different historical periods and how they influence major events.",
                "negative_prompt": null,
                "settings": {
                    "seed": -1,
                    "aspect_ratio": "16:9",
                    "resolution": 720,
                    "duration": 4
                },
                "gen_mode": "standard",
                "is_public": true,
                "use_ff_cond": null,
                "is_enable_prompt_enhancer": null
            }
        },
        "netmind_api_token": {
            "api_token": "...",
            "api_token_id": 0,
            "user": {
                "user_id": "...",
                "nickname": ".@..",
                "currency": "USD"
            }
        },
        "model_id": 81
    },
    "created_at": "2024-12-10T15:14:12.445307",
    "updated_at": "2024-12-10T15:14:12.445312",
    "deleted_at": null,
    "is_deleted": false,
    "outputs": {}
}
```

### Get Job

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

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location 'https://api.netmind.ai/v1/netmind-video-job/{{JOB_ID}}' \
--header 'Authorization: Bearer {{API_TOKEN}}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests

url = "https://api.netmind.ai/v1/netmind-video-job/{{JOB_ID}}"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_TOKEN}}'
}

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

print(response.text)

```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "job_id": "...",
    "user_id": "...",
    "name": "",
    "description": "",
    "payment_type": "usd",
    "status": "succeed",
    "meta_info": {
        "model_id": 0,
        "order_id": "...",
        "update_at": "2024-12-10 15:18:27",
        "original_request": {
            "config": {
                "prompt": "A sci-fi and historical drama that tells the story of a time traveler’s experiences across different historical periods and how they influence major events.",
                "gen_mode": "standard",
                "settings": {
                    "seed": -1,
                    "duration": 4,
                    "resolution": 720,
                    "aspect_ratio": "16:9"
                },
                "is_public": true,
                "use_ff_cond": null,
                "negative_prompt": null,
                "is_enable_prompt_enhancer": null
            },
            "job_type": "text2video"
        },
        "netmind_api_token": {
            "user": {
                "user_id": "...",
                "currency": "USD",
                "nickname": ".@.."
            },
            "api_token": "...",
            "api_token_id": 0
        }
    },
    "created_at": "2024-12-10T15:14:12",
    "updated_at": "2024-12-10T15:14:12",
    "deleted_at": null,
    "is_deleted": false,
    "outputs": [
        {
            "id": "...",
            "media_url": "https://....mp4",
            "thumbnail_url": "https://....mp4.thumbnail"
        }
    ]
}
```

Now you can view or download you generated video through "outputs\[].media\_url".

### List Job

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location 'https://api.netmind.ai/v1/netmind-video-job?page=1&page_size=10' \
--header 'Authorization: Bearer {{API_TOKEN}}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests

url = "https://api.netmind.ai/v1/netmind-video-job?page=1&page_size=10"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_TOKEN}}'
}

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

print(response.text)

```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "total_count": 1,
    "job_list": [
        {
            "job_id": "...",
            "user_id": "...",
            "name": "",
            "description": "",
            "payment_type": "usd",
            "status": "succeed",
            "meta_info": {
                "model_id": 0,
                "order_id": "...",
                "update_at": "2024-12-10 15:18:27",
                "original_request": {
                    "config": {
                        "prompt": "A sci-fi and historical drama that tells the story of a time traveler’s experiences across different historical periods and how they influence major events.",
                        "gen_mode": "standard",
                        "settings": {
                            "seed": -1,
                            "duration": 4,
                            "resolution": 720,
                            "aspect_ratio": "16:9"
                        },
                        "is_public": true,
                        "use_ff_cond": null,
                        "negative_prompt": null,
                        "is_enable_prompt_enhancer": null
                    },
                    "job_type": "text2video"
                },
                "netmind_api_token": {
                    "user": {
                        "user_id": "...",
                        "currency": "USD",
                        "nickname": ".@.."
                    },
                    "api_token": "...",
                    "api_token_id": 0
                }
            },
            "created_at": "2024-12-10T15:14:12",
            "updated_at": "2024-12-10T15:14:12",
            "deleted_at": null,
            "is_deleted": false,
            "outputs": [
                {
                    "id": "...",
                    "media_url": "https://....mp4",
                    "thumbnail_url": "https://....mp4.thumbnail"
                }
            ]
        }
    ]
}
```

### Delete Inference Job

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

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location --request DELETE 'https://api.netmind.ai/v1/netmind-video-job/{{JOB_ID}}' \
--header 'Authorization: Bearer {{API_TOKEN}}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests

url = "https://api.netmind.ai/v1/netmind-video-job/{{JOB_ID}}"

payload = {}
headers = {
  'Authorization': 'Bearer {{API_TOKEN}}'
}

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

print(response.text)

```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{}
```

## Image

### Create Job

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location --request POST 'https://api.netmind.ai/v1/netmind-image-job' \
--header 'Authorization: Bearer {{API_TOKEN}}' \
--data-raw '{
    "config": {
        "prompt": "An angry dog with a lollipop",
        "settings": {
            "seed": 123,
            "resolution": 720,
            "aspect_ratio": "16:9"
        },
        "config": {
            "image_number": 2
        }
    },
    "job_type": "text2image"
}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests
import json

url = "https://api.netmind.ai/v1/netmind-image-job"

payload = json.dumps({
    "config": {
        "prompt": "An angry dog with a lollipop",
        "settings": {
            "seed": 123,
            "resolution": 720,
            "aspect_ratio": "16:9"
        },
        "config": {
            "image_number": 2
        }
    },
    "job_type": "text2image"
})

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)
```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "job_id": "...",
    "user_id": "...",
    "name": "",
    "description": "",
    "payment_type": "usd",
    "status": "initializing",
    "meta_info": {
        "model_id": 121,
        "original_request": {
            "config": {
                "prompt": "An angry dog with a lollipop",
                "settings": {
                    "seed": 123,
                    "resolution": 720,
                    "aspect_ratio": "16:9"
                },
                "negative_prompt": null,
                "config": {
                    "image_number": 2
                }
            },
            "job_type": "text2image"
        }
    },
    "created_at": "2025-06-19T02:41:57",
    "updated_at": "2025-06-19T02:41:57",
    "deleted_at": null,
    "is_deleted": false,
    "outputs": {}
}
```

### Get Job

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

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location 'https://api.netmind.ai/v1/netmind-image-job/{{JOB_ID}}' \
--header 'Authorization: Bearer {{API_TOKEN}}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests

url = f"https://api.netmind.ai/v1/netmind-image-job/{{JOB_ID}}"
headers = {
    'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.get(url, headers=headers)
print(response.text)
```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "job_id": "...",
    "user_id": "...",
    "name": "",
    "description": "",
    "payment_type": "usd",
    "status": "succeed",
    "meta_info": {
        "model_id": 121,
        "order_id": "...",
        "update_at": "2025-06-19 10:43:21",
        "original_request": {
            "config": {
                "config": {
                    "image_number": 2
                },
                "prompt": "An angry dog with a lollipop",
                "settings": {
                    "seed": 123,
                    "resolution": 720,
                    "aspect_ratio": "16:9"
                },
                "negative_prompt": null
            },
            "job_type": "text2image"
        }
    },
    "created_at": "2025-06-19 02:41:57",
    "updated_at": "2025-06-19 02:41:57",
    "deleted_at": null,
    "is_deleted": false,
    "outputs": [
        {
            "id": "...",
            "media_url": "https://...jpg"
        },
        {
            "id": "...",
            "media_url": "https://...jpg"
        }
    ]
}
```

Now you can view or download you generated video through "outputs\[].media\_url".

### List Job

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location 'https://api.netmind.ai/v1/netmind-image-job?page=1&page_size=10' \
--header 'Authorization: Bearer {{API_TOKEN}}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests

url = "https://api.netmind.ai/v1/netmind-image-job?page=1&page_size=10"
headers = {
    'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.get(url, headers=headers)
print(response.text)
```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{
    "total_count": 1,
    "job_list": [
        {
            "job_id": "...",
            "user_id": "...",
            "name": "",
            "description": "",
            "payment_type": "usd",
            "status": "succeed",
            "meta_info": {
                "model_id": 121,
                "order_id": "...",
                "update_at": "2025-06-19 10:43:21",
                "original_request": {
                    "config": {
                        "config": {
                            "image_number": 2
                        },
                        "prompt": "An angry dog with a lollipop",
                        "settings": {
                            "seed": 123,
                            "resolution": 720,
                            "aspect_ratio": "16:9"
                        },
                        "negative_prompt": null
                    },
                    "job_type": "text2image"
                }
            },
            "created_at": "2025-06-19 02:41:57",
            "updated_at": "2025-06-19 02:41:57",
            "deleted_at": null,
            "is_deleted": false,
            "outputs": [
                {
                    "id": "...",
                    "media_url": "https://...jpg"
                },
                {
                    "id": "...",
                    "media_url": "https://...jpg"
                }
            ]
        }
    ]
}
```

### Delete Inference Job

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

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

**Example Request:**

{% tabs %}
{% tab title="Curl" %}
```bash
curl --location --request DELETE 'https://api.netmind.ai/v1/netmind-image-job/{{JOB_ID}}' \
--header 'Authorization: Bearer {{API_TOKEN}}'
```
{% endtab %}

{% tab title="Python" %}
```python
import requests

url = f"https://api.netmind.ai/v1/netmind-image-job/{{JOB_ID}}"
headers = {
    'Authorization': 'Bearer {{API_TOKEN}}'
}

response = requests.delete(url, headers=headers)
print(response.text)
```
{% endtab %}
{% endtabs %}

**Example Response:**

```json
{}
```
