> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akool.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Image Result

> Retrieve image generation results by ID

## Endpoint

```
GET https://openapi.akool.com/api/open/v3/content/image/infobymodelid?image_model_id={{image_model_id}}
```

## Request Headers

| **Parameter** | **Value**        | **Description**                                                                                                                                                 |
| ------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| x-api-key     | API Key          | Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded. |
| Authorization | Bearer `{token}` | Your API Key used for request authorization.[Get Token](/authentication/usage#get-the-token)                                                                    |

## Query Parameters

| **Parameter**    | **Type** | **Required** | **Description**                                                                                                                                                                                       |
| ---------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| image\_model\_id | String   | true         | The `_id` returned from the [Create By Source Prompt API](/ai-tools-suite/image-generate/create-by-source-prompt) or [Generate 4K or Variations API](/ai-tools-suite/image-generate/create-by-button) |

## Response Attributes

| **Parameter**       | **Type** | **Description**                                                          |
| ------------------- | -------- | ------------------------------------------------------------------------ |
| code                | Integer  | Interface returns business status code (1000:success)                    |
| msg                 | String   | Interface returns status information                                     |
| data                | Object   | Response data object                                                     |
| - \_id              | String   | Document ID                                                              |
| - create\_time      | Long     | Creation timestamp                                                       |
| - uid               | Integer  | User ID                                                                  |
| - type              | Integer  | Type identifier                                                          |
| - image\_status     | Integer  | Status: 1=queueing, 2=processing, 3=completed, 4=failed                  |
| - image             | String   | Image result URL (available when image\_status = 3)                      |
| - deduction\_credit | Integer  | Credits deducted                                                         |
| - buttons           | Array    | Available operation buttons (U1-U4 for 4K upscale, V1-V4 for variations) |
| - used\_buttons     | Array    | Already used buttons                                                     |
| - upscaled\_urls    | Array    | Upscaled image URLs                                                      |

## Example

### Request

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://openapi.akool.com/api/open/v3/content/image/infobymodelid?image_model_id=662a10df4197b3af58532e89' \
  --header 'x-api-key: {{API Key}}'
  ```

  ```java Java theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
  Request request = new Request.Builder()
    .url("https://openapi.akool.com/api/open/v3/content/image/infobymodelid?image_model_id=662a10df4197b3af58532e89")
    .method("GET", null)
    .addHeader("x-api-key", "{{API Key}}")
    .build();
  Response response = client.newCall(request).execute();
  ```

  ```js Javascript theme={null}
  const myHeaders = new Headers();
  myHeaders.append("x-api-key", "{{API Key}}");

  const requestOptions = {
    method: "GET",
    headers: myHeaders,
    redirect: "follow"
  };

  fetch("https://openapi.akool.com/api/open/v3/content/image/infobymodelid?image_model_id=662a10df4197b3af58532e89", requestOptions)
    .then((response) => response.text())
    .then((result) => console.log(result))
    .catch((error) => console.error(error));
  ```

  ```php PHP theme={null}
  <?php
  $client = new Client();
  $headers = [
    'x-api-key' =>'{{API Key}}'
  ];
  $request = new Request('GET', 'https://openapi.akool.com/api/open/v3/content/image/infobymodelid?image_model_id=662a10df4197b3af58532e89', $headers);
  $res = $client->sendAsync($request)->wait();
  echo $res->getBody();
  ?>
  ```

  ```python Python theme={null}
  import requests

  url = "https://openapi.akool.com/api/open/v3/content/image/infobymodelid?image_model_id=662a10df4197b3af58532e89"

  headers = {
    'x-api-key':'{{API Key}}'
  }

  response = requests.request("GET", url, headers=headers)
  print(response.text)
  ```
</CodeGroup>

### Response

#### Completed Status (image\_status = 3)

```json theme={null}
{
  "code": 1000,
  "msg": "OK",
  "data": {
    "faceswap_quality": 2,
    "deduction_credit": 2,
    "buttons": [
      "U1", "U2", "U3", "U4",
      "V1", "V2", "V3", "V4"
    ],
    "used_buttons": [],
    "upscaled_urls": [],
    "_id": "662a10df4197b3af58532e89",
    "create_time": 1714032863272,
    "uid": 378337,
    "type": 3,
    "image_status": 3,
    "image": "https://***.cloudfront.net/1714032892336-e0ec9305-e217-4b79-8704-e595a822c12b-8013.png"
  }
}
```

## Image Status

| Status | Description                                                             |
| ------ | ----------------------------------------------------------------------- |
| 1      | In Queue - Your request is waiting to be processed                      |
| 2      | Processing - Image is currently being generated                         |
| 3      | Success - Image completed, result URL is available in the `image` field |
| 4      | Failed - Image generation failed, check your input                      |

## Important Notes

* Use the `_id` field from the [Create By Source Prompt API](/ai-tools-suite/image-generate/create-by-source-prompt) or [Generate 4K or Variations API](/ai-tools-suite/image-generate/create-by-button) response as the `image_model_id` parameter
* Poll this endpoint periodically to check the image generation status
* When `image_status` is 3 (Success), the `image` field will contain the URL of the generated image
* The `buttons` field lists available operations (U1-U4 for 4K upscale, V1-V4 for variations) - use these with the [Generate 4K or Variations API](/ai-tools-suite/image-generate/create-by-button)
* Generated images are valid for 7 days, download and save them promptly
* If a webhook URL was provided during creation, you will receive a callback when the task completes (no need to poll)
