# Midjourney API

## Mode

The Midjourney service of TT API supports three modes, **fast**, **relax** and **turbo**.

* **Fast** mode response time is within **90 seconds**, the overall success rate is **over 98%**
* **Relax** mode response  generally within **10 minutes**, **depending on the official response,** the overall success rate is **over 90%**
* **Turbo** mode response time is within **60 seconds**

{% hint style="info" %}
The max **job in progressing** is 10, get more job in progress please [contact us](https://ttapi.io/contact)
{% endhint %}

{% hint style="info" %}
**'Imagine action'** with **Midjourney 6.0**  will be **1.5 times quota than the normal** consumption.\
\&#xNAN;**--cref operation must be used with the --v 6.0 model**
{% endhint %}

## Generate\[ /imagine ]

<mark style="color:green;">`POST`</mark> `https://api.ttapi.io/midjourney/v1/imagine`

The imagine endpoint generates up to 4 images from a text prompt.

#### Headers

| Name                                         | Type   | Description                                           |
| -------------------------------------------- | ------ | ----------------------------------------------------- |
| TT-API-KEY<mark style="color:red;">\*</mark> | String | Your API Key in TT API used for request authorization |
| Content-Type                                 | String | application-json                                      |

#### Request Body

| Name                                     | Type    | Description                                                                                                                                                                                                                                                                      |
| ---------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| prompt<mark style="color:red;">\*</mark> | String  | Prompt use to generate image. exp:a cat --ar 1:1                                                                                                                                                                                                                                 |
| hookUrl                                  | String  | Send a request to the address for task completion or failed notification. If not set you need to request [fetch endpoint](#fetch) to get response                                                                                                                                |
| mode                                     | String  | The task mode for generating images,  including [fast, relax and turbo](https://docs.mjapiapp.com/tt-api-document#mode). If not filled in, the fast mode will be used by default.                                                                                                |
| timeout                                  | int     | Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds                                                                                                                                                                                             |
| getUImages                               | boolean | <p>Whether to obtain four small pictures. The optional values are <strong>true</strong> and <strong>false</strong>. Default is <strong>false</strong>. <br><strong>Note</strong>: This operation <strong>does not actually means U operation</strong> on the generated task.</p> |

{% tabs %}
{% tab title="200: OK Successful Response" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If hookUrl is not null, it will be callback [a json response ](#asynchronous-callback-return-structure)to your setting hookUrl
{% endhint %}

#### Example Request

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

```
import requests

endpoint = "https://api.ttapi.io/midjourney/v1/imagine"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "prompt": "a cute cat",
    "model": "fast",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Php" %}

```
<?php

$url = 'https://api.ttapi.io/midjourney/v1/imagine';

$data = array(
    'prompt' => 'a cat --ar 1:1',
    'model' => 'fast',
    'hookUrl' => ''
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;


```

{% endtab %}

{% tab title="Node" %}

```
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/imagine',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "prompt": "a cute cat",
    "model": "fast",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```
{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
```

{% endtab %}

{% tab title="400" %}

```
{
  "status": "FAILED",
  "message": "banned prompt words :sexy",
  "data": {}
}
```

{% endtab %}
{% endtabs %}

## Action\[ U1\~U4 V1\~V4... ]

<mark style="color:green;">`POST`</mark> `https://api.ttapi.io/midjourney/v1/action`

This endpoint contains [**method** ](#action-used-in-action-endpoint)used in TT Api. Eg: U1\~U4, V1\~V4 ...

#### Headers

| Name                                         | Type   | Description                                           |
| -------------------------------------------- | ------ | ----------------------------------------------------- |
| TT-API-KEY<mark style="color:red;">\*</mark> | String | Your API Key in TT API used for request authorization |
| Content-Type                                 | String | application-json                                      |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                                                                                                                                                    |
| ---------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| jobId<mark style="color:red;">\*</mark>  | String | The jobId in prev request                                                                                                                                                                                                                                                                                      |
| action<mark style="color:red;">\*</mark> | String | <p><a href="#action-used-in-action-endpoint">Action you need</a></p><p>Eg:<a href="#the-action-used-in-action-endpoint"> </a><strong>upsample1 means U1</strong> </p><p>       <strong>variation1  means V1</strong></p><p><a href="#action-used-in-action-endpoint">For more please refer to</a></p><p>  </p> |
| hookUrl                                  | String | Send a request to the address for task completion or failed notification. If not set you need to request  [fetch endpoint](#fetch) to get response                                                                                                                                                             |
| timeout                                  | int    | Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds                                                                                                                                                                                                                           |

{% tabs %}
{% tab title="200: OK Successful Response" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If hookUrl is not null, it will be callback [a json response ](#asynchronous-callback-return-structure)to your setting hookUrl
{% endhint %}

#### Example Request

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

```
import requests

endpoint = "https://api.ttapi.io/midjourney/v1/action"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "action": "upsample1",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Php" %}

```
<?php

$url = 'https://api.ttapi.io/midjourney/v1/action';

$data = array(
    'jobId' => 'afa774a3-1aee-5aba-4510-14818d6875e4',
    'action' => 'upsample1',
    'hookUrl' => ''
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
```

{% endtab %}

{% tab title="Node" %}

```
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/action',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "action": "upsample1",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```
{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
```

{% endtab %}
{% endtabs %}

## Seeds\[ --seed ]

<mark style="color:green;">`POST`</mark> `https://api.ttapi.io/midjourney/v1/seed`

Get the seeds form midjourney image, refer to the [midjourney's docs](https://docs.midjourney.com/docs/en/seeds) for usage

#### Headers

| Name         | Type   | Description                                           |
| ------------ | ------ | ----------------------------------------------------- |
| TT-API-KEY   | String | Your API Key in TT API used for request authorization |
| Content-Type | String | application-json                                      |

#### Request Body

| Name                                    | Type   | Description                                                                                                                                        |
| --------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| jobId<mark style="color:red;">\*</mark> | String | The jobId in prev request                                                                                                                          |
| hookUrl                                 | String | Send a request to the address for task completion or failed notification. If not set you need to request  [fetch endpoint](#fetch) to get response |
| timeout                                 | int    | Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds                                                               |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

#### Example Request

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

```
import requests

endpoint = "https://api.ttapi.io/midjourney/v1/seed"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Php" %}

```
<?php

$url = 'https://api.ttapi.io/midjourney/v1/seed';

$data = array(
    'jobId' => 'afa774a3-1aee-5aba-4510-14818d6875e4',
    'hookUrl' => ''
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
```

{% endtab %}

{% tab title="Node" %}

```
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/seed',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```
{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
```

{% endtab %}
{% endtabs %}

## Blend \[ /blend ]

<mark style="color:green;">`POST`</mark> `https://api.ttapi.io/midjourney/v1/blend`

Upload 2-5 images and combine them into a new image based on the concept and aesthetic of each image.

#### Headers

| Name         | Type   | Description                                           |
| ------------ | ------ | ----------------------------------------------------- |
| TT-API-KEY   | String | Your API Key in TT API used for request authorization |
| Content-Type | String | application-json                                      |

#### Request Body

| Name                                             | Type   | Description                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| imgBase64Array<mark style="color:red;">\*</mark> | Array  | <p>Base64 array of images that will be used to generate mixed images</p><p>Array length is 2-5</p><p>Eg: \[</p><p>"data:image/png;base64,xxx1", "data:image/png;base64,xxx2"</p><p>]</p>                                                                                                                                                                         |
| hookUrl                                          | String | Send a request to the address for task completion or failed notification. If not set you need to request  [fetch endpoint](#fetch) to get response                                                                                                                                                                                                               |
| timeout                                          | int    | Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds                                                                                                                                                                                                                                                                             |
| dimensions                                       | String | <p>Scale of generated image, including <strong>PORTRAIT</strong></p><p><strong>, SQUARE, LANDSCAPE</strong>. If not filled in, <strong>SQUARE</strong> is used by default.</p><p><strong>PORTRAIT</strong> corresponds to the ratio 2:3</p><p><strong>SQUARE</strong> corresponding ratio 1:1</p><p><strong>LANDSCAPE</strong> corresponds to a ratio of 3:2</p> |
| mode                                             | String | The task mode for generating images,  including [fast, relax and turbo](https://docs.mjapiapp.com/tt-api-document#mode). If not filled in, the fast mode will be used by default.                                                                                                                                                                                |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

#### Example Request

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

```
import requests

endpoint = "https://api.ttapi.io/midjourney/v1/blend"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "imgBase64Array": ["data:image/png;base64,xxx1","data:image/png;base64,xxx2"],
    "dimensions": "SQUARE",
    "model": "fast",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Php" %}

```
<?php

$url = 'https://api.ttapi.io/midjourney/v1/blend';

$data = array(
    "imgBase64Array" => ["data:image/png;base64,xxx1","data:image/png;base64,xxx2"],
    "dimensions" => "SQUARE",
    "model" => "fast",
    "hookUrl" => ""
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
```

{% endtab %}

{% tab title="Node" %}

```
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/blend',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "imgBase64Array" => ["data:image/png;base64,xxx1","data:image/png;base64,xxx2"],
    "dimensions" => "SQUARE",
    "model" => "fast",
    "hookUrl" => ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```
{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
```

{% endtab %}
{% endtabs %}

## Describe\[ /describe ]

<mark style="color:green;">`POST`</mark> `https://api.ttapi.io/midjourney/v1/describe`

Upload an image and generate four prompts based on the image.

#### Headers

| Name         | Type   | Description                                           |
| ------------ | ------ | ----------------------------------------------------- |
| TT-API-KEY   | String | Your API Key in TT API used for request authorization |
| Content-Type | String | application-json                                      |

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                       |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| base64<mark style="color:red;">\*</mark> | String | <p>base64 encoding of image</p><p>Eg: data:image/png;base64,xxx1</p>                                                                                                              |
| hookUrl                                  | String | Send a request to the address for task completion or failed notification. If not set you need to request  [fetch endpoint](#fetch) to get response                                |
| timeout                                  | int    | Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds                                                                                              |
| mode                                     | String | The task mode for generating images,  including [fast, relax and turbo](https://docs.mjapiapp.com/tt-api-document#mode). If not filled in, the fast mode will be used by default. |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

#### Example Request

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

```
import requests

endpoint = "https://api.ttapi.io/midjourney/v1/describe"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "base64": "data:image/png;base64,xxx1",
    "model": "fast",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Php" %}

```
<?php

$url = 'https://api.ttapi.io/midjourney/v1/describe';

$data = array(
    "base64" => "data:image/png;base64,xxx1",
    "model" => "fast",
    "hookUrl" => ""
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
```

{% endtab %}

{% tab title="Node" %}

```
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/describe',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "base64" => "data:image/png;base64,xxx1",
    "model" => "fast",
    "hookUrl" => ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```
{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
```

{% endtab %}
{% endtabs %}

## Inpaint\[ Vary(region) ]

<mark style="color:green;">`POST`</mark> `https://api.ttapi.io/midjourney/v1/inpaint`

Partial modifies of the image.

#### Headers

| Name         | Type   | Description                                           |
| ------------ | ------ | ----------------------------------------------------- |
| TT-API-KEY   | String | Your API Key in TT API used for request authorization |
| Content-Type | String | application-json                                      |

#### Request Body

| Name                                    | Type   | Description                                                                                                                                        |
| --------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Jobid<mark style="color:red;">\*</mark> | String | The jobId in prev request                                                                                                                          |
| mask<mark style="color:red;">\*</mark>  | String | <p>base64 encoding of image</p><p>Eg: UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA...</p>                                                                      |
| prompt                                  | String | Drawing prompt for selected areas                                                                                                                  |
| timeout                                 | int    | Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds                                                               |
| hookUrl                                 | String | Send a request to the address for task completion or failed notification. If not set you need to request  [fetch endpoint](#fetch) to get response |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

#### Example Request

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

```
import requests

endpoint = "https://api.ttapi.io/midjourney/v1/inpaint"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "prompt": "white background",
    "mask": "UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA..."
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

{% endtab %}

{% tab title="Php" %}

```
<?php

$url = 'https://api.ttapi.io/midjourney/v1/inpaint';

$data = array(
    "jobId" => "afa774a3-1aee-5aba-4510-14818d6875e4",
    "prompt" => "white background",
    "mask"   => "UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA..."
    "hookUrl" => ""
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
```

{% endtab %}

{% tab title="Node" %}

```
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/inpaint',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
     "jobId" => "afa774a3-1aee-5aba-4510-14818d6875e4",
    "prompt" => "white background",
    "mask"   => "UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA..."
    "hookUrl" => ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```
{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
```

{% endtab %}
{% endtabs %}

## Fetch Job

<mark style="color:blue;">`GET`</mark> `https://api.ttapi.io/midjourney/v1/fetch`

to fetch the job result

#### Headers

| Name       | Type   | Description                                           |
| ---------- | ------ | ----------------------------------------------------- |
| TT-API-KEY | String | Your API Key in TT API used for request authorization |

#### Request Body

| Name                                    | Type   | Description                          |
| --------------------------------------- | ------ | ------------------------------------ |
| jobId<mark style="color:red;">\*</mark> | String | f5850038-90a3-8a97-0476-107ea4b8dac4 |

{% tabs %}
{% tab title="200: OK the result same as hookUrl result" %}
the result same as [hookUrl result](#asynchronous-callback-return-structure)
{% endtab %}
{% endtabs %}

###

### Action Used In action endpoint

{% hint style="info" %}
For specific usage of related operations, you can read [Midjourney’s official doc](https://docs.midjourney.com/v1/docs) in detail.
{% endhint %}

<table><thead><tr><th>name</th><th>description</th><th data-type="files">exp in midjourney</th><th data-hidden>description</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>upsample1</strong></td><td><p>Button <strong>UI - U4</strong></p><p>Same as <strong>upsample2,  upsample3, upsample4</strong></p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FIMdckP3viSoUrbeCxoHB%2F2a56f3b2b2153ff6ca297bd452ffd11.png?alt=media&#x26;token=00332f8f-0dd7-42e5-a2ab-469073548a44">upsample</a></td><td>Zoom into the first of the four images generated</td><td></td></tr><tr><td><strong>variation1</strong></td><td><p>Button <strong>V1 - V4</strong></p><p>Same as <strong>variation2, variation3, variation4</strong></p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2F8MTaAB03LGO8uKE7yMNz%2F5aab5676f0706e92b0201e192a88513.png?alt=media&#x26;token=c23493b2-a6e2-494f-bddd-d7185f6d15c4">variation</a></td><td></td><td></td></tr><tr><td><strong>high_variation</strong></td><td>Button <strong>Vary (Strong)</strong><br>Make drastic changes to your image</td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FQFrHg9hN3fnjw4ko5s1D%2F9bc383e4844dd47e37bc2d77ef0291d.png?alt=media&#x26;token=cd6a7dd5-9101-42e9-b82c-ef5beef9bce4">high_variation</a></td><td></td><td></td></tr><tr><td><strong>low_variation</strong></td><td>Button <strong>Vary (Subtle)</strong><br>Make small changes to the image</td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FDpX8tcKuduFMNOsJtdFM%2F67f23f77e3bf1b0569f18d9322b13e3.png?alt=media&#x26;token=62f81c99-9da1-4b24-8f04-0597683399b6">low_variation</a></td><td></td><td></td></tr><tr><td><strong>upscale2</strong></td><td><p>Button <strong>Upscale(2x)</strong> </p><p>Image magnification 2 times, only exists in v5 mode</p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FYHAheih7GRWagUdcpwYi%2Fc0c9663759bb3798094caafda4d5756.png?alt=media&#x26;token=70fbf20e-5c02-40d1-bec2-6a0cafce06b0">upscale2</a></td><td></td><td></td></tr><tr><td><strong>upscale4</strong></td><td><p>Button <strong>Upscale(4x)</strong> </p><p>Image magnification 4 times, only exists in v5 mode</p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FrMDaHXkhUSBNy9YJ7wS8%2F1a474d630964d867db487351ca8f74a.png?alt=media&#x26;token=844f71aa-abfb-42ea-812f-aca6b34eed5a">upscale4</a></td><td></td><td></td></tr><tr><td><strong>zoom_out_2</strong></td><td><p>Button <strong>Zoom Out 2x</strong> </p><p>The Zoom Out option expands the canvas of the enlarged image without changing the original image, filling the new space based on the prompt and the initial image.</p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FynO73SksRunNz6AVctlQ%2F735cb80182f5ab3da2ccdbd0fd9312b.png?alt=media&#x26;token=1807f136-c519-4aa5-a749-8c3a5b1f54f1">zoom_out_2</a></td><td></td><td></td></tr><tr><td><strong>zoom_out_1_5</strong></td><td><p>Button  <strong>Zoom Out 1.5x</strong> </p><p>The Zoom Out option expands the canvas of the enlarged image without changing the original image, filling the new space based on the prompt and the initial image.</p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2F3vLorS6uAuE4vHp3d3dX%2Fa305801f760a671015913553ae2e3a7.png?alt=media&#x26;token=6abf28d5-fa29-449d-ac1b-242919cffc80">zoom_out_1_5</a></td><td></td><td></td></tr><tr><td><strong>pan_left</strong></td><td>Button <strong>⬅️➡️⬆️⬇️</strong> <br>Same as <strong>pan_right, pan_up, pan_down</strong></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FSWUZsw8xVFhrhAb88Uos%2F9eb6453b57d76445fe335cceeba3319.png?alt=media&#x26;token=b93164ca-8bbb-4827-97c3-4f79ed057cb4">pan</a></td><td></td><td></td></tr><tr><td><strong>upscale_creative</strong></td><td>Button <strong>Upscale(Creative)</strong> Only exists in v6 mode</td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2FyEkO6WBGYihLsdrtKzLd%2Fupscale_creative.png?alt=media&#x26;token=f2b33b31-efb1-40b4-86f3-0a813bc636bd">upscale_creative.png</a></td><td></td><td></td></tr><tr><td><strong>upscale_subtle</strong></td><td><p>Button <strong>Upscale(Subtle)</strong> </p><p>Only exists in v6 mode</p></td><td><a href="https://4052712861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbK2BaXDg3MX3dbEzFd64%2Fuploads%2F0zbw2NNxVouE0Iid4oKa%2Fupscale_subtle.png?alt=media&#x26;token=147f4ac3-bdbf-4c25-ad2d-2063a3a53e56">upscale_subtle.png</a></td><td></td><td></td></tr></tbody></table>

### Async callback return json structure

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

```
{
    "status": "SUCCESS",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "success",
    "data": {
        "actions": "imagine",
        "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
        "progress": "100",
        "prompt": "Soccer star Max Kruse and Jan-Peter Jachtmann victims of €528,695 poker scam, German soccer star Max Kruse and WSOP Main Event finalist Jan-Peter Jachtmann are among the players who have been swindled out of €528,695., poker, realistic --ar 1280:720",
        "discordImage": "https://cdn.discordapp.com/attachments/1107938555931656214/1176340921227423844/voyagel_Soccer_star_Max_Kruse_and_Jan-Peter_Jachtmann_victims_o_c513a87b-eed3-4a3b-ab97-6be4dbc3ea99.png?ex=656e83da&is=655c0eda&hm=6e06a1dec3c6c1be209799884681969878eabb81ce81f8db22d54480379fcd9b&",
        "cdnImage": "http://127.0.0.1/8080/pics/452020f2-6793-4525-a1b5-472cac439610.png",
        "hookUrl": "",
        "components": [
            "upsample1",
            "upsample2",
            "upsample3",
            "upsample4",
            "variation1",
            "variation2",
            "variation3",
            "variation4"
        ],
        "seed":"",
        "images":[
            "https://cdnb.ttapi.io/2024-04-02/27024084bcd54b1c38d085d11d8dc841037a2262ebeda29b3f67b741441f6736.png",
            "https://cdnb.ttapi.io/2024-04-02/e15e39f6eb39191fdf3f176f8c979b6e57254114a8bfea826e30f23850d0d485.png",
            "https://cdnb.ttapi.io/2024-04-02/4b7910497a0d79d0155cd8b33eea313425cf2b809efef4b6ba3960aa1c2bd484.png",
            "https://cdnb.ttapi.io/2024-04-02/98b162a1da713eef23c3cfd5f166aee8e4ee09f8cf1f7bbc24bf72990eb80adf.png"
        ]
    }
}
```

{% endtab %}

{% tab title="PENDING\_QUEUE" %}

```
{
    "status": "PENDING_QUEUE",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "",
    "data": []
}
```

{% endtab %}

{% tab title="ON\_QUEUE" %}

```
{
    "status": "ON_QUEUE",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "",
    "data": {
        "actions": "imagine",
        "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
        "progress": "100",
        "prompt": "Soccer star Max Kruse and Jan-Peter Jachtmann victims of €528,695 poker scam, German soccer star Max Kruse and WSOP Main Event finalist Jan-Peter Jachtmann are among the players who have been swindled out of €528,695., poker, realistic --ar 1280:720",
        "discordImage": "https://cdn.discordapp.com/attachments/1107938555931656214/1176340921227423844/voyagel_Soccer_star_Max_Kruse_and_Jan-Peter_Jachtmann_victims_o_c513a87b-eed3-4a3b-ab97-6be4dbc3ea99.png?ex=656e83da&is=655c0eda&hm=6e06a1dec3c6c1be209799884681969878eabb81ce81f8db22d54480379fcd9b&",
        "cdnImage": "http://127.0.0.1/8080/pics/452020f2-6793-4525-a1b5-472cac439610.png",
        "hookUrl": "",
        "components": [],
        "seed":null,
        "images":null
    }
}
```

{% endtab %}

{% tab title="FAILED" %}

```
{
    "status": "FAILED",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "failed",
    "data": []
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Starting from December 1, 2023**, the cdn image link returned by discord will **expire after 24 hours.**
{% endhint %}

### &#x20;Return body enumeration details

| name         | value                                                                                                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status       | <p>PENDING\_QUEUE</p><p>ON\_QUEUE</p><p>SUCCESS<br>FAILED</p>                                                                                                             |
| progess      | Completeness : 0-100                                                                                                                                                      |
| components   | [Support Next Actions ](#action-u1-u4-v1-v4)                                                                                                                              |
| discordImage | Discord cdn image url                                                                                                                                                     |
| images       | CDN address of TTAPI, four small pictures generated by the imagine command. **This field is only valid with the imagine command,** and the address will never be invalid. |
